From 09edcb8ab75ede51e9edc1bd071e5a11daf8e149 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 10 Oct 2025 07:56:53 -0700 Subject: [PATCH 01/69] Optimize resolution of single non-generic construct signatures (#1865) --- internal/checker/checker.go | 10 ++-- .../abstractClassInLocalScopeIsAbstract.types | 2 +- ...ractClassInLocalScopeIsAbstract.types.diff | 11 ++++ .../compiler/newAbstractInstance2.types | 2 +- .../compiler/newAbstractInstance2.types.diff | 9 ++++ .../submodule/compiler/noCrashOnMixin.types | 2 +- .../compiler/noCrashOnMixin.types.diff | 10 +++- ...lassAbstractConstructorAssignability.types | 2 +- ...bstractConstructorAssignability.types.diff | 11 ++++ .../classAbstractFactoryFunction.types | 2 +- .../classAbstractFactoryFunction.types.diff | 10 ++++ .../classAbstractImportInstantiation.types | 4 +- ...lassAbstractImportInstantiation.types.diff | 18 +++++++ .../conformance/classAbstractInAModule.types | 2 +- .../classAbstractInAModule.types.diff | 11 ++++ .../classAbstractInstantiations1.types | 6 +-- .../classAbstractInstantiations1.types.diff | 25 ++++++++++ .../classAbstractInstantiations2.types | 6 +-- .../classAbstractInstantiations2.types.diff | 29 +++++++++++ .../classAbstractMergedDeclaration.types | 16 +++--- .../classAbstractMergedDeclaration.types.diff | 50 +++++++++++++++++++ .../classAbstractSingleLineDecl.types | 2 +- .../classAbstractSingleLineDecl.types.diff | 11 ++++ .../classAbstractUsingAbstractMethod1.types | 2 +- ...assAbstractUsingAbstractMethod1.types.diff | 11 ++++ .../classConstructorAccessibility.js | 4 +- .../classConstructorAccessibility.js.diff | 12 ++++- .../classConstructorAccessibility.types | 8 +-- .../classConstructorAccessibility.types.diff | 20 ++++++++ .../classConstructorAccessibility2.js | 4 +- .../classConstructorAccessibility2.js.diff | 13 ++++- .../classConstructorAccessibility2.types | 12 ++--- .../classConstructorAccessibility2.types.diff | 36 +++++++++++++ .../classConstructorAccessibility5.types | 2 +- .../classConstructorAccessibility5.types.diff | 10 ++++ .../typesWithPrivateConstructor.errors.txt | 14 +++++- ...ypesWithPrivateConstructor.errors.txt.diff | 35 +++++++++++++ .../typesWithPrivateConstructor.js | 4 +- .../typesWithPrivateConstructor.js.diff | 15 ++++++ .../typesWithPrivateConstructor.symbols | 4 ++ .../typesWithPrivateConstructor.symbols.diff | 19 +++++++ .../typesWithPrivateConstructor.types | 20 ++++---- .../typesWithPrivateConstructor.types.diff | 42 ++++++++++++++++ .../typesWithProtectedConstructor.errors.txt | 14 +++++- ...esWithProtectedConstructor.errors.txt.diff | 35 +++++++++++++ .../typesWithProtectedConstructor.js | 4 +- .../typesWithProtectedConstructor.js.diff | 15 ++++++ .../typesWithProtectedConstructor.symbols | 4 ++ ...typesWithProtectedConstructor.symbols.diff | 19 +++++++ .../typesWithProtectedConstructor.types | 20 ++++---- .../typesWithProtectedConstructor.types.diff | 42 ++++++++++++++++ 51 files changed, 617 insertions(+), 74 deletions(-) create mode 100644 testdata/baselines/reference/submodule/compiler/abstractClassInLocalScopeIsAbstract.types.diff create mode 100644 testdata/baselines/reference/submodule/compiler/newAbstractInstance2.types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/classAbstractConstructorAssignability.types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/classAbstractFactoryFunction.types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/classAbstractImportInstantiation.types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/classAbstractInAModule.types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/classAbstractInstantiations1.types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/classAbstractInstantiations2.types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/classAbstractMergedDeclaration.types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/classAbstractSingleLineDecl.types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/classAbstractUsingAbstractMethod1.types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/classConstructorAccessibility.types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/classConstructorAccessibility5.types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.js.diff create mode 100644 testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.symbols.diff create mode 100644 testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.js.diff create mode 100644 testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.symbols.diff create mode 100644 testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.types.diff diff --git a/internal/checker/checker.go b/internal/checker/checker.go index d2033c07d8..3d56796e37 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -7029,7 +7029,9 @@ func (c *Checker) getQuickTypeOfExpression(node *ast.Node) *Type { if isCallChain(expr) { return c.getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) } - return c.getReturnTypeOfSingleNonGenericCallSignature(c.checkNonNullExpression(expr.Expression())) + return c.getReturnTypeOfSingleNonGenericSignature(c.checkNonNullExpression(expr.Expression()), SignatureKindCall) + case ast.IsNewExpression(expr): + return c.getReturnTypeOfSingleNonGenericSignature(c.checkNonNullExpression(expr.Expression()), SignatureKindConstruct) case ast.IsAssertionExpression(expr) && !ast.IsConstTypeReference(expr.Type()): return c.getTypeFromTypeNode(expr.Type()) case ast.IsLiteralExpression(node) || ast.IsBooleanLiteral(node): @@ -7038,8 +7040,8 @@ func (c *Checker) getQuickTypeOfExpression(node *ast.Node) *Type { return nil } -func (c *Checker) getReturnTypeOfSingleNonGenericCallSignature(funcType *Type) *Type { - signature := c.getSingleCallSignature(funcType) +func (c *Checker) getReturnTypeOfSingleNonGenericSignature(funcType *Type, kind SignatureKind) *Type { + signature := c.getSingleSignature(funcType, kind, true /*allowMembers*/) if signature != nil && len(signature.typeParameters) == 0 { return c.getReturnTypeOfSignature(signature) } @@ -7049,7 +7051,7 @@ func (c *Checker) getReturnTypeOfSingleNonGenericCallSignature(funcType *Type) * func (c *Checker) getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr *ast.Node) *Type { funcType := c.checkExpression(expr.Expression()) nonOptionalType := c.getOptionalExpressionType(funcType, expr.Expression()) - returnType := c.getReturnTypeOfSingleNonGenericCallSignature(funcType) + returnType := c.getReturnTypeOfSingleNonGenericSignature(funcType, SignatureKindCall) if returnType != nil { return c.propagateOptionalTypeMarker(returnType, expr, nonOptionalType != funcType) } diff --git a/testdata/baselines/reference/submodule/compiler/abstractClassInLocalScopeIsAbstract.types b/testdata/baselines/reference/submodule/compiler/abstractClassInLocalScopeIsAbstract.types index afc238dd4c..41f28f004c 100644 --- a/testdata/baselines/reference/submodule/compiler/abstractClassInLocalScopeIsAbstract.types +++ b/testdata/baselines/reference/submodule/compiler/abstractClassInLocalScopeIsAbstract.types @@ -14,7 +14,7 @@ >A : A new A(); ->new A() : any +>new A() : A >A : typeof A new B(); diff --git a/testdata/baselines/reference/submodule/compiler/abstractClassInLocalScopeIsAbstract.types.diff b/testdata/baselines/reference/submodule/compiler/abstractClassInLocalScopeIsAbstract.types.diff new file mode 100644 index 0000000000..0b33e3aff5 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/abstractClassInLocalScopeIsAbstract.types.diff @@ -0,0 +1,11 @@ +--- old.abstractClassInLocalScopeIsAbstract.types ++++ new.abstractClassInLocalScopeIsAbstract.types +@@= skipped -13, +13 lines =@@ + >A : A + + new A(); +->new A() : any ++>new A() : A + >A : typeof A + + new B(); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/newAbstractInstance2.types b/testdata/baselines/reference/submodule/compiler/newAbstractInstance2.types index c5c5964e66..90ac3b1392 100644 --- a/testdata/baselines/reference/submodule/compiler/newAbstractInstance2.types +++ b/testdata/baselines/reference/submodule/compiler/newAbstractInstance2.types @@ -9,6 +9,6 @@ import A from "./a"; >A : typeof A new A(); ->new A() : any +>new A() : A >A : typeof A diff --git a/testdata/baselines/reference/submodule/compiler/newAbstractInstance2.types.diff b/testdata/baselines/reference/submodule/compiler/newAbstractInstance2.types.diff new file mode 100644 index 0000000000..1698e60a8b --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/newAbstractInstance2.types.diff @@ -0,0 +1,9 @@ +--- old.newAbstractInstance2.types ++++ new.newAbstractInstance2.types +@@= skipped -8, +8 lines =@@ + >A : typeof A + + new A(); +->new A() : any ++>new A() : A + >A : typeof A diff --git a/testdata/baselines/reference/submodule/compiler/noCrashOnMixin.types b/testdata/baselines/reference/submodule/compiler/noCrashOnMixin.types index f7b437d648..4ee44ae946 100644 --- a/testdata/baselines/reference/submodule/compiler/noCrashOnMixin.types +++ b/testdata/baselines/reference/submodule/compiler/noCrashOnMixin.types @@ -42,7 +42,7 @@ class CrashTrigger extends Mixin(Empty) { >trigger : () => void new Concrete(); ->new Concrete() : any +>new Concrete() : Concrete >Concrete : typeof Concrete } } diff --git a/testdata/baselines/reference/submodule/compiler/noCrashOnMixin.types.diff b/testdata/baselines/reference/submodule/compiler/noCrashOnMixin.types.diff index c2a5832969..e6805f89ec 100644 --- a/testdata/baselines/reference/submodule/compiler/noCrashOnMixin.types.diff +++ b/testdata/baselines/reference/submodule/compiler/noCrashOnMixin.types.diff @@ -24,4 +24,12 @@ +>Mixin : >(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Mixin.(Anonymous class); } & TBase >Empty : typeof Empty - public trigger() { \ No newline at end of file + public trigger() { + >trigger : () => void + + new Concrete(); +->new Concrete() : any ++>new Concrete() : Concrete + >Concrete : typeof Concrete + } + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractConstructorAssignability.types b/testdata/baselines/reference/submodule/conformance/classAbstractConstructorAssignability.types index 532bcf36d9..6c7b658586 100644 --- a/testdata/baselines/reference/submodule/conformance/classAbstractConstructorAssignability.types +++ b/testdata/baselines/reference/submodule/conformance/classAbstractConstructorAssignability.types @@ -32,7 +32,7 @@ new AA; >AA : typeof A new BB; ->new BB : any +>new BB : B >BB : typeof B new CC; diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractConstructorAssignability.types.diff b/testdata/baselines/reference/submodule/conformance/classAbstractConstructorAssignability.types.diff new file mode 100644 index 0000000000..4d2b5166fc --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/classAbstractConstructorAssignability.types.diff @@ -0,0 +1,11 @@ +--- old.classAbstractConstructorAssignability.types ++++ new.classAbstractConstructorAssignability.types +@@= skipped -31, +31 lines =@@ + >AA : typeof A + + new BB; +->new BB : any ++>new BB : B + >BB : typeof B + + new CC; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractFactoryFunction.types b/testdata/baselines/reference/submodule/conformance/classAbstractFactoryFunction.types index dd19cd586a..9fe8312498 100644 --- a/testdata/baselines/reference/submodule/conformance/classAbstractFactoryFunction.types +++ b/testdata/baselines/reference/submodule/conformance/classAbstractFactoryFunction.types @@ -24,7 +24,7 @@ function NewB(Factory: typeof B) { >B : typeof B return new B; ->new B : any +>new B : B >B : typeof B } diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractFactoryFunction.types.diff b/testdata/baselines/reference/submodule/conformance/classAbstractFactoryFunction.types.diff new file mode 100644 index 0000000000..888da4de5d --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/classAbstractFactoryFunction.types.diff @@ -0,0 +1,10 @@ +--- old.classAbstractFactoryFunction.types ++++ new.classAbstractFactoryFunction.types +@@= skipped -23, +23 lines =@@ + >B : typeof B + + return new B; +->new B : any ++>new B : B + >B : typeof B + } diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractImportInstantiation.types b/testdata/baselines/reference/submodule/conformance/classAbstractImportInstantiation.types index 8ad8545193..118f8288f9 100644 --- a/testdata/baselines/reference/submodule/conformance/classAbstractImportInstantiation.types +++ b/testdata/baselines/reference/submodule/conformance/classAbstractImportInstantiation.types @@ -8,7 +8,7 @@ module M { >A : A new A; ->new A : any +>new A : A >A : typeof A } @@ -18,6 +18,6 @@ import myA = M.A; >A : myA new myA; ->new myA : any +>new myA : myA >myA : typeof myA diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractImportInstantiation.types.diff b/testdata/baselines/reference/submodule/conformance/classAbstractImportInstantiation.types.diff new file mode 100644 index 0000000000..45c308c6c1 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/classAbstractImportInstantiation.types.diff @@ -0,0 +1,18 @@ +--- old.classAbstractImportInstantiation.types ++++ new.classAbstractImportInstantiation.types +@@= skipped -7, +7 lines =@@ + >A : A + + new A; +->new A : any ++>new A : A + >A : typeof A + } + +@@= skipped -10, +10 lines =@@ + >A : myA + + new myA; +->new myA : any ++>new myA : myA + >myA : typeof myA diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractInAModule.types b/testdata/baselines/reference/submodule/conformance/classAbstractInAModule.types index df5b2fc986..7cb2640f2f 100644 --- a/testdata/baselines/reference/submodule/conformance/classAbstractInAModule.types +++ b/testdata/baselines/reference/submodule/conformance/classAbstractInAModule.types @@ -13,7 +13,7 @@ module M { } new M.A; ->new M.A : any +>new M.A : M.A >M.A : typeof M.A >M : typeof M >A : typeof M.A diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractInAModule.types.diff b/testdata/baselines/reference/submodule/conformance/classAbstractInAModule.types.diff new file mode 100644 index 0000000000..29cb42eb4e --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/classAbstractInAModule.types.diff @@ -0,0 +1,11 @@ +--- old.classAbstractInAModule.types ++++ new.classAbstractInAModule.types +@@= skipped -12, +12 lines =@@ + } + + new M.A; +->new M.A : any ++>new M.A : M.A + >M.A : typeof M.A + >M : typeof M + >A : typeof M.A \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractInstantiations1.types b/testdata/baselines/reference/submodule/conformance/classAbstractInstantiations1.types index a578c7b6cd..d679338a70 100644 --- a/testdata/baselines/reference/submodule/conformance/classAbstractInstantiations1.types +++ b/testdata/baselines/reference/submodule/conformance/classAbstractInstantiations1.types @@ -17,11 +17,11 @@ abstract class C extends B {} >B : B new A; ->new A : any +>new A : A >A : typeof A new A(1); // should report 1 error ->new A(1) : any +>new A(1) : A >A : typeof A >1 : 1 @@ -30,7 +30,7 @@ new B; >B : typeof B new C; ->new C : any +>new C : C >C : typeof C var a : A; diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractInstantiations1.types.diff b/testdata/baselines/reference/submodule/conformance/classAbstractInstantiations1.types.diff new file mode 100644 index 0000000000..fe0f43338b --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/classAbstractInstantiations1.types.diff @@ -0,0 +1,25 @@ +--- old.classAbstractInstantiations1.types ++++ new.classAbstractInstantiations1.types +@@= skipped -16, +16 lines =@@ + >B : B + + new A; +->new A : any ++>new A : A + >A : typeof A + + new A(1); // should report 1 error +->new A(1) : any ++>new A(1) : A + >A : typeof A + >1 : 1 + +@@= skipped -13, +13 lines =@@ + >B : typeof B + + new C; +->new C : any ++>new C : C + >C : typeof C + + var a : A; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractInstantiations2.types b/testdata/baselines/reference/submodule/conformance/classAbstractInstantiations2.types index 31f717b8c7..e7d2ee8c0d 100644 --- a/testdata/baselines/reference/submodule/conformance/classAbstractInstantiations2.types +++ b/testdata/baselines/reference/submodule/conformance/classAbstractInstantiations2.types @@ -22,7 +22,7 @@ abstract class B { } new B; // error ->new B : any +>new B : B >B : typeof B var BB: typeof B = B; @@ -45,7 +45,7 @@ function constructB(Factory : typeof B) { >B : typeof B new Factory; // error -- Factory is of type typeof B. ->new Factory : any +>new Factory : B >Factory : typeof B } @@ -54,7 +54,7 @@ var BB = B; >B : typeof B new BB; // error -- BB is of type typeof B. ->new BB : any +>new BB : B >BB : typeof B var x : any = C; diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractInstantiations2.types.diff b/testdata/baselines/reference/submodule/conformance/classAbstractInstantiations2.types.diff new file mode 100644 index 0000000000..d5752a762e --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/classAbstractInstantiations2.types.diff @@ -0,0 +1,29 @@ +--- old.classAbstractInstantiations2.types ++++ new.classAbstractInstantiations2.types +@@= skipped -21, +21 lines =@@ + } + + new B; // error +->new B : any ++>new B : B + >B : typeof B + + var BB: typeof B = B; +@@= skipped -23, +23 lines =@@ + >B : typeof B + + new Factory; // error -- Factory is of type typeof B. +->new Factory : any ++>new Factory : B + >Factory : typeof B + } + +@@= skipped -9, +9 lines =@@ + >B : typeof B + + new BB; // error -- BB is of type typeof B. +->new BB : any ++>new BB : B + >BB : typeof B + + var x : any = C; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractMergedDeclaration.types b/testdata/baselines/reference/submodule/conformance/classAbstractMergedDeclaration.types index 7d89a34632..cbaa7bc8e9 100644 --- a/testdata/baselines/reference/submodule/conformance/classAbstractMergedDeclaration.types +++ b/testdata/baselines/reference/submodule/conformance/classAbstractMergedDeclaration.types @@ -53,23 +53,23 @@ declare abstract class DCC2 {} >DCC2 : DCC2 new CM; ->new CM : any +>new CM : CM >CM : typeof CM new MC; ->new MC : any +>new MC : MC >MC : typeof MC new CI; ->new CI : any +>new CI : CI >CI : typeof CI new IC; ->new IC : any +>new IC : IC >IC : typeof IC new CC1; ->new CC1 : any +>new CC1 : CC1 >CC1 : typeof CC1 new CC2; @@ -77,15 +77,15 @@ new CC2; >CC2 : typeof CC2 new DCI; ->new DCI : any +>new DCI : DCI >DCI : typeof DCI new DIC; ->new DIC : any +>new DIC : DIC >DIC : typeof DIC new DCC1; ->new DCC1 : any +>new DCC1 : DCC1 >DCC1 : typeof DCC1 new DCC2; diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractMergedDeclaration.types.diff b/testdata/baselines/reference/submodule/conformance/classAbstractMergedDeclaration.types.diff new file mode 100644 index 0000000000..812941fc72 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/classAbstractMergedDeclaration.types.diff @@ -0,0 +1,50 @@ +--- old.classAbstractMergedDeclaration.types ++++ new.classAbstractMergedDeclaration.types +@@= skipped -52, +52 lines =@@ + >DCC2 : DCC2 + + new CM; +->new CM : any ++>new CM : CM + >CM : typeof CM + + new MC; +->new MC : any ++>new MC : MC + >MC : typeof MC + + new CI; +->new CI : any ++>new CI : CI + >CI : typeof CI + + new IC; +->new IC : any ++>new IC : IC + >IC : typeof IC + + new CC1; +->new CC1 : any ++>new CC1 : CC1 + >CC1 : typeof CC1 + + new CC2; +@@= skipped -24, +24 lines =@@ + >CC2 : typeof CC2 + + new DCI; +->new DCI : any ++>new DCI : DCI + >DCI : typeof DCI + + new DIC; +->new DIC : any ++>new DIC : DIC + >DIC : typeof DIC + + new DCC1; +->new DCC1 : any ++>new DCC1 : DCC1 + >DCC1 : typeof DCC1 + + new DCC2; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractSingleLineDecl.types b/testdata/baselines/reference/submodule/conformance/classAbstractSingleLineDecl.types index 965ca1834a..ca29c2dd2e 100644 --- a/testdata/baselines/reference/submodule/conformance/classAbstractSingleLineDecl.types +++ b/testdata/baselines/reference/submodule/conformance/classAbstractSingleLineDecl.types @@ -17,7 +17,7 @@ class C {} >C : C new A; ->new A : any +>new A : A >A : typeof A new B; diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractSingleLineDecl.types.diff b/testdata/baselines/reference/submodule/conformance/classAbstractSingleLineDecl.types.diff new file mode 100644 index 0000000000..d44db4130c --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/classAbstractSingleLineDecl.types.diff @@ -0,0 +1,11 @@ +--- old.classAbstractSingleLineDecl.types ++++ new.classAbstractSingleLineDecl.types +@@= skipped -16, +16 lines =@@ + >C : C + + new A; +->new A : any ++>new A : A + >A : typeof A + + new B; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractUsingAbstractMethod1.types b/testdata/baselines/reference/submodule/conformance/classAbstractUsingAbstractMethod1.types index 2a97647260..3bbdc29a37 100644 --- a/testdata/baselines/reference/submodule/conformance/classAbstractUsingAbstractMethod1.types +++ b/testdata/baselines/reference/submodule/conformance/classAbstractUsingAbstractMethod1.types @@ -39,7 +39,7 @@ a.foo(); a = new C; // error, cannot instantiate abstract class. >a = new C : any >a : B ->new C : any +>new C : C >C : typeof C a.foo(); diff --git a/testdata/baselines/reference/submodule/conformance/classAbstractUsingAbstractMethod1.types.diff b/testdata/baselines/reference/submodule/conformance/classAbstractUsingAbstractMethod1.types.diff new file mode 100644 index 0000000000..5f1dd6caf9 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/classAbstractUsingAbstractMethod1.types.diff @@ -0,0 +1,11 @@ +--- old.classAbstractUsingAbstractMethod1.types ++++ new.classAbstractUsingAbstractMethod1.types +@@= skipped -38, +38 lines =@@ + a = new C; // error, cannot instantiate abstract class. + >a = new C : any + >a : B +->new C : any ++>new C : C + >C : typeof C + + a.foo(); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility.js b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility.js index dd5905dd43..29b9f54bde 100644 --- a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility.js +++ b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility.js @@ -98,7 +98,7 @@ declare class E { protected constructor(x: number); } declare var c: C; -declare var d: any; -declare var e: any; +declare var d: D; +declare var e: E; declare namespace Generic { } diff --git a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility.js.diff b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility.js.diff index cf734bf894..7a766a0cf8 100644 --- a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility.js.diff +++ b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility.js.diff @@ -39,4 +39,14 @@ + x; constructor(x) { this.x = x; - } \ No newline at end of file + } +@@= skipped -34, +37 lines =@@ + protected constructor(x: number); + } + declare var c: C; +-declare var d: any; +-declare var e: any; ++declare var d: D; ++declare var e: E; + declare namespace Generic { + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility.types b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility.types index 099febd28b..f013b8bf08 100644 --- a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility.types +++ b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility.types @@ -29,14 +29,14 @@ var c = new C(1); >1 : 1 var d = new D(1); // error ->d : any ->new D(1) : any +>d : D +>new D(1) : D >D : typeof D >1 : 1 var e = new E(1); // error ->e : any ->new E(1) : any +>e : E +>new E(1) : E >E : typeof E >1 : 1 diff --git a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility.types.diff b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility.types.diff new file mode 100644 index 0000000000..8226efd522 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility.types.diff @@ -0,0 +1,20 @@ +--- old.classConstructorAccessibility.types ++++ new.classConstructorAccessibility.types +@@= skipped -28, +28 lines =@@ + >1 : 1 + + var d = new D(1); // error +->d : any +->new D(1) : any ++>d : D ++>new D(1) : D + >D : typeof D + >1 : 1 + + var e = new E(1); // error +->e : any +->new E(1) : any ++>e : E ++>new E(1) : E + >E : typeof E + >1 : 1 diff --git a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.js b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.js index 92a848fe1d..710cf73e66 100644 --- a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.js +++ b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.js @@ -147,8 +147,8 @@ declare class DerivedC extends BaseC { static staticBaseInstance(): void; } declare var ba: BaseA; -declare var bb: any; -declare var bc: any; +declare var bb: BaseB; +declare var bc: BaseC; declare var da: DerivedA; declare var db: DerivedB; declare var dc: DerivedC; diff --git a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.js.diff b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.js.diff index 9ea50165ab..d5d0d88e56 100644 --- a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.js.diff +++ b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.js.diff @@ -45,4 +45,15 @@ + x; constructor(x) { super(x); - this.x = x; \ No newline at end of file + this.x = x; +@@= skipped -55, +56 lines =@@ + static staticBaseInstance(): void; + } + declare var ba: BaseA; +-declare var bb: any; +-declare var bc: any; ++declare var bb: BaseB; ++declare var bc: BaseC; + declare var da: DerivedA; + declare var db: DerivedB; + declare var dc: DerivedC; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.types b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.types index ebad2df2a5..eb0d254a66 100644 --- a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.types +++ b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.types @@ -122,13 +122,13 @@ class DerivedC extends BaseC { // error createBaseInstance() { new BaseC(10); } // error >createBaseInstance : () => void ->new BaseC(10) : any +>new BaseC(10) : BaseC >BaseC : typeof BaseC >10 : 10 static staticBaseInstance() { new BaseC(11); } // error >staticBaseInstance : () => void ->new BaseC(11) : any +>new BaseC(11) : BaseC >BaseC : typeof BaseC >11 : 11 } @@ -140,14 +140,14 @@ var ba = new BaseA(1); >1 : 1 var bb = new BaseB(1); // error ->bb : any ->new BaseB(1) : any +>bb : BaseB +>new BaseB(1) : BaseB >BaseB : typeof BaseB >1 : 1 var bc = new BaseC(1); // error ->bc : any ->new BaseC(1) : any +>bc : BaseC +>new BaseC(1) : BaseC >BaseC : typeof BaseC >1 : 1 diff --git a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.types.diff b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.types.diff new file mode 100644 index 0000000000..34e0c12ec2 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility2.types.diff @@ -0,0 +1,36 @@ +--- old.classConstructorAccessibility2.types ++++ new.classConstructorAccessibility2.types +@@= skipped -121, +121 lines =@@ + + createBaseInstance() { new BaseC(10); } // error + >createBaseInstance : () => void +->new BaseC(10) : any ++>new BaseC(10) : BaseC + >BaseC : typeof BaseC + >10 : 10 + + static staticBaseInstance() { new BaseC(11); } // error + >staticBaseInstance : () => void +->new BaseC(11) : any ++>new BaseC(11) : BaseC + >BaseC : typeof BaseC + >11 : 11 + } +@@= skipped -18, +18 lines =@@ + >1 : 1 + + var bb = new BaseB(1); // error +->bb : any +->new BaseB(1) : any ++>bb : BaseB ++>new BaseB(1) : BaseB + >BaseB : typeof BaseB + >1 : 1 + + var bc = new BaseC(1); // error +->bc : any +->new BaseC(1) : any ++>bc : BaseC ++>new BaseC(1) : BaseC + >BaseC : typeof BaseC + >1 : 1 diff --git a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility5.types b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility5.types index 331da94321..22a6b2eec2 100644 --- a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility5.types +++ b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility5.types @@ -21,7 +21,7 @@ class Unrelated { static fake() { new Base() } // error >fake : () => void ->new Base() : any +>new Base() : Base >Base : typeof Base } diff --git a/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility5.types.diff b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility5.types.diff new file mode 100644 index 0000000000..c6030005d9 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/classConstructorAccessibility5.types.diff @@ -0,0 +1,10 @@ +--- old.classConstructorAccessibility5.types ++++ new.classConstructorAccessibility5.types +@@= skipped -20, +20 lines =@@ + + static fake() { new Base() } // error + >fake : () => void +->new Base() : any ++>new Base() : Base + >Base : typeof Base + } diff --git a/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.errors.txt b/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.errors.txt index 88b431ce34..244b86443c 100644 --- a/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.errors.txt @@ -1,8 +1,12 @@ typesWithPrivateConstructor.ts(5,9): error TS2673: Constructor of class 'C' is private and only accessible within the class declaration. +typesWithPrivateConstructor.ts(6,5): error TS2322: Type 'Function' is not assignable to type '() => void'. + Type 'Function' provides no match for the signature '(): void'. typesWithPrivateConstructor.ts(13,10): error TS2673: Constructor of class 'C2' is private and only accessible within the class declaration. +typesWithPrivateConstructor.ts(14,5): error TS2322: Type 'Function' is not assignable to type '(x: number) => void'. + Type 'Function' provides no match for the signature '(x: number): void'. -==== typesWithPrivateConstructor.ts (2 errors) ==== +==== typesWithPrivateConstructor.ts (4 errors) ==== class C { private constructor() { } } @@ -11,6 +15,9 @@ typesWithPrivateConstructor.ts(13,10): error TS2673: Constructor of class 'C2' i ~~~~~~~ !!! error TS2673: Constructor of class 'C' is private and only accessible within the class declaration. var r: () => void = c.constructor; + ~ +!!! error TS2322: Type 'Function' is not assignable to type '() => void'. +!!! error TS2322: Type 'Function' provides no match for the signature '(): void'. class C2 { private constructor(x: number); @@ -20,4 +27,7 @@ typesWithPrivateConstructor.ts(13,10): error TS2673: Constructor of class 'C2' i var c2 = new C2(); // error C2 is private ~~~~~~~~ !!! error TS2673: Constructor of class 'C2' is private and only accessible within the class declaration. - var r2: (x: number) => void = c2.constructor; \ No newline at end of file + var r2: (x: number) => void = c2.constructor; + ~~ +!!! error TS2322: Type 'Function' is not assignable to type '(x: number) => void'. +!!! error TS2322: Type 'Function' provides no match for the signature '(x: number): void'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.errors.txt.diff new file mode 100644 index 0000000000..f48b8be4f7 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.errors.txt.diff @@ -0,0 +1,35 @@ +--- old.typesWithPrivateConstructor.errors.txt ++++ new.typesWithPrivateConstructor.errors.txt +@@= skipped -0, +0 lines =@@ + typesWithPrivateConstructor.ts(5,9): error TS2673: Constructor of class 'C' is private and only accessible within the class declaration. ++typesWithPrivateConstructor.ts(6,5): error TS2322: Type 'Function' is not assignable to type '() => void'. ++ Type 'Function' provides no match for the signature '(): void'. + typesWithPrivateConstructor.ts(13,10): error TS2673: Constructor of class 'C2' is private and only accessible within the class declaration. +- +- +-==== typesWithPrivateConstructor.ts (2 errors) ==== ++typesWithPrivateConstructor.ts(14,5): error TS2322: Type 'Function' is not assignable to type '(x: number) => void'. ++ Type 'Function' provides no match for the signature '(x: number): void'. ++ ++ ++==== typesWithPrivateConstructor.ts (4 errors) ==== + class C { + private constructor() { } + } +@@= skipped -10, +14 lines =@@ + ~~~~~~~ + !!! error TS2673: Constructor of class 'C' is private and only accessible within the class declaration. + var r: () => void = c.constructor; ++ ~ ++!!! error TS2322: Type 'Function' is not assignable to type '() => void'. ++!!! error TS2322: Type 'Function' provides no match for the signature '(): void'. + + class C2 { + private constructor(x: number); +@@= skipped -10, +13 lines =@@ + ~~~~~~~~ + !!! error TS2673: Constructor of class 'C2' is private and only accessible within the class declaration. + var r2: (x: number) => void = c2.constructor; ++ ~~ ++!!! error TS2322: Type 'Function' is not assignable to type '(x: number) => void'. ++!!! error TS2322: Type 'Function' provides no match for the signature '(x: number): void'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.js b/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.js index 2451eec981..8c689f0d2e 100644 --- a/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.js +++ b/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.js @@ -33,10 +33,10 @@ var r2 = c2.constructor; declare class C { private constructor(); } -declare var c: any; +declare var c: C; declare var r: () => void; declare class C2 { private constructor(); } -declare var c2: any; +declare var c2: C2; declare var r2: (x: number) => void; diff --git a/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.js.diff b/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.js.diff new file mode 100644 index 0000000000..5991914cd5 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.js.diff @@ -0,0 +1,15 @@ +--- old.typesWithPrivateConstructor.js ++++ new.typesWithPrivateConstructor.js +@@= skipped -32, +32 lines =@@ + declare class C { + private constructor(); + } +-declare var c: any; ++declare var c: C; + declare var r: () => void; + declare class C2 { + private constructor(); + } +-declare var c2: any; ++declare var c2: C2; + declare var r2: (x: number) => void; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.symbols b/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.symbols index 843a7fea9f..34f55dc700 100644 --- a/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.symbols +++ b/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.symbols @@ -13,7 +13,9 @@ var c = new C(); // error C is private var r: () => void = c.constructor; >r : Symbol(r, Decl(typesWithPrivateConstructor.ts, 5, 3)) +>c.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) >c : Symbol(c, Decl(typesWithPrivateConstructor.ts, 4, 3)) +>constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) class C2 { >C2 : Symbol(C2, Decl(typesWithPrivateConstructor.ts, 5, 34)) @@ -32,5 +34,7 @@ var c2 = new C2(); // error C2 is private var r2: (x: number) => void = c2.constructor; >r2 : Symbol(r2, Decl(typesWithPrivateConstructor.ts, 13, 3)) >x : Symbol(x, Decl(typesWithPrivateConstructor.ts, 13, 9)) +>c2.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) >c2 : Symbol(c2, Decl(typesWithPrivateConstructor.ts, 12, 3)) +>constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) diff --git a/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.symbols.diff b/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.symbols.diff new file mode 100644 index 0000000000..6460378e0a --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.symbols.diff @@ -0,0 +1,19 @@ +--- old.typesWithPrivateConstructor.symbols ++++ new.typesWithPrivateConstructor.symbols +@@= skipped -12, +12 lines =@@ + + var r: () => void = c.constructor; + >r : Symbol(r, Decl(typesWithPrivateConstructor.ts, 5, 3)) ++>c.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) + >c : Symbol(c, Decl(typesWithPrivateConstructor.ts, 4, 3)) ++>constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) + + class C2 { + >C2 : Symbol(C2, Decl(typesWithPrivateConstructor.ts, 5, 34)) +@@= skipped -19, +21 lines =@@ + var r2: (x: number) => void = c2.constructor; + >r2 : Symbol(r2, Decl(typesWithPrivateConstructor.ts, 13, 3)) + >x : Symbol(x, Decl(typesWithPrivateConstructor.ts, 13, 9)) ++>c2.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) + >c2 : Symbol(c2, Decl(typesWithPrivateConstructor.ts, 12, 3)) ++>constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) diff --git a/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.types b/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.types index 81cd79c348..d125891ce5 100644 --- a/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.types +++ b/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.types @@ -8,15 +8,15 @@ class C { } var c = new C(); // error C is private ->c : any ->new C() : any +>c : C +>new C() : C >C : typeof C var r: () => void = c.constructor; >r : () => void ->c.constructor : any ->c : any ->constructor : any +>c.constructor : Function +>c : C +>constructor : Function class C2 { >C2 : C2 @@ -29,14 +29,14 @@ class C2 { } var c2 = new C2(); // error C2 is private ->c2 : any ->new C2() : any +>c2 : C2 +>new C2() : C2 >C2 : typeof C2 var r2: (x: number) => void = c2.constructor; >r2 : (x: number) => void >x : number ->c2.constructor : any ->c2 : any ->constructor : any +>c2.constructor : Function +>c2 : C2 +>constructor : Function diff --git a/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.types.diff b/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.types.diff new file mode 100644 index 0000000000..617233d1c3 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typesWithPrivateConstructor.types.diff @@ -0,0 +1,42 @@ +--- old.typesWithPrivateConstructor.types ++++ new.typesWithPrivateConstructor.types +@@= skipped -7, +7 lines =@@ + } + + var c = new C(); // error C is private +->c : any +->new C() : any ++>c : C ++>new C() : C + >C : typeof C + + var r: () => void = c.constructor; + >r : () => void +->c.constructor : any +->c : any +->constructor : any ++>c.constructor : Function ++>c : C ++>constructor : Function + + class C2 { + >C2 : C2 +@@= skipped -21, +21 lines =@@ + } + + var c2 = new C2(); // error C2 is private +->c2 : any +->new C2() : any ++>c2 : C2 ++>new C2() : C2 + >C2 : typeof C2 + + var r2: (x: number) => void = c2.constructor; + >r2 : (x: number) => void + >x : number +->c2.constructor : any +->c2 : any +->constructor : any ++>c2.constructor : Function ++>c2 : C2 ++>constructor : Function diff --git a/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.errors.txt b/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.errors.txt index 77a5a313eb..a76f1d19d2 100644 --- a/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.errors.txt @@ -1,8 +1,12 @@ typesWithProtectedConstructor.ts(5,9): error TS2674: Constructor of class 'C' is protected and only accessible within the class declaration. +typesWithProtectedConstructor.ts(6,5): error TS2322: Type 'Function' is not assignable to type '() => void'. + Type 'Function' provides no match for the signature '(): void'. typesWithProtectedConstructor.ts(13,10): error TS2674: Constructor of class 'C2' is protected and only accessible within the class declaration. +typesWithProtectedConstructor.ts(14,5): error TS2322: Type 'Function' is not assignable to type '(x: number) => void'. + Type 'Function' provides no match for the signature '(x: number): void'. -==== typesWithProtectedConstructor.ts (2 errors) ==== +==== typesWithProtectedConstructor.ts (4 errors) ==== class C { protected constructor() { } } @@ -11,6 +15,9 @@ typesWithProtectedConstructor.ts(13,10): error TS2674: Constructor of class 'C2' ~~~~~~~ !!! error TS2674: Constructor of class 'C' is protected and only accessible within the class declaration. var r: () => void = c.constructor; + ~ +!!! error TS2322: Type 'Function' is not assignable to type '() => void'. +!!! error TS2322: Type 'Function' provides no match for the signature '(): void'. class C2 { protected constructor(x: number); @@ -20,4 +27,7 @@ typesWithProtectedConstructor.ts(13,10): error TS2674: Constructor of class 'C2' var c2 = new C2(); // error C2 is protected ~~~~~~~~ !!! error TS2674: Constructor of class 'C2' is protected and only accessible within the class declaration. - var r2: (x: number) => void = c2.constructor; \ No newline at end of file + var r2: (x: number) => void = c2.constructor; + ~~ +!!! error TS2322: Type 'Function' is not assignable to type '(x: number) => void'. +!!! error TS2322: Type 'Function' provides no match for the signature '(x: number): void'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.errors.txt.diff new file mode 100644 index 0000000000..cf1b3e773c --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.errors.txt.diff @@ -0,0 +1,35 @@ +--- old.typesWithProtectedConstructor.errors.txt ++++ new.typesWithProtectedConstructor.errors.txt +@@= skipped -0, +0 lines =@@ + typesWithProtectedConstructor.ts(5,9): error TS2674: Constructor of class 'C' is protected and only accessible within the class declaration. ++typesWithProtectedConstructor.ts(6,5): error TS2322: Type 'Function' is not assignable to type '() => void'. ++ Type 'Function' provides no match for the signature '(): void'. + typesWithProtectedConstructor.ts(13,10): error TS2674: Constructor of class 'C2' is protected and only accessible within the class declaration. +- +- +-==== typesWithProtectedConstructor.ts (2 errors) ==== ++typesWithProtectedConstructor.ts(14,5): error TS2322: Type 'Function' is not assignable to type '(x: number) => void'. ++ Type 'Function' provides no match for the signature '(x: number): void'. ++ ++ ++==== typesWithProtectedConstructor.ts (4 errors) ==== + class C { + protected constructor() { } + } +@@= skipped -10, +14 lines =@@ + ~~~~~~~ + !!! error TS2674: Constructor of class 'C' is protected and only accessible within the class declaration. + var r: () => void = c.constructor; ++ ~ ++!!! error TS2322: Type 'Function' is not assignable to type '() => void'. ++!!! error TS2322: Type 'Function' provides no match for the signature '(): void'. + + class C2 { + protected constructor(x: number); +@@= skipped -10, +13 lines =@@ + ~~~~~~~~ + !!! error TS2674: Constructor of class 'C2' is protected and only accessible within the class declaration. + var r2: (x: number) => void = c2.constructor; ++ ~~ ++!!! error TS2322: Type 'Function' is not assignable to type '(x: number) => void'. ++!!! error TS2322: Type 'Function' provides no match for the signature '(x: number): void'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.js b/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.js index 5844039774..02f755bcd6 100644 --- a/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.js +++ b/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.js @@ -33,10 +33,10 @@ var r2 = c2.constructor; declare class C { protected constructor(); } -declare var c: any; +declare var c: C; declare var r: () => void; declare class C2 { protected constructor(x: number); } -declare var c2: any; +declare var c2: C2; declare var r2: (x: number) => void; diff --git a/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.js.diff b/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.js.diff new file mode 100644 index 0000000000..79b5c55e47 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.js.diff @@ -0,0 +1,15 @@ +--- old.typesWithProtectedConstructor.js ++++ new.typesWithProtectedConstructor.js +@@= skipped -32, +32 lines =@@ + declare class C { + protected constructor(); + } +-declare var c: any; ++declare var c: C; + declare var r: () => void; + declare class C2 { + protected constructor(x: number); + } +-declare var c2: any; ++declare var c2: C2; + declare var r2: (x: number) => void; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.symbols b/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.symbols index 3686bb613c..a2fc591082 100644 --- a/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.symbols +++ b/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.symbols @@ -13,7 +13,9 @@ var c = new C(); // error C is protected var r: () => void = c.constructor; >r : Symbol(r, Decl(typesWithProtectedConstructor.ts, 5, 3)) +>c.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) >c : Symbol(c, Decl(typesWithProtectedConstructor.ts, 4, 3)) +>constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) class C2 { >C2 : Symbol(C2, Decl(typesWithProtectedConstructor.ts, 5, 34)) @@ -32,5 +34,7 @@ var c2 = new C2(); // error C2 is protected var r2: (x: number) => void = c2.constructor; >r2 : Symbol(r2, Decl(typesWithProtectedConstructor.ts, 13, 3)) >x : Symbol(x, Decl(typesWithProtectedConstructor.ts, 13, 9)) +>c2.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) >c2 : Symbol(c2, Decl(typesWithProtectedConstructor.ts, 12, 3)) +>constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) diff --git a/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.symbols.diff b/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.symbols.diff new file mode 100644 index 0000000000..a60cfffa88 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.symbols.diff @@ -0,0 +1,19 @@ +--- old.typesWithProtectedConstructor.symbols ++++ new.typesWithProtectedConstructor.symbols +@@= skipped -12, +12 lines =@@ + + var r: () => void = c.constructor; + >r : Symbol(r, Decl(typesWithProtectedConstructor.ts, 5, 3)) ++>c.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) + >c : Symbol(c, Decl(typesWithProtectedConstructor.ts, 4, 3)) ++>constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) + + class C2 { + >C2 : Symbol(C2, Decl(typesWithProtectedConstructor.ts, 5, 34)) +@@= skipped -19, +21 lines =@@ + var r2: (x: number) => void = c2.constructor; + >r2 : Symbol(r2, Decl(typesWithProtectedConstructor.ts, 13, 3)) + >x : Symbol(x, Decl(typesWithProtectedConstructor.ts, 13, 9)) ++>c2.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) + >c2 : Symbol(c2, Decl(typesWithProtectedConstructor.ts, 12, 3)) ++>constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) diff --git a/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.types b/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.types index 99a4168b2f..86a79a727c 100644 --- a/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.types +++ b/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.types @@ -8,15 +8,15 @@ class C { } var c = new C(); // error C is protected ->c : any ->new C() : any +>c : C +>new C() : C >C : typeof C var r: () => void = c.constructor; >r : () => void ->c.constructor : any ->c : any ->constructor : any +>c.constructor : Function +>c : C +>constructor : Function class C2 { >C2 : C2 @@ -29,14 +29,14 @@ class C2 { } var c2 = new C2(); // error C2 is protected ->c2 : any ->new C2() : any +>c2 : C2 +>new C2() : C2 >C2 : typeof C2 var r2: (x: number) => void = c2.constructor; >r2 : (x: number) => void >x : number ->c2.constructor : any ->c2 : any ->constructor : any +>c2.constructor : Function +>c2 : C2 +>constructor : Function diff --git a/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.types.diff b/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.types.diff new file mode 100644 index 0000000000..593d417bd7 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typesWithProtectedConstructor.types.diff @@ -0,0 +1,42 @@ +--- old.typesWithProtectedConstructor.types ++++ new.typesWithProtectedConstructor.types +@@= skipped -7, +7 lines =@@ + } + + var c = new C(); // error C is protected +->c : any +->new C() : any ++>c : C ++>new C() : C + >C : typeof C + + var r: () => void = c.constructor; + >r : () => void +->c.constructor : any +->c : any +->constructor : any ++>c.constructor : Function ++>c : C ++>constructor : Function + + class C2 { + >C2 : C2 +@@= skipped -21, +21 lines =@@ + } + + var c2 = new C2(); // error C2 is protected +->c2 : any +->new C2() : any ++>c2 : C2 ++>new C2() : C2 + >C2 : typeof C2 + + var r2: (x: number) => void = c2.constructor; + >r2 : (x: number) => void + >x : number +->c2.constructor : any +->c2 : any +->constructor : any ++>c2.constructor : Function ++>c2 : C2 ++>constructor : Function From 7dd4ae509d61a019cdc9bcc74b770d2d11a3ea0b Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 10 Oct 2025 09:23:10 -0700 Subject: [PATCH 02/69] Fix number conversion for Go 1.26 (#1864) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- internal/jsnum/jsnum.go | 32 +++++++++++++++++--------------- internal/jsnum/jsnum_test.go | 14 +++++++------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/internal/jsnum/jsnum.go b/internal/jsnum/jsnum.go index 14d8338a08..9e54baaf72 100644 --- a/internal/jsnum/jsnum.go +++ b/internal/jsnum/jsnum.go @@ -41,31 +41,33 @@ func isNonFinite(x float64) bool { } // https://tc39.es/ecma262/2024/multipage/abstract-operations.html#sec-touint32 -func (n Number) toUint32() uint32 { +func (x Number) toUint32() uint32 { + // The only difference between ToUint32 and ToInt32 is the interpretation of the bits. + return uint32(x.toInt32()) +} + +// https://tc39.es/ecma262/2024/multipage/abstract-operations.html#sec-toint32 +func (n Number) toInt32() int32 { x := float64(n) - // Fast path: if the number is the range (-2^31, 2^32), i.e. an SMI, + + // Fast path: if the number is in the range (-2^31, 2^32), i.e. an SMI, // then we don't need to do any special mapping. if smi := int32(x); float64(smi) == x { - return uint32(smi) + return smi } - // If the number is non-finite (NaN, +Inf, -Inf; exp=0x7FF), it maps to zero. + // 2. If number is not finite or number is either +0𝔽 or -0𝔽, return +0𝔽. + // Zero was covered by the test above. if isNonFinite(x) { return 0 } - // Otherwise, take x modulo 2^32, mapping positive numbers - // to [0, 2^32) and negative numbers to (-2^32, -0.0]. + // Let int be truncate(ℝ(number)). + x = math.Trunc(x) + // Let int32bit be int modulo 2**32. x = math.Mod(x, 1<<32) - - // Convert to uint32, which will wrap negative numbers. - return uint32(x) -} - -// https://tc39.es/ecma262/2024/multipage/abstract-operations.html#sec-toint32 -func (x Number) toInt32() int32 { - // The only difference between ToUint32 and ToInt32 is the interpretation of the bits. - return int32(x.toUint32()) + // If int32bit ≥ 2**31, return 𝔽(int32bit - 2**32); otherwise return 𝔽(int32bit). + return int32(int64(x)) } func (x Number) toShiftCount() uint32 { diff --git a/internal/jsnum/jsnum_test.go b/internal/jsnum/jsnum_test.go index 6036d0be9d..53c358204d 100644 --- a/internal/jsnum/jsnum_test.go +++ b/internal/jsnum/jsnum_test.go @@ -109,18 +109,18 @@ func TestBitwiseNOT(t *testing.T) { t.Parallel() tests := []struct { - input, want Number + got, want Number }{ - {-2147483649, Number(2147483647).BitwiseNOT()}, - {-4294967296, Number(0).BitwiseNOT()}, - {2147483648, Number(-2147483648).BitwiseNOT()}, - {4294967296, Number(0).BitwiseNOT()}, + {Number(-2147483649).BitwiseNOT(), Number(2147483647).BitwiseNOT()}, + {Number(-4294967296).BitwiseNOT(), Number(0).BitwiseNOT()}, + {Number(2147483648).BitwiseNOT(), Number(-2147483648).BitwiseNOT()}, + {Number(4294967296).BitwiseNOT(), Number(0).BitwiseNOT()}, } for _, test := range tests { - t.Run(test.input.String(), func(t *testing.T) { + t.Run(test.got.String(), func(t *testing.T) { t.Parallel() - assertEqualNumber(t, test.input.BitwiseNOT(), test.want) + assertEqualNumber(t, test.got, test.want) }) } } From cf3e0c2d2b360f5d542bc0d6f46bce3c2903e77d Mon Sep 17 00:00:00 2001 From: "Oleksandr T." Date: Fri, 10 Oct 2025 23:25:41 +0300 Subject: [PATCH 03/69] fix(1374): support declaration emit for expando functions (#1399) --- internal/ast/utilities.go | 31 +- internal/binder/binder.go | 16 +- internal/binder/referenceresolver.go | 13 + internal/checker/checker.go | 12 +- internal/checker/emitresolver.go | 12 + internal/checker/utilities.go | 8 +- internal/ls/findallreferences.go | 2 +- internal/parser/parser.go | 14 +- .../transformers/declarations/transform.go | 213 ++++++++++-- .../declarationEmitExpandoFunction.js | 57 +++ .../declarationEmitExpandoFunction.symbols | 40 +++ .../declarationEmitExpandoFunction.types | 45 +++ ...onEmitDefaultExportWithStaticAssignment.js | 24 +- ...tDefaultExportWithStaticAssignment.js.diff | 43 +-- ...nEmitExpandoPropertyPrivateName.errors.txt | 14 + ...ExpandoPropertyPrivateName.errors.txt.diff | 22 +- ...clarationEmitExpandoPropertyPrivateName.js | 3 + ...tionEmitExpandoPropertyPrivateName.js.diff | 5 +- ...arationEmitExpandoWithGenericConstraint.js | 8 +- ...onEmitExpandoWithGenericConstraint.js.diff | 17 +- .../declarationEmitFunctionKeywordProp.js | 17 + ...declarationEmitFunctionKeywordProp.js.diff | 28 +- .../declarationEmitLateBoundAssignments.js | 6 + ...eclarationEmitLateBoundAssignments.js.diff | 14 +- .../declarationEmitLateBoundAssignments2.js | 22 +- ...clarationEmitLateBoundAssignments2.js.diff | 34 +- .../declarationEmitLateBoundJSAssignments.js | 6 + ...larationEmitLateBoundJSAssignments.js.diff | 9 +- .../compiler/expandoFunctionBlockShadowing.js | 3 + .../expandoFunctionBlockShadowing.js.diff | 9 +- ...andoFunctionExpressionsWithDynamicNames.js | 16 +- ...unctionExpressionsWithDynamicNames.js.diff | 22 +- .../compiler/isolatedDeclarationErrors.js | 19 +- .../isolatedDeclarationErrors.js.diff | 19 +- ...olatedDeclarationErrorsExpandoFunctions.js | 21 ++ ...dDeclarationErrorsExpandoFunctions.js.diff | 23 +- .../jsDeclarationsGlobalFileConstFunction.js | 16 +- ...eclarationsGlobalFileConstFunction.js.diff | 24 +- ...eclarationsGlobalFileConstFunctionNamed.js | 24 +- ...ationsGlobalFileConstFunctionNamed.js.diff | 33 +- ...xDeclarationsWithEsModuleInteropNoCrash.js | 11 + ...arationsWithEsModuleInteropNoCrash.js.diff | 12 +- ...undFunctionMemberAssignmentDeclarations.js | 3 + ...nctionMemberAssignmentDeclarations.js.diff | 9 - .../conformance/assignmentToVoidZero2.js | 6 + .../conformance/assignmentToVoidZero2.js.diff | 6 + .../commonJSImportNestedClassTypeReference.js | 7 + ...onJSImportNestedClassTypeReference.js.diff | 8 +- .../conformance/exportDefaultNamespace.js | 6 +- .../exportDefaultNamespace.js.diff | 15 +- .../conformance/jsDeclarationsClassMethod.js | 6 + .../jsDeclarationsClassMethod.js.diff | 13 +- .../conformance/jsDeclarationsClassStatic.js | 3 + .../jsDeclarationsClassStatic.js.diff | 10 +- .../conformance/jsDeclarationsClassStatic2.js | 4 +- .../jsDeclarationsClassStatic2.js.diff | 12 +- ...tionsFunctionClassesCjsExportAssignment.js | 38 ++ ...FunctionClassesCjsExportAssignment.js.diff | 50 ++- .../jsDeclarationsFunctionKeywordProp.js | 17 + .../jsDeclarationsFunctionKeywordProp.js.diff | 26 +- ...clarationsFunctionKeywordPropExhaustive.js | 279 +++++++++++++++ ...tionsFunctionKeywordPropExhaustive.js.diff | 284 ++++++++++++++- .../jsDeclarationsFunctionLikeClasses2.js | 16 + ...jsDeclarationsFunctionLikeClasses2.js.diff | 18 +- .../jsDeclarationsFunctionPrototypeStatic.js | 7 + ...eclarationsFunctionPrototypeStatic.js.diff | 11 +- ...ationsFunctionWithDefaultAssignedMember.js | 21 +- ...sFunctionWithDefaultAssignedMember.js.diff | 26 +- .../conformance/jsDeclarationsFunctions.js | 11 + .../jsDeclarationsFunctions.js.diff | 20 +- ...tionsParameterTagReusesInputNodeInEmit1.js | 7 + ...ParameterTagReusesInputNodeInEmit1.js.diff | 12 +- ...tionsParameterTagReusesInputNodeInEmit2.js | 7 + ...ParameterTagReusesInputNodeInEmit2.js.diff | 12 +- .../jsDeclarationsReactComponents.js | 56 +-- .../jsDeclarationsReactComponents.js.diff | 77 ++-- .../conformance/jsdocImplements_class.js | 10 + .../conformance/jsdocImplements_class.js.diff | 29 +- .../submodule/conformance/nullPropertyName.js | 279 +++++++++++++++ .../conformance/nullPropertyName.js.diff | 329 +++++++++++++++--- .../typeFromPropertyAssignment29.js | 48 ++- .../typeFromPropertyAssignment29.js.diff | 97 ++++-- .../typeFromPropertyAssignment39.js | 39 +++ .../typeFromPropertyAssignment39.js.diff | 41 ++- .../typeFromPrototypeAssignment4.js | 9 + .../typeFromPrototypeAssignment4.js.diff | 10 +- .../declarationEmitExpandoFunction.ts | 18 + 87 files changed, 2462 insertions(+), 537 deletions(-) create mode 100644 testdata/baselines/reference/compiler/declarationEmitExpandoFunction.js create mode 100644 testdata/baselines/reference/compiler/declarationEmitExpandoFunction.symbols create mode 100644 testdata/baselines/reference/compiler/declarationEmitExpandoFunction.types create mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitExpandoPropertyPrivateName.errors.txt delete mode 100644 testdata/baselines/reference/submodule/compiler/lateBoundFunctionMemberAssignmentDeclarations.js.diff create mode 100644 testdata/tests/cases/compiler/declarationEmitExpandoFunction.ts diff --git a/internal/ast/utilities.go b/internal/ast/utilities.go index 4968528f9d..1793bc63ef 100644 --- a/internal/ast/utilities.go +++ b/internal/ast/utilities.go @@ -1340,7 +1340,7 @@ func IsBindableStaticElementAccessExpression(node *Node, excludeThisKeyword bool return IsLiteralLikeElementAccess(node) && ((!excludeThisKeyword && node.Expression().Kind == KindThisKeyword) || IsEntityNameExpression(node.Expression()) || - IsBindableStaticAccessExpression(node.Expression() /*excludeThisKeyword*/, true)) + IsBindableStaticAccessExpression(node.Expression(), true /*excludeThisKeyword*/)) } func IsLiteralLikeElementAccess(node *Node) bool { @@ -2822,10 +2822,6 @@ func IsModuleExportsAccessExpression(node *Node) bool { return false } -func isLiteralLikeElementAccess(node *Node) bool { - return node.Kind == KindElementAccessExpression && IsStringOrNumericLiteralLike(node.AsElementAccessExpression().ArgumentExpression) -} - func IsCheckJSEnabledForFile(sourceFile *SourceFile, compilerOptions *core.CompilerOptions) bool { if sourceFile.CheckJsDirective != nil { return sourceFile.CheckJsDirective.Enabled @@ -3866,6 +3862,31 @@ func IsImportOrImportEqualsDeclaration(node *Node) bool { return IsImportDeclaration(node) || IsImportEqualsDeclaration(node) } +func IsKeyword(token Kind) bool { + return KindFirstKeyword <= token && token <= KindLastKeyword +} + +func IsNonContextualKeyword(token Kind) bool { + return IsKeyword(token) && !IsContextualKeyword(token) +} + +func HasModifier(node *Node, flags ModifierFlags) bool { + return node.ModifierFlags()&flags != 0 +} + +func IsExpandoInitializer(initializer *Node) bool { + if initializer == nil { + return false + } + if IsFunctionExpressionOrArrowFunction(initializer) { + return true + } + if IsInJSFile(initializer) { + return IsClassExpression(initializer) || (IsObjectLiteralExpression(initializer) && len(initializer.AsObjectLiteralExpression().Properties.Nodes) == 0) + } + return false +} + func GetContainingFunction(node *Node) *Node { return FindAncestor(node.Parent, IsFunctionLike) } diff --git a/internal/binder/binder.go b/internal/binder/binder.go index e215ef7ad3..1824ffcac1 100644 --- a/internal/binder/binder.go +++ b/internal/binder/binder.go @@ -1018,30 +1018,18 @@ func getInitializerSymbol(symbol *ast.Symbol) *ast.Symbol { case ast.IsVariableDeclaration(declaration) && (declaration.Parent.Flags&ast.NodeFlagsConst != 0 || ast.IsInJSFile(declaration)): initializer := declaration.Initializer() - if isExpandoInitializer(initializer) { + if ast.IsExpandoInitializer(initializer) { return initializer.Symbol() } case ast.IsBinaryExpression(declaration) && ast.IsInJSFile(declaration): initializer := declaration.AsBinaryExpression().Right - if isExpandoInitializer(initializer) { + if ast.IsExpandoInitializer(initializer) { return initializer.Symbol() } } return nil } -func isExpandoInitializer(initializer *ast.Node) bool { - if initializer == nil { - return false - } - if ast.IsFunctionExpressionOrArrowFunction(initializer) { - return true - } else if ast.IsInJSFile(initializer) { - return ast.IsClassExpression(initializer) || (ast.IsObjectLiteralExpression(initializer) && len(initializer.AsObjectLiteralExpression().Properties.Nodes) == 0) - } - return false -} - func (b *Binder) bindThisPropertyAssignment(node *ast.Node) { if !ast.IsInJSFile(node) { return diff --git a/internal/binder/referenceresolver.go b/internal/binder/referenceresolver.go index 8fbe5297e3..2e428044a7 100644 --- a/internal/binder/referenceresolver.go +++ b/internal/binder/referenceresolver.go @@ -11,6 +11,7 @@ type ReferenceResolver interface { GetReferencedImportDeclaration(node *ast.IdentifierNode) *ast.Declaration GetReferencedValueDeclaration(node *ast.IdentifierNode) *ast.Declaration GetReferencedValueDeclarations(node *ast.IdentifierNode) []*ast.Declaration + GetElementAccessExpressionName(expression *ast.ElementAccessExpression) string } type ReferenceResolverHooks struct { @@ -21,6 +22,7 @@ type ReferenceResolverHooks struct { GetSymbolOfDeclaration func(*ast.Declaration) *ast.Symbol GetTypeOnlyAliasDeclaration func(symbol *ast.Symbol, include ast.SymbolFlags) *ast.Declaration GetExportSymbolOfValueSymbolIfExported func(*ast.Symbol) *ast.Symbol + GetElementAccessExpressionName func(*ast.ElementAccessExpression) (string, bool) } var _ ReferenceResolver = &referenceResolver{} @@ -236,3 +238,14 @@ func (r *referenceResolver) GetReferencedValueDeclarations(node *ast.IdentifierN } return declarations } + +func (r *referenceResolver) GetElementAccessExpressionName(expression *ast.ElementAccessExpression) string { + if expression != nil { + if r.hooks.GetElementAccessExpressionName != nil { + if name, ok := r.hooks.GetElementAccessExpressionName(expression); ok { + return name + } + } + } + return "" +} diff --git a/internal/checker/checker.go b/internal/checker/checker.go index 3d56796e37..48982081a7 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -4234,7 +4234,7 @@ func (c *Checker) checkBaseTypeAccessibility(t *Type, node *ast.Node) { signatures := c.getSignaturesOfType(t, SignatureKindConstruct) if len(signatures) != 0 { declaration := signatures[0].declaration - if declaration != nil && HasModifier(declaration, ast.ModifierFlagsPrivate) { + if declaration != nil && ast.HasModifier(declaration, ast.ModifierFlagsPrivate) { typeClassDeclaration := ast.GetClassLikeDeclarationOfSymbol(t.symbol) if !c.isNodeWithinClass(node, typeClassDeclaration) { c.error(node, diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, c.getFullyQualifiedName(t.symbol, nil)) @@ -6489,7 +6489,7 @@ func (c *Checker) checkAliasSymbol(node *ast.Node) { name := node.PropertyNameOrName().Text() c.addTypeOnlyDeclarationRelatedInfo(c.error(node, message, name), core.IfElse(isType, nil, typeOnlyAlias), name) } - if isType && node.Kind == ast.KindImportEqualsDeclaration && HasModifier(node, ast.ModifierFlagsExport) { + if isType && node.Kind == ast.KindImportEqualsDeclaration && ast.HasModifier(node, ast.ModifierFlagsExport) { c.error(node, diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled, c.getIsolatedModulesLikeFlagName()) } case ast.KindExportSpecifier: @@ -6777,7 +6777,7 @@ func (c *Checker) checkUnusedClassMembers(node *ast.Node) { break // Already would have reported an error on the getter. } symbol := c.getSymbolOfDeclaration(member) - if !c.isReferenced(symbol) && (HasModifier(member, ast.ModifierFlagsPrivate) || member.Name() != nil && ast.IsPrivateIdentifier(member.Name())) && member.Flags&ast.NodeFlagsAmbient == 0 { + if !c.isReferenced(symbol) && (ast.HasModifier(member, ast.ModifierFlagsPrivate) || member.Name() != nil && ast.IsPrivateIdentifier(member.Name())) && member.Flags&ast.NodeFlagsAmbient == 0 { c.reportUnused(member, UnusedKindLocal, NewDiagnosticForNode(member.Name(), diagnostics.X_0_is_declared_but_its_value_is_never_read, c.symbolToString(symbol))) } case ast.KindConstructor: @@ -8337,7 +8337,7 @@ func (c *Checker) resolveNewExpression(node *ast.Node, candidatesOutArray *[]*Si } if expressionType.symbol != nil { valueDecl := ast.GetClassLikeDeclarationOfSymbol(expressionType.symbol) - if valueDecl != nil && HasModifier(valueDecl, ast.ModifierFlagsAbstract) { + if valueDecl != nil && ast.HasModifier(valueDecl, ast.ModifierFlagsAbstract) { c.error(node, diagnostics.Cannot_create_an_instance_of_an_abstract_class) return c.resolveErrorCall(node) } @@ -18912,7 +18912,7 @@ func (c *Checker) getIndexInfosOfIndexSymbol(indexSymbol *ast.Symbol, siblingSym } forEachType(c.getTypeFromTypeNode(typeNode), func(keyType *Type) { if c.isValidIndexKeyType(keyType) && findIndexInfo(indexInfos, keyType) == nil { - indexInfo := c.newIndexInfo(keyType, valueType, HasModifier(declaration, ast.ModifierFlagsReadonly), declaration, nil) + indexInfo := c.newIndexInfo(keyType, valueType, ast.HasModifier(declaration, ast.ModifierFlagsReadonly), declaration, nil) indexInfos = append(indexInfos, indexInfo) } }) @@ -26823,7 +26823,7 @@ func (c *Checker) markPropertyAsReferenced(prop *ast.Symbol, nodeForCheckWriteOn if prop.Flags&ast.SymbolFlagsClassMember == 0 || prop.ValueDeclaration == nil { return } - hasPrivateModifier := HasModifier(prop.ValueDeclaration, ast.ModifierFlagsPrivate) + hasPrivateModifier := ast.HasModifier(prop.ValueDeclaration, ast.ModifierFlagsPrivate) hasPrivateIdentifier := prop.ValueDeclaration.Name() != nil && ast.IsPrivateIdentifier(prop.ValueDeclaration.Name()) if !hasPrivateModifier && !hasPrivateIdentifier { return diff --git a/internal/checker/emitresolver.go b/internal/checker/emitresolver.go index 1a28c3c21e..71c1a60955 100644 --- a/internal/checker/emitresolver.go +++ b/internal/checker/emitresolver.go @@ -825,6 +825,7 @@ func (r *emitResolver) getReferenceResolver() binder.ReferenceResolver { GetSymbolOfDeclaration: r.checker.getSymbolOfDeclaration, GetTypeOnlyAliasDeclaration: r.checker.getTypeOnlyAliasDeclarationEx, GetExportSymbolOfValueSymbolIfExported: r.checker.getExportSymbolOfValueSymbolIfExported, + GetElementAccessExpressionName: r.checker.tryGetElementAccessExpressionName, }) } return r.referenceResolver @@ -879,6 +880,17 @@ func (r *emitResolver) GetReferencedValueDeclarations(node *ast.IdentifierNode) return r.getReferenceResolver().GetReferencedValueDeclarations(node) } +func (r *emitResolver) GetElementAccessExpressionName(expression *ast.ElementAccessExpression) string { + if !ast.IsParseTreeNode(expression.AsNode()) { + return "" + } + + r.checkerMu.Lock() + defer r.checkerMu.Unlock() + + return r.getReferenceResolver().GetElementAccessExpressionName(expression) +} + // TODO: the emit resolver being responsible for some amount of node construction is a very leaky abstraction, // and requires giving it access to a lot of context it's otherwise not required to have, which also further complicates the API // and likely reduces performance. There's probably some refactoring that could be done here to simplify this. diff --git a/internal/checker/utilities.go b/internal/checker/utilities.go index 3637b8d421..bd026c259c 100644 --- a/internal/checker/utilities.go +++ b/internal/checker/utilities.go @@ -76,12 +76,8 @@ func getSelectedModifierFlags(node *ast.Node, flags ast.ModifierFlags) ast.Modif return node.ModifierFlags() & flags } -func HasModifier(node *ast.Node, flags ast.ModifierFlags) bool { - return node.ModifierFlags()&flags != 0 -} - func hasReadonlyModifier(node *ast.Node) bool { - return HasModifier(node, ast.ModifierFlagsReadonly) + return ast.HasModifier(node, ast.ModifierFlagsReadonly) } func isStaticPrivateIdentifierProperty(s *ast.Symbol) bool { @@ -405,7 +401,7 @@ func declarationBelongsToPrivateAmbientMember(declaration *ast.Node) bool { } func isPrivateWithinAmbient(node *ast.Node) bool { - return (HasModifier(node, ast.ModifierFlagsPrivate) || ast.IsPrivateIdentifierClassElementDeclaration(node)) && node.Flags&ast.NodeFlagsAmbient != 0 + return (ast.HasModifier(node, ast.ModifierFlagsPrivate) || ast.IsPrivateIdentifierClassElementDeclaration(node)) && node.Flags&ast.NodeFlagsAmbient != 0 } func isTypeAssertion(node *ast.Node) bool { diff --git a/internal/ls/findallreferences.go b/internal/ls/findallreferences.go index 7e31e181e0..5dc45a5702 100644 --- a/internal/ls/findallreferences.go +++ b/internal/ls/findallreferences.go @@ -349,7 +349,7 @@ func getSymbolScope(symbol *ast.Symbol) *ast.Node { // If this is private property or method, the scope is the containing class if symbol.Flags&(ast.SymbolFlagsProperty|ast.SymbolFlagsMethod) != 0 { privateDeclaration := core.Find(declarations, func(d *ast.Node) bool { - return checker.HasModifier(d, ast.ModifierFlagsPrivate) || ast.IsPrivateIdentifierClassElementDeclaration(d) + return ast.HasModifier(d, ast.ModifierFlagsPrivate) || ast.IsPrivateIdentifierClassElementDeclaration(d) }) if privateDeclaration != nil { return ast.FindAncestorKind(privateDeclaration, ast.KindClassDeclaration) diff --git a/internal/parser/parser.go b/internal/parser/parser.go index ef87829bb6..a51566f02d 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -296,7 +296,7 @@ func (p *Parser) lookAhead(callback func(p *Parser) bool) bool { func (p *Parser) nextToken() ast.Kind { // if the keyword had an escape - if isKeyword(p.token) && (p.scanner.HasUnicodeEscape() || p.scanner.HasExtendedUnicodeEscape()) { + if ast.IsKeyword(p.token) && (p.scanner.HasUnicodeEscape() || p.scanner.HasExtendedUnicodeEscape()) { // issue a parse error for the escape p.parseErrorAtCurrentToken(diagnostics.Keywords_cannot_contain_escape_characters) } @@ -644,7 +644,7 @@ func (p *Parser) parsingContextErrors(context ParsingContext) { case PCHeritageClauseElement: p.parseErrorAtCurrentToken(diagnostics.Expression_expected) case PCVariableDeclarations: - if isKeyword(p.token) { + if ast.IsKeyword(p.token) { p.parseErrorAtCurrentToken(diagnostics.X_0_is_not_allowed_as_a_variable_declaration_name, scanner.TokenToString(p.token)) } else { p.parseErrorAtCurrentToken(diagnostics.Variable_declaration_expected) @@ -662,7 +662,7 @@ func (p *Parser) parsingContextErrors(context ParsingContext) { case PCJSDocParameters: p.parseErrorAtCurrentToken(diagnostics.Parameter_declaration_expected) case PCParameters: - if isKeyword(p.token) { + if ast.IsKeyword(p.token) { p.parseErrorAtCurrentToken(diagnostics.X_0_is_not_allowed_as_a_parameter_name, scanner.TokenToString(p.token)) } else { p.parseErrorAtCurrentToken(diagnostics.Parameter_declaration_expected) @@ -2352,7 +2352,7 @@ func (p *Parser) parseModuleExportName(disallowKeywords bool) (node *ast.Node, n if p.token == ast.KindStringLiteral { return p.parseLiteralExpression(false /*intern*/), nameOk } - if disallowKeywords && isKeyword(p.token) && !p.isIdentifier() { + if disallowKeywords && ast.IsKeyword(p.token) && !p.isIdentifier() { nameOk = false } return p.parseIdentifierName(), nameOk @@ -5835,7 +5835,7 @@ func (p *Parser) scanClassMemberStart() bool { // If we were able to get any potential identifier... if idToken != ast.KindUnknown { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if !isKeyword(idToken) || idToken == ast.KindSetKeyword || idToken == ast.KindGetKeyword { + if !ast.IsKeyword(idToken) || idToken == ast.KindSetKeyword || idToken == ast.KindGetKeyword { return true } // If it *is* a keyword, but not an accessor, check a little farther along @@ -6235,10 +6235,6 @@ func (p *Parser) skipRangeTrivia(textRange core.TextRange) core.TextRange { return core.NewTextRange(scanner.SkipTrivia(p.sourceText, textRange.Pos()), textRange.End()) } -func isKeyword(token ast.Kind) bool { - return ast.KindFirstKeyword <= token && token <= ast.KindLastKeyword -} - func isReservedWord(token ast.Kind) bool { return ast.KindFirstReservedWord <= token && token <= ast.KindLastReservedWord } diff --git a/internal/transformers/declarations/transform.go b/internal/transformers/declarations/transform.go index 6217557d5f..e81bf4f602 100644 --- a/internal/transformers/declarations/transform.go +++ b/internal/transformers/declarations/transform.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/microsoft/typescript-go/internal/ast" + "github.com/microsoft/typescript-go/internal/collections" "github.com/microsoft/typescript-go/internal/core" "github.com/microsoft/typescript-go/internal/debug" "github.com/microsoft/typescript-go/internal/diagnostics" @@ -11,6 +12,7 @@ import ( "github.com/microsoft/typescript-go/internal/modulespecifiers" "github.com/microsoft/typescript-go/internal/nodebuilder" "github.com/microsoft/typescript-go/internal/printer" + "github.com/microsoft/typescript-go/internal/scanner" "github.com/microsoft/typescript-go/internal/transformers" "github.com/microsoft/typescript-go/internal/tspath" ) @@ -56,6 +58,7 @@ type DeclarationTransformer struct { resultHasExternalModuleIndicator bool suppressNewDiagnosticContexts bool lateStatementReplacementMap map[ast.NodeId]*ast.Node + expandoHosts collections.Set[ast.NodeId] rawReferencedFiles []ReferencedFilePair rawTypeReferenceDirectives []*ast.FileReference rawLibReferenceDirectives []*ast.FileReference @@ -124,7 +127,6 @@ func (tx *DeclarationTransformer) visit(node *ast.Node) *ast.Node { ast.KindContinueStatement, ast.KindDebuggerStatement, ast.KindDoStatement, - ast.KindExpressionStatement, ast.KindEmptyStatement, ast.KindForInStatement, ast.KindForOfStatement, @@ -141,6 +143,8 @@ func (tx *DeclarationTransformer) visit(node *ast.Node) *ast.Node { ast.KindBlock, ast.KindMissingDeclaration: return nil + case ast.KindExpressionStatement: + return tx.visitExpressionStatement(node.AsExpressionStatement()) // parts of things, things we just visit children of default: return tx.visitDeclarationSubtree(node) @@ -166,6 +170,7 @@ func (tx *DeclarationTransformer) visitSourceFile(node *ast.SourceFile) *ast.Nod tx.suppressNewDiagnosticContexts = false tx.state.lateMarkedStatements = make([]*ast.Node, 0) tx.lateStatementReplacementMap = make(map[ast.NodeId]*ast.Node) + tx.expandoHosts = collections.Set[ast.NodeId]{} tx.rawReferencedFiles = make([]ReferencedFilePair, 0) tx.rawTypeReferenceDirectives = make([]*ast.FileReference, 0) tx.rawLibReferenceDirectives = make([]*ast.FileReference, 0) @@ -231,12 +236,12 @@ func (tx *DeclarationTransformer) transformAndReplaceLatePaintedStatements(state next := tx.state.lateMarkedStatements[0] tx.state.lateMarkedStatements = tx.state.lateMarkedStatements[1:] - priorNeedsDeclare := tx.needsDeclare + saveNeedsDeclare := tx.needsDeclare tx.needsDeclare = next.Parent != nil && ast.IsSourceFile(next.Parent) && !(ast.IsExternalModule(next.Parent.AsSourceFile()) && tx.isBundledEmit) result := tx.transformTopLevelDeclaration(next) - tx.needsDeclare = priorNeedsDeclare + tx.needsDeclare = saveNeedsDeclare original := tx.EmitContext().MostOriginal(next) id := ast.GetNodeId(original) tx.lateStatementReplacementMap[id] = result @@ -789,8 +794,6 @@ func (tx *DeclarationTransformer) transformGetAccesorDeclaration(input *ast.GetA ) } -const defaultModifierFlagsMask = ast.ModifierFlagsAll ^ ast.ModifierFlagsPublic - func (tx *DeclarationTransformer) updateAccessorParamList(input *ast.Node, isPrivate bool) *ast.ParameterList { var newParams []*ast.Node if !isPrivate { @@ -955,11 +958,11 @@ func (tx *DeclarationTransformer) visitDeclarationStatements(input *ast.Node) *a tx.removeAllComments(assignment) return tx.Factory().NewSyntaxList([]*ast.Node{statement, assignment}) default: - result := tx.transformTopLevelDeclaration(input) - // Don't actually transform yet; just leave as original node - will be elided/swapped by late pass - original := tx.EmitContext().MostOriginal(input) - id := ast.GetNodeId(original) - tx.lateStatementReplacementMap[id] = result + id := ast.GetNodeId(tx.EmitContext().MostOriginal(input)) + if tx.lateStatementReplacementMap[id] == nil { + // Don't actually transform yet; just leave as original node - will be elided/swapped by late pass + tx.lateStatementReplacementMap[id] = tx.transformTopLevelDeclaration(input) + } return input } } @@ -1100,7 +1103,7 @@ func (tx *DeclarationTransformer) transformTopLevelDeclaration(input *ast.Node) if canProdiceDiagnostic { tx.state.getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(input) } - previousNeedsDeclare := tx.needsDeclare + saveNeedsDeclare := tx.needsDeclare var result *ast.Node switch input.Kind { @@ -1125,7 +1128,7 @@ func (tx *DeclarationTransformer) transformTopLevelDeclaration(input *ast.Node) tx.enclosingDeclaration = previousEnclosingDeclaration tx.state.getSymbolAccessibilityDiagnostic = oldDiag - tx.needsDeclare = previousNeedsDeclare + tx.needsDeclare = saveNeedsDeclare tx.state.errorNameNode = oldName return result } @@ -1153,7 +1156,7 @@ func (tx *DeclarationTransformer) transformInterfaceDeclaration(input *ast.Inter } func (tx *DeclarationTransformer) transformFunctionDeclaration(input *ast.FunctionDeclaration) *ast.Node { - updated := tx.Factory().UpdateFunctionDeclaration( + return tx.Factory().UpdateFunctionDeclaration( input, tx.ensureModifiers(input.AsNode()), nil, @@ -1164,17 +1167,6 @@ func (tx *DeclarationTransformer) transformFunctionDeclaration(input *ast.Functi nil, /*fullSignature*/ nil, ) - if updated == nil || !tx.resolver.IsExpandoFunctionDeclaration(input.AsNode()) || !shouldEmitFunctionProperties(input) { - return updated - } - // Add expando function properties to result - - // !!! TODO: expando function support - // props := tx.resolver.GetPropertiesOfContainerFunction(input) - // if tx.state.isolatedDeclarations { - // tx.state.reportExpandoFunctionErrors(input.AsNode()) - // } - return updated // !!! } func (tx *DeclarationTransformer) transformModuleDeclaration(input *ast.ModuleDeclaration) *ast.Node { @@ -1182,7 +1174,7 @@ func (tx *DeclarationTransformer) transformModuleDeclaration(input *ast.ModuleDe // It'd be good to collapse those back in the declaration output, but the AST can't represent the // `namespace a.b.c` shape for the printer (without using invalid identifier names). mods := tx.ensureModifiers(input.AsNode()) - oldNeedsDeclare := tx.needsDeclare + saveNeedsDeclare := tx.needsDeclare tx.needsDeclare = false inner := input.Body keyword := input.Keyword @@ -1213,7 +1205,7 @@ func (tx *DeclarationTransformer) transformModuleDeclaration(input *ast.ModuleDe } body := tx.Factory().UpdateModuleBlock(inner.AsModuleBlock(), lateStatements) - tx.needsDeclare = oldNeedsDeclare + tx.needsDeclare = saveNeedsDeclare tx.needsScopeFixMarker = oldNeedsScopeFix tx.resultHasScopeMarker = oldHasScopeFix @@ -1817,3 +1809,172 @@ func (tx *DeclarationTransformer) transformJSDocOptionalType(input *ast.JSDocOpt tx.EmitContext().SetOriginal(replacement, input.AsNode()) return replacement } + +func (tx *DeclarationTransformer) visitExpressionStatement(node *ast.ExpressionStatement) *ast.Node { + expression := node.Expression + if expression == nil { + return nil + } + + if expression.Kind == ast.KindBinaryExpression && + ast.GetAssignmentDeclarationKind(expression.AsBinaryExpression()) == ast.JSDeclarationKindProperty { + return tx.transformExpandoAssignment(expression.AsBinaryExpression()) + } + + return nil +} + +func (tx *DeclarationTransformer) transformExpandoAssignment(node *ast.BinaryExpression) *ast.Node { + left := node.Left + + symbol := node.Symbol + if symbol == nil || symbol.Flags&ast.SymbolFlagsAssignment == 0 { + return nil + } + + ns := ast.GetLeftmostAccessExpression(left) + if ns == nil || ns.Kind != ast.KindIdentifier { + return nil + } + + declaration := tx.resolver.GetReferencedValueDeclaration(ns) + if declaration == nil { + return nil + } + + host := declaration.Symbol() + if host == nil { + return nil + } + + name := tx.Factory().NewIdentifier(ns.Text()) + property := tx.tryGetPropertyName(left) + if property == "" || !scanner.IsIdentifierText(property, core.LanguageVariantStandard) { + return nil + } + + tx.transformExpandoHost(name, declaration) + + if ast.IsFunctionDeclaration(declaration) && !shouldEmitFunctionProperties(declaration.AsFunctionDeclaration()) { + return nil + } + + isNonContextualKeywordName := ast.IsNonContextualKeyword(scanner.StringToToken(property)) + exportName := core.IfElse(isNonContextualKeywordName, tx.Factory().NewGeneratedNameForNode(left), tx.Factory().NewIdentifier(property)) + + synthesizedNamespace := tx.Factory().NewModuleDeclaration(nil /*modifiers*/, ast.KindNamespaceKeyword, name, tx.Factory().NewModuleBlock(tx.Factory().NewNodeList([]*ast.Node{}))) + synthesizedNamespace.Parent = tx.enclosingDeclaration + + declarationData := synthesizedNamespace.DeclarationData() + declarationData.Symbol = host + + containerData := synthesizedNamespace.LocalsContainerData() + containerData.Locals = make(ast.SymbolTable, 0) + + saveDiag := tx.state.getSymbolAccessibilityDiagnostic + tx.state.getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(node.AsNode()) + t := tx.resolver.CreateTypeOfExpression(tx.EmitContext(), left, synthesizedNamespace, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags|nodebuilder.InternalFlagsNoSyntacticPrinter, tx.tracker) + tx.state.getSymbolAccessibilityDiagnostic = saveDiag + + statements := []*ast.Statement{ + tx.Factory().NewVariableStatement( + nil, /*modifiers*/ + tx.Factory().NewVariableDeclarationList( + ast.NodeFlagsNone, + tx.Factory().NewNodeList([]*ast.Node{ + tx.Factory().NewVariableDeclaration(exportName, nil /*exclamationToken*/, t, nil /*initializer*/), + }), + ), + ), + } + + if isNonContextualKeywordName { + namedExports := tx.Factory().NewNamedExports(tx.Factory().NewNodeList( + []*ast.Node{ + tx.Factory().NewExportSpecifier(false /*isTypeOnly*/, exportName, tx.Factory().NewIdentifier(left.Name().Text())), + }, + )) + statements = append(statements, tx.Factory().NewExportDeclaration(nil /*modifiers*/, false /*isTypeOnly*/, namedExports, nil /*moduleSpecifier*/, nil /*attributes*/)) + } + + flags := tx.host.GetEffectiveDeclarationFlags(tx.EmitContext().ParseNode(declaration), ast.ModifierFlagsAll) + modifierFlags := ast.ModifierFlagsAmbient + + if flags&ast.ModifierFlagsExport != 0 { + if flags&ast.ModifierFlagsDefault == 0 { + modifierFlags |= ast.ModifierFlagsExport + } + tx.resultHasScopeMarker = true + tx.resultHasExternalModuleIndicator = true + } + + return tx.Factory().NewModuleDeclaration(tx.Factory().NewModifierList(ast.CreateModifiersFromModifierFlags(modifierFlags, tx.Factory().NewModifier)), ast.KindNamespaceKeyword, name, tx.Factory().NewModuleBlock(tx.Factory().NewNodeList(statements))) +} + +func (tx *DeclarationTransformer) transformExpandoHost(name *ast.Node, declaration *ast.Declaration) { + root := core.IfElse(ast.IsVariableDeclaration(declaration), declaration.Parent.Parent, declaration) + id := ast.GetNodeId(tx.EmitContext().MostOriginal(root)) + + if tx.expandoHosts.Has(id) { + return + } + + saveNeedsDeclare := tx.needsDeclare + tx.needsDeclare = true + + modifierFlags := tx.ensureModifierFlags(root) + defaultExport := modifierFlags&ast.ModifierFlagsExport != 0 && modifierFlags&ast.ModifierFlagsDefault != 0 + + tx.needsDeclare = saveNeedsDeclare + + if defaultExport { + modifierFlags |= ast.ModifierFlagsAmbient + modifierFlags ^= ast.ModifierFlagsDefault + modifierFlags ^= ast.ModifierFlagsExport + } + + modifiers := tx.Factory().NewModifierList(ast.CreateModifiersFromModifierFlags(modifierFlags, tx.Factory().NewModifier)) + replacement := make([]*ast.Node, 0) + + if ast.IsFunctionDeclaration(declaration) { + typeParameters, parameters, asteriskToken := extractExpandoHostParams(declaration) + replacement = append(replacement, tx.Factory().UpdateFunctionDeclaration(declaration.AsFunctionDeclaration(), modifiers, asteriskToken, declaration.Name(), tx.ensureTypeParams(declaration, typeParameters), tx.updateParamList(declaration, parameters), tx.ensureType(declaration, false), nil /*fullSignature*/, nil /*body*/)) + } else if ast.IsVariableDeclaration(declaration) && ast.IsFunctionExpressionOrArrowFunction(declaration.Initializer()) { + fn := declaration.Initializer() + typeParameters, parameters, asteriskToken := extractExpandoHostParams(fn) + replacement = append(replacement, tx.Factory().NewFunctionDeclaration(modifiers, asteriskToken, tx.Factory().NewIdentifier(name.Text()), tx.ensureTypeParams(fn, typeParameters), tx.updateParamList(fn, parameters), tx.ensureType(fn, false), nil /*fullSignature*/, nil /*body*/)) + } else { + return + } + + if defaultExport { + replacement = append(replacement, tx.Factory().NewExportAssignment(nil /*modifiers*/, false /*isExportEquals*/, nil /*typeNode*/, name)) + } + + tx.expandoHosts.Add(id) + tx.lateStatementReplacementMap[id] = tx.Factory().NewSyntaxList(replacement) +} + +func extractExpandoHostParams(node *ast.Node) (typeParameters *ast.TypeParameterList, parameters *ast.ParameterList, asteriskToken *ast.TokenNode) { + switch node.Kind { + case ast.KindFunctionExpression: + fn := node.AsFunctionExpression() + return fn.TypeParameters, fn.Parameters, fn.AsteriskToken + case ast.KindArrowFunction: + fn := node.AsArrowFunction() + return fn.TypeParameters, fn.Parameters, fn.AsteriskToken + default: + fn := node.AsFunctionDeclaration() + return fn.TypeParameters, fn.Parameters, fn.AsteriskToken + } +} + +func (tx *DeclarationTransformer) tryGetPropertyName(node *ast.Node) string { + if ast.IsElementAccessExpression(node) { + return tx.resolver.GetElementAccessExpressionName(node.AsElementAccessExpression()) + } + if ast.IsPropertyAccessExpression(node) { + return node.Name().Text() + } + return "" +} diff --git a/testdata/baselines/reference/compiler/declarationEmitExpandoFunction.js b/testdata/baselines/reference/compiler/declarationEmitExpandoFunction.js new file mode 100644 index 0000000000..c54f345dd5 --- /dev/null +++ b/testdata/baselines/reference/compiler/declarationEmitExpandoFunction.js @@ -0,0 +1,57 @@ +//// [tests/cases/compiler/declarationEmitExpandoFunction.ts] //// + +//// [declarationEmitExpandoFunction.ts] +export function A() { + return 'A'; +} + +export function B() { + return 'B'; +} + +export enum C { + C +} + +A.a = C; +A.b = C; + +B.c = C; + + +//// [declarationEmitExpandoFunction.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.C = void 0; +exports.A = A; +exports.B = B; +function A() { + return 'A'; +} +function B() { + return 'B'; +} +var C; +(function (C) { + C[C["C"] = 0] = "C"; +})(C || (exports.C = C = {})); +A.a = C; +A.b = C; +B.c = C; + + +//// [declarationEmitExpandoFunction.d.ts] +export declare function A(): string; +export declare function B(): string; +export declare enum C { + C = 0 +} +export declare namespace A { + var a: typeof C; +} +export declare namespace A { + var b: typeof C; +} +export declare namespace B { + var c: typeof C; +} diff --git a/testdata/baselines/reference/compiler/declarationEmitExpandoFunction.symbols b/testdata/baselines/reference/compiler/declarationEmitExpandoFunction.symbols new file mode 100644 index 0000000000..41183b30b5 --- /dev/null +++ b/testdata/baselines/reference/compiler/declarationEmitExpandoFunction.symbols @@ -0,0 +1,40 @@ +//// [tests/cases/compiler/declarationEmitExpandoFunction.ts] //// + +=== declarationEmitExpandoFunction.ts === +export function A() { +>A : Symbol(A, Decl(declarationEmitExpandoFunction.ts, 0, 0)) + + return 'A'; +} + +export function B() { +>B : Symbol(B, Decl(declarationEmitExpandoFunction.ts, 2, 1)) + + return 'B'; +} + +export enum C { +>C : Symbol(C, Decl(declarationEmitExpandoFunction.ts, 6, 1)) + + C +>C : Symbol(C.C, Decl(declarationEmitExpandoFunction.ts, 8, 15)) +} + +A.a = C; +>A.a : Symbol(A.a, Decl(declarationEmitExpandoFunction.ts, 10, 1)) +>A : Symbol(A, Decl(declarationEmitExpandoFunction.ts, 0, 0)) +>a : Symbol(A.a, Decl(declarationEmitExpandoFunction.ts, 10, 1)) +>C : Symbol(C, Decl(declarationEmitExpandoFunction.ts, 6, 1)) + +A.b = C; +>A.b : Symbol(A.b, Decl(declarationEmitExpandoFunction.ts, 12, 8)) +>A : Symbol(A, Decl(declarationEmitExpandoFunction.ts, 0, 0)) +>b : Symbol(A.b, Decl(declarationEmitExpandoFunction.ts, 12, 8)) +>C : Symbol(C, Decl(declarationEmitExpandoFunction.ts, 6, 1)) + +B.c = C; +>B.c : Symbol(B.c, Decl(declarationEmitExpandoFunction.ts, 13, 8)) +>B : Symbol(B, Decl(declarationEmitExpandoFunction.ts, 2, 1)) +>c : Symbol(B.c, Decl(declarationEmitExpandoFunction.ts, 13, 8)) +>C : Symbol(C, Decl(declarationEmitExpandoFunction.ts, 6, 1)) + diff --git a/testdata/baselines/reference/compiler/declarationEmitExpandoFunction.types b/testdata/baselines/reference/compiler/declarationEmitExpandoFunction.types new file mode 100644 index 0000000000..0e7b87870c --- /dev/null +++ b/testdata/baselines/reference/compiler/declarationEmitExpandoFunction.types @@ -0,0 +1,45 @@ +//// [tests/cases/compiler/declarationEmitExpandoFunction.ts] //// + +=== declarationEmitExpandoFunction.ts === +export function A() { +>A : { (): string; a: typeof C; b: typeof C; } + + return 'A'; +>'A' : "A" +} + +export function B() { +>B : { (): string; c: typeof C; } + + return 'B'; +>'B' : "B" +} + +export enum C { +>C : C + + C +>C : C.C +} + +A.a = C; +>A.a = C : typeof C +>A.a : typeof C +>A : { (): string; a: typeof C; b: typeof C; } +>a : typeof C +>C : typeof C + +A.b = C; +>A.b = C : typeof C +>A.b : typeof C +>A : { (): string; a: typeof C; b: typeof C; } +>b : typeof C +>C : typeof C + +B.c = C; +>B.c = C : typeof C +>B.c : typeof C +>B : { (): string; c: typeof C; } +>c : typeof C +>C : typeof C + diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitDefaultExportWithStaticAssignment.js b/testdata/baselines/reference/submodule/compiler/declarationEmitDefaultExportWithStaticAssignment.js index 345ebd102f..9a3ef3a146 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitDefaultExportWithStaticAssignment.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitDefaultExportWithStaticAssignment.js @@ -82,14 +82,32 @@ C.B = B; export declare class Foo { } //// [index1.d.ts] -export default function Example(): void; +declare function Example(): void; +export default Example; +declare namespace Example { + var Foo: typeof import("./foo").Foo; +} //// [index2.d.ts] import { Foo } from './foo'; export { Foo }; -export default function Example(): void; +declare function Example(): void; +export default Example; +declare namespace Example { + var Foo: typeof import("./foo").Foo; +} //// [index3.d.ts] export declare class Bar { } -export default function Example(): void; +declare function Example(): void; +export default Example; +declare namespace Example { + var Bar: typeof import("./index3").Bar; +} //// [index4.d.ts] export declare function C(): any; +export declare namespace C { + var A: () => void; +} +export declare namespace C { + var B: () => void; +} diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitDefaultExportWithStaticAssignment.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitDefaultExportWithStaticAssignment.js.diff index ff4abd456f..552d88daf0 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitDefaultExportWithStaticAssignment.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitDefaultExportWithStaticAssignment.js.diff @@ -18,37 +18,38 @@ Object.defineProperty(exports, "Foo", { enumerable: true, get: function () { return foo_1.Foo; } }); function Example() { } Example.Foo = foo_1.Foo; -@@= skipped -31, +31 lines =@@ - export declare class Foo { +@@= skipped -32, +32 lines =@@ } //// [index1.d.ts] --declare function Example(): void; --declare namespace Example { -- var Foo: typeof import("./foo").Foo; --} + declare function Example(): void; ++export default Example; + declare namespace Example { + var Foo: typeof import("./foo").Foo; + } -export default Example; -+export default function Example(): void; //// [index2.d.ts] import { Foo } from './foo'; export { Foo }; --declare function Example(): void; --declare namespace Example { -- var Foo: typeof import("./foo").Foo; --} + declare function Example(): void; ++export default Example; + declare namespace Example { + var Foo: typeof import("./foo").Foo; + } -export default Example; -+export default function Example(): void; //// [index3.d.ts] export declare class Bar { } --declare function Example(): void; --declare namespace Example { -- var Bar: typeof import("./index3").Bar; --} + declare function Example(): void; ++export default Example; + declare namespace Example { + var Bar: typeof import("./index3").Bar; + } -export default Example; -+export default function Example(): void; //// [index4.d.ts] export declare function C(): any; --export declare namespace C { -- var A: () => void; -- var B: () => void; --} \ No newline at end of file + export declare namespace C { + var A: () => void; ++} ++export declare namespace C { + var B: () => void; + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoPropertyPrivateName.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoPropertyPrivateName.errors.txt new file mode 100644 index 0000000000..1ed386c351 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoPropertyPrivateName.errors.txt @@ -0,0 +1,14 @@ +b.ts(4,1): error TS4032: Property 'val' of exported interface has or is using name 'I' from private module '"a"'. + + +==== a.ts (0 errors) ==== + interface I {} + export function f(): I { return null as I; } +==== b.ts (1 errors) ==== + import {f} from "./a"; + + export function q() {} + q.val = f(); + ~~~~~~~~~~~ +!!! error TS4032: Property 'val' of exported interface has or is using name 'I' from private module '"a"'. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoPropertyPrivateName.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoPropertyPrivateName.errors.txt.diff index fc2ba7171a..e5704b00b0 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoPropertyPrivateName.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoPropertyPrivateName.errors.txt.diff @@ -1,18 +1,10 @@ --- old.declarationEmitExpandoPropertyPrivateName.errors.txt +++ new.declarationEmitExpandoPropertyPrivateName.errors.txt -@@= skipped -0, +0 lines =@@ --b.ts(4,1): error TS4032: Property 'val' of exported interface has or is using name 'I' from private module '"a"'. -- -- --==== a.ts (0 errors) ==== -- interface I {} -- export function f(): I { return null as I; } --==== b.ts (1 errors) ==== -- import {f} from "./a"; -- -- export function q() {} -- q.val = f(); +@@= skipped -8, +8 lines =@@ + + export function q() {} + q.val = f(); - ~~~~~ --!!! error TS4032: Property 'val' of exported interface has or is using name 'I' from private module '"a"'. -- -+ \ No newline at end of file ++ ~~~~~~~~~~~ + !!! error TS4032: Property 'val' of exported interface has or is using name 'I' from private module '"a"'. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoPropertyPrivateName.js b/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoPropertyPrivateName.js index 4b994cff3c..62611a4b50 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoPropertyPrivateName.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoPropertyPrivateName.js @@ -31,3 +31,6 @@ export declare function f(): I; export {}; //// [b.d.ts] export declare function q(): void; +export declare namespace q { + var val: I; +} diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoPropertyPrivateName.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoPropertyPrivateName.js.diff index e97c240744..1a0346d4ab 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoPropertyPrivateName.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoPropertyPrivateName.js.diff @@ -14,4 +14,7 @@ export declare function f(): I; export {}; +//// [b.d.ts] -+export declare function q(): void; \ No newline at end of file ++export declare function q(): void; ++export declare namespace q { ++ var val: I; ++} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoWithGenericConstraint.js b/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoWithGenericConstraint.js index 02c1beb29a..cf2922f110 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoWithGenericConstraint.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoWithGenericConstraint.js @@ -36,8 +36,8 @@ export interface Rect

{ readonly a: p; readonly b: p; } -export declare const Point: { - (x: number, y: number): Point; - zero: () => Point; -}; +export declare function Point(x: number, y: number): Point; export declare const Rect:

(a: p, b: p) => Rect

; +export declare namespace Point { + var zero: () => Point; +} diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoWithGenericConstraint.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoWithGenericConstraint.js.diff index 6b591946c6..eca527388e 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoWithGenericConstraint.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitExpandoWithGenericConstraint.js.diff @@ -1,10 +1,15 @@ --- old.declarationEmitExpandoWithGenericConstraint.js +++ new.declarationEmitExpandoWithGenericConstraint.js -@@= skipped -37, +37 lines =@@ +@@= skipped -35, +35 lines =@@ + readonly a: p; + readonly b: p; } - export declare const Point: { - (x: number, y: number): Point; +-export declare const Point: { +- (x: number, y: number): Point; - zero(): Point; -+ zero: () => Point; - }; - export declare const Rect:

(a: p, b: p) => Rect

; \ No newline at end of file +-}; ++export declare function Point(x: number, y: number): Point; + export declare const Rect:

(a: p, b: p) => Rect

; ++export declare namespace Point { ++ var zero: () => Point; ++} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitFunctionKeywordProp.js b/testdata/baselines/reference/submodule/compiler/declarationEmitFunctionKeywordProp.js index f5ce29f90a..0c8480ef02 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitFunctionKeywordProp.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitFunctionKeywordProp.js @@ -25,5 +25,22 @@ baz.normal = false; //// [declarationEmitFunctionKeywordProp.d.ts] declare function foo(): void; +declare namespace foo { + var _a: boolean; + export { _a as null }; +} declare function bar(): void; +declare namespace bar { + var async: boolean; +} +declare namespace bar { + var normal: boolean; +} declare function baz(): void; +declare namespace baz { + var _b: boolean; + export { _b as class }; +} +declare namespace baz { + var normal: boolean; +} diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitFunctionKeywordProp.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitFunctionKeywordProp.js.diff index 5628351b23..06133cdc84 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitFunctionKeywordProp.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitFunctionKeywordProp.js.diff @@ -1,21 +1,21 @@ --- old.declarationEmitFunctionKeywordProp.js +++ new.declarationEmitFunctionKeywordProp.js -@@= skipped -24, +24 lines =@@ - - //// [declarationEmitFunctionKeywordProp.d.ts] - declare function foo(): void; --declare namespace foo { -- var _a: boolean; -- export { _a as null }; --} +@@= skipped -31, +31 lines =@@ declare function bar(): void; --declare namespace bar { -- var async: boolean; -- var normal: boolean; --} + declare namespace bar { + var async: boolean; ++} ++declare namespace bar { + var normal: boolean; + } declare function baz(): void; --declare namespace baz { + declare namespace baz { - var _a: boolean; - export var normal: boolean; - export { _a as class }; --} \ No newline at end of file ++ var _b: boolean; ++ export { _b as class }; ++} ++declare namespace baz { ++ var normal: boolean; + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundAssignments.js b/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundAssignments.js index fc844a9af6..9d36f2464b 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundAssignments.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundAssignments.js @@ -36,3 +36,9 @@ const a = foo[dashStrMem]; //// [declarationEmitLateBoundAssignments.d.ts] export declare function foo(): void; +export declare namespace foo { + var bar: number; +} +export declare namespace foo { + var strMemName: string; +} diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundAssignments.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundAssignments.js.diff index 9b5edc4ae8..e6fc1de8ea 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundAssignments.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundAssignments.js.diff @@ -1,10 +1,10 @@ --- old.declarationEmitLateBoundAssignments.js +++ new.declarationEmitLateBoundAssignments.js -@@= skipped -35, +35 lines =@@ - - //// [declarationEmitLateBoundAssignments.d.ts] +@@= skipped -37, +37 lines =@@ export declare function foo(): void; --export declare namespace foo { -- var bar: number; -- var strMemName: string; --} \ No newline at end of file + export declare namespace foo { + var bar: number; ++} ++export declare namespace foo { + var strMemName: string; + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundAssignments2.js b/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundAssignments2.js index dbace19f24..370aaf1b30 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundAssignments2.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundAssignments2.js @@ -121,7 +121,13 @@ arrow10[emoji] = 0; //// [declarationEmitLateBoundAssignments2.d.ts] export declare function decl(): void; +export declare namespace decl { + var B: string; +} export declare function decl2(): void; +export declare namespace decl2 { + var C: number; +} export declare function decl3(): void; export declare function decl4(): void; export declare function decl5(): void; @@ -130,14 +136,14 @@ export declare function decl7(): void; export declare function decl8(): void; export declare function decl9(): void; export declare function decl10(): void; -export declare const arrow: { - (): void; - B: string; -}; -export declare const arrow2: { - (): void; - C: number; -}; +export declare function arrow(): void; +export declare namespace arrow { + var B: string; +} +export declare function arrow2(): void; +export declare namespace arrow2 { + var C: number; +} export declare const arrow3: { (): void; 77: number; diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundAssignments2.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundAssignments2.js.diff index 7b63352120..d2275bb556 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundAssignments2.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundAssignments2.js.diff @@ -1,16 +1,8 @@ --- old.declarationEmitLateBoundAssignments2.js +++ new.declarationEmitLateBoundAssignments2.js -@@= skipped -120, +120 lines =@@ - - //// [declarationEmitLateBoundAssignments2.d.ts] - export declare function decl(): void; --export declare namespace decl { -- var B: string; --} - export declare function decl2(): void; --export declare namespace decl2 { -- var C: number; --} +@@= skipped -128, +128 lines =@@ + var C: number; + } export declare function decl3(): void; -export declare namespace decl3 { } export declare function decl4(): void; @@ -27,6 +19,22 @@ -export declare namespace decl9 { } export declare function decl10(): void; -export declare namespace decl10 { } - export declare const arrow: { +-export declare const arrow: { +- (): void; +- B: string; +-}; +-export declare const arrow2: { +- (): void; +- C: number; +-}; ++export declare function arrow(): void; ++export declare namespace arrow { ++ var B: string; ++} ++export declare function arrow2(): void; ++export declare namespace arrow2 { ++ var C: number; ++} + export declare const arrow3: { (): void; - B: string; \ No newline at end of file + 77: number; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundJSAssignments.js b/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundJSAssignments.js index b3e5b3073c..c807097433 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundJSAssignments.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundJSAssignments.js @@ -26,3 +26,9 @@ const a = foo[dashStrMem]; //// [file.d.ts] export declare function foo(): void; +export declare namespace foo { + var bar: number; +} +export declare namespace foo { + var strMemName: string; +} diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundJSAssignments.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundJSAssignments.js.diff index 62c383b58d..3f66ad50ff 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundJSAssignments.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitLateBoundJSAssignments.js.diff @@ -8,5 +8,10 @@ -export namespace foo { - let bar: number; - let strMemName: string; --} -+export declare function foo(): void; \ No newline at end of file ++export declare function foo(): void; ++export declare namespace foo { ++ var bar: number; ++} ++export declare namespace foo { ++ var strMemName: string; + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/expandoFunctionBlockShadowing.js b/testdata/baselines/reference/submodule/compiler/expandoFunctionBlockShadowing.js index a5f9b593d5..1b37891205 100644 --- a/testdata/baselines/reference/submodule/compiler/expandoFunctionBlockShadowing.js +++ b/testdata/baselines/reference/submodule/compiler/expandoFunctionBlockShadowing.js @@ -45,3 +45,6 @@ if (Math.random()) { //// [expandoFunctionBlockShadowing.d.ts] export declare function X(): void; export declare function Y(): void; +export declare namespace Y { + var test: string; +} diff --git a/testdata/baselines/reference/submodule/compiler/expandoFunctionBlockShadowing.js.diff b/testdata/baselines/reference/submodule/compiler/expandoFunctionBlockShadowing.js.diff index fa0b90a7ec..ad675825bb 100644 --- a/testdata/baselines/reference/submodule/compiler/expandoFunctionBlockShadowing.js.diff +++ b/testdata/baselines/reference/submodule/compiler/expandoFunctionBlockShadowing.js.diff @@ -11,11 +11,4 @@ +// https://github.com/microsoft/TypeScript/issues/56538 function X() { } if (Math.random()) { - const X = {}; -@@= skipped -23, +23 lines =@@ - //// [expandoFunctionBlockShadowing.d.ts] - export declare function X(): void; - export declare function Y(): void; --export declare namespace Y { -- var test: string; --} \ No newline at end of file + const X = {}; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/expandoFunctionExpressionsWithDynamicNames.js b/testdata/baselines/reference/submodule/compiler/expandoFunctionExpressionsWithDynamicNames.js index 984cc06333..054a90b860 100644 --- a/testdata/baselines/reference/submodule/compiler/expandoFunctionExpressionsWithDynamicNames.js +++ b/testdata/baselines/reference/submodule/compiler/expandoFunctionExpressionsWithDynamicNames.js @@ -27,11 +27,11 @@ exports.expr2[s] = 0; //// [expandoFunctionExpressionsWithDynamicNames.d.ts] -export declare const expr: { - (): void; - X: number; -}; -export declare const expr2: { - (): void; - X: number; -}; +export declare function expr(): void; +export declare namespace expr { + var X: number; +} +export declare function expr2(): void; +export declare namespace expr2 { + var X: number; +} diff --git a/testdata/baselines/reference/submodule/compiler/expandoFunctionExpressionsWithDynamicNames.js.diff b/testdata/baselines/reference/submodule/compiler/expandoFunctionExpressionsWithDynamicNames.js.diff index 91ce438ddd..df20fd2068 100644 --- a/testdata/baselines/reference/submodule/compiler/expandoFunctionExpressionsWithDynamicNames.js.diff +++ b/testdata/baselines/reference/submodule/compiler/expandoFunctionExpressionsWithDynamicNames.js.diff @@ -10,4 +10,24 @@ +// https://github.com/microsoft/TypeScript/issues/54809 const s = "X"; const expr = () => { }; - exports.expr = expr; \ No newline at end of file + exports.expr = expr; +@@= skipped -13, +13 lines =@@ + + + //// [expandoFunctionExpressionsWithDynamicNames.d.ts] +-export declare const expr: { +- (): void; +- X: number; +-}; +-export declare const expr2: { +- (): void; +- X: number; +-}; ++export declare function expr(): void; ++export declare namespace expr { ++ var X: number; ++} ++export declare function expr2(): void; ++export declare namespace expr2 { ++ var X: number; ++} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrors.js b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrors.js index 8f211bd237..6616dff493 100644 --- a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrors.js +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrors.js @@ -22,11 +22,14 @@ errorOnMissingReturn.a = ""; //// [isolatedDeclarationErrors.d.ts] declare function errorOnAssignmentBelowDecl(): void; -declare const errorOnAssignmentBelow: { - (): void; - a: string; -}; -declare const errorOnMissingReturn: { - (): void; - a: string; -}; +declare namespace errorOnAssignmentBelowDecl { + var a: string; +} +declare function errorOnAssignmentBelow(): void; +declare namespace errorOnAssignmentBelow { + var a: string; +} +declare function errorOnMissingReturn(): void; +declare namespace errorOnMissingReturn { + var a: string; +} diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrors.js.diff b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrors.js.diff index a2e2b81506..47bb029ded 100644 --- a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrors.js.diff +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrors.js.diff @@ -8,11 +8,14 @@ + +//// [isolatedDeclarationErrors.d.ts] +declare function errorOnAssignmentBelowDecl(): void; -+declare const errorOnAssignmentBelow: { -+ (): void; -+ a: string; -+}; -+declare const errorOnMissingReturn: { -+ (): void; -+ a: string; -+}; \ No newline at end of file ++declare namespace errorOnAssignmentBelowDecl { ++ var a: string; ++} ++declare function errorOnAssignmentBelow(): void; ++declare namespace errorOnAssignmentBelow { ++ var a: string; ++} ++declare function errorOnMissingReturn(): void; ++declare namespace errorOnMissingReturn { ++ var a: string; ++} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsExpandoFunctions.js b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsExpandoFunctions.js index 52f0d4f7c5..32cbc8903c 100644 --- a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsExpandoFunctions.js +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsExpandoFunctions.js @@ -25,3 +25,24 @@ foo.length = 10; //// [isolatedDeclarationErrorsExpandoFunctions.d.ts] export declare function foo(): void; +export declare namespace foo { + var apply: () => void; +} +export declare namespace foo { + var call: () => void; +} +export declare namespace foo { + var bind: () => void; +} +export declare namespace foo { + var caller: () => void; +} +export declare namespace foo { + var toString: () => void; +} +export declare namespace foo { + var length: number; +} +export declare namespace foo { + var length: number; +} diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsExpandoFunctions.js.diff b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsExpandoFunctions.js.diff index ea6e1338aa..158cd2ae6c 100644 --- a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsExpandoFunctions.js.diff +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsExpandoFunctions.js.diff @@ -7,4 +7,25 @@ + + +//// [isolatedDeclarationErrorsExpandoFunctions.d.ts] -+export declare function foo(): void; \ No newline at end of file ++export declare function foo(): void; ++export declare namespace foo { ++ var apply: () => void; ++} ++export declare namespace foo { ++ var call: () => void; ++} ++export declare namespace foo { ++ var bind: () => void; ++} ++export declare namespace foo { ++ var caller: () => void; ++} ++export declare namespace foo { ++ var toString: () => void; ++} ++export declare namespace foo { ++ var length: number; ++} ++export declare namespace foo { ++ var length: number; ++} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsDeclarationsGlobalFileConstFunction.js b/testdata/baselines/reference/submodule/compiler/jsDeclarationsGlobalFileConstFunction.js index 9d4cfaead5..8e4843d111 100644 --- a/testdata/baselines/reference/submodule/compiler/jsDeclarationsGlobalFileConstFunction.js +++ b/testdata/baselines/reference/submodule/compiler/jsDeclarationsGlobalFileConstFunction.js @@ -19,11 +19,11 @@ SomeConstructor3.staticMember = "str"; //// [file.d.ts] declare const SomeConstructor: () => void; -declare const SomeConstructor2: { - (): void; - staticMember: string; -}; -declare const SomeConstructor3: { - (): void; - staticMember: string; -}; +declare function SomeConstructor2(): void; +declare namespace SomeConstructor2 { + var staticMember: string; +} +declare function SomeConstructor3(): void; +declare namespace SomeConstructor3 { + var staticMember: string; +} diff --git a/testdata/baselines/reference/submodule/compiler/jsDeclarationsGlobalFileConstFunction.js.diff b/testdata/baselines/reference/submodule/compiler/jsDeclarationsGlobalFileConstFunction.js.diff index 171c3332a5..d115dfd622 100644 --- a/testdata/baselines/reference/submodule/compiler/jsDeclarationsGlobalFileConstFunction.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsDeclarationsGlobalFileConstFunction.js.diff @@ -8,24 +8,18 @@ -declare class SomeConstructor { - x: number; -} --declare function SomeConstructor2(): void; --declare namespace SomeConstructor2 { ++declare const SomeConstructor: () => void; + declare function SomeConstructor2(): void; + declare namespace SomeConstructor2 { - let staticMember: string; --} --declare function SomeConstructor3(): void; --declare namespace SomeConstructor3 { ++ var staticMember: string; + } + declare function SomeConstructor3(): void; + declare namespace SomeConstructor3 { - let staticMember_1: string; - export { staticMember_1 as staticMember }; -} -declare class SomeConstructor3 { - x: number; --} -+declare const SomeConstructor: () => void; -+declare const SomeConstructor2: { -+ (): void; -+ staticMember: string; -+}; -+declare const SomeConstructor3: { -+ (): void; -+ staticMember: string; -+}; \ No newline at end of file ++ var staticMember: string; + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsDeclarationsGlobalFileConstFunctionNamed.js b/testdata/baselines/reference/submodule/compiler/jsDeclarationsGlobalFileConstFunctionNamed.js index b4b7986cec..4b6b926338 100644 --- a/testdata/baselines/reference/submodule/compiler/jsDeclarationsGlobalFileConstFunctionNamed.js +++ b/testdata/baselines/reference/submodule/compiler/jsDeclarationsGlobalFileConstFunctionNamed.js @@ -25,15 +25,15 @@ SelfReference.staticMember = "str"; //// [file.d.ts] declare const SomeConstructor: () => void; -declare const SomeConstructor2: { - (): void; - staticMember: string; -}; -declare const SomeConstructor3: { - (): void; - staticMember: string; -}; -declare const SelfReference: { - (): any; - staticMember: string; -}; +declare function SomeConstructor2(): void; +declare namespace SomeConstructor2 { + var staticMember: string; +} +declare function SomeConstructor3(): void; +declare namespace SomeConstructor3 { + var staticMember: string; +} +declare function SelfReference(): any; +declare namespace SelfReference { + var staticMember: string; +} diff --git a/testdata/baselines/reference/submodule/compiler/jsDeclarationsGlobalFileConstFunctionNamed.js.diff b/testdata/baselines/reference/submodule/compiler/jsDeclarationsGlobalFileConstFunctionNamed.js.diff index 3b57bcf92d..74d665ccee 100644 --- a/testdata/baselines/reference/submodule/compiler/jsDeclarationsGlobalFileConstFunctionNamed.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsDeclarationsGlobalFileConstFunctionNamed.js.diff @@ -8,12 +8,14 @@ -declare class SomeConstructor { - x: number; -} --declare function SomeConstructor2(): void; --declare namespace SomeConstructor2 { ++declare const SomeConstructor: () => void; + declare function SomeConstructor2(): void; + declare namespace SomeConstructor2 { - let staticMember: string; --} --declare function SomeConstructor3(): void; --declare namespace SomeConstructor3 { ++ var staticMember: string; + } + declare function SomeConstructor3(): void; + declare namespace SomeConstructor3 { - let staticMember_1: string; - export { staticMember_1 as staticMember }; -} @@ -21,23 +23,14 @@ - x: number; -} -declare function SelfReference(): SelfReference; --declare namespace SelfReference { ++ var staticMember: string; ++} ++declare function SelfReference(): any; + declare namespace SelfReference { - let staticMember_2: string; - export { staticMember_2 as staticMember }; -} -declare class SelfReference { - x: number; --} -+declare const SomeConstructor: () => void; -+declare const SomeConstructor2: { -+ (): void; -+ staticMember: string; -+}; -+declare const SomeConstructor3: { -+ (): void; -+ staticMember: string; -+}; -+declare const SelfReference: { -+ (): any; -+ staticMember: string; -+}; \ No newline at end of file ++ var staticMember: string; + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxDeclarationsWithEsModuleInteropNoCrash.js b/testdata/baselines/reference/submodule/compiler/jsxDeclarationsWithEsModuleInteropNoCrash.js index d3a96f6c16..cede538469 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxDeclarationsWithEsModuleInteropNoCrash.js +++ b/testdata/baselines/reference/submodule/compiler/jsxDeclarationsWithEsModuleInteropNoCrash.js @@ -26,7 +26,18 @@ export default Foo; //// [jsxDeclarationsWithEsModuleInteropNoCrash.d.ts] /// +import PropTypes from 'prop-types'; declare function Foo({ bar }: { bar: any; }): JSX.Element; +declare namespace Foo { + var propTypes: { + bar: PropTypes.Requireable; + }; +} +declare namespace Foo { + var defaultProps: { + bar: boolean; + }; +} export default Foo; diff --git a/testdata/baselines/reference/submodule/compiler/jsxDeclarationsWithEsModuleInteropNoCrash.js.diff b/testdata/baselines/reference/submodule/compiler/jsxDeclarationsWithEsModuleInteropNoCrash.js.diff index 1b8d5ca439..282833a6e0 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxDeclarationsWithEsModuleInteropNoCrash.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxDeclarationsWithEsModuleInteropNoCrash.js.diff @@ -5,10 +5,11 @@ //// [jsxDeclarationsWithEsModuleInteropNoCrash.d.ts] /// -export default Foo; ++import PropTypes from 'prop-types'; declare function Foo({ bar }: { bar: any; }): JSX.Element; --declare namespace Foo { + declare namespace Foo { - export { propTypes }; - export { defaultProps }; -} @@ -20,4 +21,13 @@ - export { bar_1 as bar }; -} -import PropTypes from 'prop-types'; ++ var propTypes: { ++ bar: PropTypes.Requireable; ++ }; ++} ++declare namespace Foo { ++ var defaultProps: { ++ bar: boolean; ++ }; ++} +export default Foo; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/lateBoundFunctionMemberAssignmentDeclarations.js b/testdata/baselines/reference/submodule/compiler/lateBoundFunctionMemberAssignmentDeclarations.js index 328d1a72ea..05ce6daa8c 100644 --- a/testdata/baselines/reference/submodule/compiler/lateBoundFunctionMemberAssignmentDeclarations.js +++ b/testdata/baselines/reference/submodule/compiler/lateBoundFunctionMemberAssignmentDeclarations.js @@ -19,3 +19,6 @@ const x = foo[_private]; //// [index.d.ts] export declare function foo(): void; +export declare namespace foo { + var bar: number; +} diff --git a/testdata/baselines/reference/submodule/compiler/lateBoundFunctionMemberAssignmentDeclarations.js.diff b/testdata/baselines/reference/submodule/compiler/lateBoundFunctionMemberAssignmentDeclarations.js.diff deleted file mode 100644 index 9b1699fd25..0000000000 --- a/testdata/baselines/reference/submodule/compiler/lateBoundFunctionMemberAssignmentDeclarations.js.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.lateBoundFunctionMemberAssignmentDeclarations.js -+++ new.lateBoundFunctionMemberAssignmentDeclarations.js -@@= skipped -18, +18 lines =@@ - - //// [index.d.ts] - export declare function foo(): void; --export declare namespace foo { -- var bar: number; --} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.js b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.js index 38bfb25afb..e79804a05e 100644 --- a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.js +++ b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.js @@ -47,6 +47,12 @@ assignmentToVoidZero2_1.j + assignmentToVoidZero2_1.k; //// [assignmentToVoidZero2.d.ts] export var j = 1; export var k = void 0; +declare namespace o { + var x: number; +} +declare namespace o { + var y: any; +} export {}; //// [importer.d.ts] export {}; diff --git a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.js.diff b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.js.diff index 828b31c77b..a08ceb9494 100644 --- a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.js.diff +++ b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.js.diff @@ -25,6 +25,12 @@ -export const j: 1; +export var j = 1; +export var k = void 0; ++declare namespace o { ++ var x: number; ++} ++declare namespace o { ++ var y: any; ++} +export {}; //// [importer.d.ts] export {}; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.js b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.js index 7334c82bde..39c2df78a4 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.js +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.js @@ -38,6 +38,13 @@ function f(k) { //// [mod1.d.ts] +declare namespace NS { + var K: { + new (): { + values(): /*elided*/ any; + }; + }; +} export var K = NS.K; export {}; //// [main.d.ts] diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.js.diff b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.js.diff index 7951efe1d6..7dcf48b386 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.js.diff +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.js.diff @@ -22,8 +22,14 @@ -export var K: { - new (): { - values(): /*elided*/ any; -- }; ++declare namespace NS { ++ var K: { ++ new (): { ++ values(): /*elided*/ any; ++ }; + }; -}; ++} +export var K = NS.K; +export {}; //// [main.d.ts] diff --git a/testdata/baselines/reference/submodule/conformance/exportDefaultNamespace.js b/testdata/baselines/reference/submodule/conformance/exportDefaultNamespace.js index c438749f3f..0565e4c96d 100644 --- a/testdata/baselines/reference/submodule/conformance/exportDefaultNamespace.js +++ b/testdata/baselines/reference/submodule/conformance/exportDefaultNamespace.js @@ -19,4 +19,8 @@ someFunc.someProp = 'yo'; //// [exportDefaultNamespace.d.ts] -export default function someFunc(): string; +declare function someFunc(): string; +export default someFunc; +declare namespace someFunc { + var someProp: string; +} diff --git a/testdata/baselines/reference/submodule/conformance/exportDefaultNamespace.js.diff b/testdata/baselines/reference/submodule/conformance/exportDefaultNamespace.js.diff index c5f3a3a126..60f7690974 100644 --- a/testdata/baselines/reference/submodule/conformance/exportDefaultNamespace.js.diff +++ b/testdata/baselines/reference/submodule/conformance/exportDefaultNamespace.js.diff @@ -1,12 +1,11 @@ --- old.exportDefaultNamespace.js +++ new.exportDefaultNamespace.js -@@= skipped -18, +18 lines =@@ - +@@= skipped -19, +19 lines =@@ //// [exportDefaultNamespace.d.ts] --declare function someFunc(): string; --declare namespace someFunc { -- var someProp: string; --} --export default someFunc; -+export default function someFunc(): string; \ No newline at end of file + declare function someFunc(): string; ++export default someFunc; + declare namespace someFunc { + var someProp: string; + } +-export default someFunc; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.js b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.js index 291c26285d..c4da697a19 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.js +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.js @@ -129,6 +129,9 @@ C2.staticProp = function (x, y) { //// [jsDeclarationsClassMethod.d.ts] declare function C1(): void; +declare namespace C1 { + var staticProp: (x: any, y: any) => any; +} declare class C2 { /** * A comment method1 @@ -138,3 +141,6 @@ declare class C2 { */ method1(x: number, y: number): number; } +declare namespace C2 { + var staticProp: (x: any, y: any) => any; +} diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.js.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.js.diff index 1520c1ddf2..864b04d0c7 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.js.diff @@ -20,7 +20,7 @@ - */ - method(x: number, y: number): number; -} --declare namespace C1 { + declare namespace C1 { - /** - * A comment staticProp - * @param {number} x @@ -28,11 +28,11 @@ - * @returns {number} - */ - function staticProp(x: number, y: number): number; --} ++ var staticProp: (x: any, y: any) => any; + } declare class C2 { /** - * A comment method1 -@@= skipped -33, +8 lines =@@ +@@= skipped -33, +11 lines =@@ * @returns {number} */ method1(x: number, y: number): number; @@ -43,8 +43,8 @@ - * @returns {number} - */ - method2(x: number, y: number): number; --} --declare namespace C2 { + } + declare namespace C2 { - /** - * A comment staticProp - * @param {number} x @@ -52,4 +52,5 @@ - * @returns {number} - */ - function staticProp(x: number, y: number): number; ++ var staticProp: (x: any, y: any) => any; } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.js b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.js index 7b130e681b..72c30e4c2a 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.js +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.js @@ -52,6 +52,9 @@ module.exports.Strings = Strings; //// [source.d.ts] +declare namespace Handler { + var statische: () => void; +} export = Handler; export var Strings = Strings; export type HandlerOptions = { diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.js.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.js.diff index 7b335ba61e..17b3390c8f 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.js.diff @@ -19,15 +19,16 @@ module.exports.Strings = Strings; /** * @typedef {Object} HandlerOptions -@@= skipped -11, +13 lines =@@ +@@= skipped -10, +12 lines =@@ + //// [source.d.ts] - export = Handler; +-export = Handler; -declare class Handler { - static get OPTIONS(): number; - process(): void; -} --declare namespace Handler { + declare namespace Handler { - export { statische, Strings, HandlerOptions }; -} -declare function statische(): void; @@ -40,6 +41,9 @@ - * Should be able to export a type alias at the same time. - */ - name: string; ++ var statische: () => void; ++} ++export = Handler; +export var Strings = Strings; +export type HandlerOptions = { + name: String; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic2.js b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic2.js index 96bb98ab89..84f368712e 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic2.js +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic2.js @@ -22,6 +22,8 @@ declare class Base { } export declare class Foo extends Base { } -export {}; +export declare namespace Foo { + var foo: string; +} //// [Bar.d.ts] export {}; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic2.js.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic2.js.diff index f0e6cd5301..24118c9347 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic2.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic2.js.diff @@ -11,8 +11,12 @@ -} declare class Base { static foo: string; -+} -+export declare class Foo extends Base { } - export {}; - //// [Bar.d.ts] \ No newline at end of file +-export {}; ++export declare class Foo extends Base { ++} ++export declare namespace Foo { ++ var foo: string; ++} + //// [Bar.d.ts] + export {}; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.js b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.js index 8038dc5993..479a6ab822 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.js +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.js @@ -158,6 +158,44 @@ export type State = { timer: Timer; hook: Hook; }; +/** + * Imports + * + * @typedef {import("./timer")} Timer + * @typedef {import("./hook")} Hook + * @typedef {import("./hook").HookHandler} HookHandler + */ +/** + * Input type definition + * + * @typedef {Object} Input + * @prop {Timer} timer + * @prop {Hook} hook + */ +/** + * State type definition + * + * @typedef {Object} State + * @prop {Timer} timer + * @prop {Hook} hook + */ +/** + * New `Context` + * + * @class + * @param {Input} input + */ +declare function Context(input: Input): any; +declare namespace Context { + var prototype: { + /** + * @param {Input} input + * @param {HookHandler=} handle + * @returns {State} + */ + construct(input: Input, handle?: any): State; + }; +} export = Context; //// [hook.d.ts] export type HookHandler = (arg: import("./context")) => void; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.js.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.js.diff index 6f918307d3..f4d945f527 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.js.diff @@ -46,6 +46,7 @@ - timeout: number; -} //// [context.d.ts] +-export = Context; +export type Timer = import("./timer"); +export type Hook = import("./hook"); +export type HookHandler = import("./hook").HookHandler; @@ -57,34 +58,13 @@ + timer: Timer; + hook: Hook; +}; - export = Context; --/** -- * Imports -- * -- * @typedef {import("./timer")} Timer -- * @typedef {import("./hook")} Hook -- * @typedef {import("./hook").HookHandler} HookHandler -- */ --/** -- * Input type definition -- * -- * @typedef {Object} Input -- * @prop {Timer} timer -- * @prop {Hook} hook -- */ --/** -- * State type definition -- * -- * @typedef {Object} State -- * @prop {Timer} timer -- * @prop {Hook} hook -- */ --/** -- * New `Context` -- * -- * @class -- * @param {Input} input -- */ + /** + * Imports + * +@@= skipped -45, +45 lines =@@ + * @class + * @param {Input} input + */ -declare function Context(input: Input): Context; -declare class Context { - /** @@ -123,9 +103,18 @@ - */ - construct(input: Input, handle?: HookHandler | undefined): State; -} --declare namespace Context { ++declare function Context(input: Input): any; + declare namespace Context { - export { Timer, Hook, HookHandler, Input, State }; --} ++ var prototype: { ++ /** ++ * @param {Input} input ++ * @param {HookHandler=} handle ++ * @returns {State} ++ */ ++ construct(input: Input, handle?: any): State; ++ }; + } -/** - * Imports - */ @@ -152,6 +141,7 @@ - timer: Timer; - hook: Hook; -}; ++export = Context; //// [hook.d.ts] +export type HookHandler = (arg: import("./context")) => void; export = Hook; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionKeywordProp.js b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionKeywordProp.js index 4b6e7dcc70..f5a429881b 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionKeywordProp.js +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionKeywordProp.js @@ -25,5 +25,22 @@ baz.normal = false; //// [source.d.ts] declare function foo(): void; +declare namespace foo { + var _a: boolean; + export { _a as null }; +} declare function bar(): void; +declare namespace bar { + var async: boolean; +} +declare namespace bar { + var normal: boolean; +} declare function baz(): void; +declare namespace baz { + var _b: boolean; + export { _b as class }; +} +declare namespace baz { + var normal: boolean; +} diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionKeywordProp.js.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionKeywordProp.js.diff index d529325b10..ca0bf04d42 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionKeywordProp.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionKeywordProp.js.diff @@ -1,22 +1,32 @@ --- old.jsDeclarationsFunctionKeywordProp.js +++ new.jsDeclarationsFunctionKeywordProp.js -@@= skipped -24, +24 lines =@@ - +@@= skipped -25, +25 lines =@@ //// [source.d.ts] declare function foo(): void; --declare namespace foo { + declare namespace foo { - let _null: boolean; - export { _null as null }; --} ++ var _a: boolean; ++ export { _a as null }; + } declare function bar(): void; --declare namespace bar { + declare namespace bar { - let async: boolean; - let normal: boolean; --} ++ var async: boolean; ++} ++declare namespace bar { ++ var normal: boolean; + } declare function baz(): void; --declare namespace baz { + declare namespace baz { - let _class: boolean; - export { _class as class }; - let normal_1: boolean; - export { normal_1 as normal }; --} \ No newline at end of file ++ var _b: boolean; ++ export { _b as class }; ++} ++declare namespace baz { ++ var normal: boolean; + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionKeywordPropExhaustive.js b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionKeywordPropExhaustive.js index b7bc4713a4..b8eb1d30f9 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionKeywordPropExhaustive.js +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionKeywordPropExhaustive.js @@ -170,3 +170,282 @@ foo.of = 1; //// [source.d.ts] declare function foo(): void; +declare namespace foo { + var x: number; +} +declare namespace foo { + var y: number; +} +declare namespace foo { + var _a: number; + export { _a as break }; +} +declare namespace foo { + var _b: number; + export { _b as case }; +} +declare namespace foo { + var _c: number; + export { _c as catch }; +} +declare namespace foo { + var _d: number; + export { _d as class }; +} +declare namespace foo { + var _e: number; + export { _e as const }; +} +declare namespace foo { + var _f: number; + export { _f as continue }; +} +declare namespace foo { + var _g: number; + export { _g as debugger }; +} +declare namespace foo { + var _h: number; + export { _h as default }; +} +declare namespace foo { + var _j: number; + export { _j as delete }; +} +declare namespace foo { + var _k: number; + export { _k as do }; +} +declare namespace foo { + var _l: number; + export { _l as else }; +} +declare namespace foo { + var _m: number; + export { _m as enum }; +} +declare namespace foo { + var _o: number; + export { _o as export }; +} +declare namespace foo { + var _p: number; + export { _p as extends }; +} +declare namespace foo { + var _q: number; + export { _q as false }; +} +declare namespace foo { + var _r: number; + export { _r as finally }; +} +declare namespace foo { + var _s: number; + export { _s as for }; +} +declare namespace foo { + var _t: number; + export { _t as function }; +} +declare namespace foo { + var _u: number; + export { _u as if }; +} +declare namespace foo { + var _v: number; + export { _v as import }; +} +declare namespace foo { + var _w: number; + export { _w as in }; +} +declare namespace foo { + var _x: number; + export { _x as instanceof }; +} +declare namespace foo { + var _y: number; + export { _y as new }; +} +declare namespace foo { + var _z: number; + export { _z as null }; +} +declare namespace foo { + var _0: number; + export { _0 as return }; +} +declare namespace foo { + var _1: number; + export { _1 as super }; +} +declare namespace foo { + var _2: number; + export { _2 as switch }; +} +declare namespace foo { + var _3: number; + export { _3 as this }; +} +declare namespace foo { + var _4: number; + export { _4 as throw }; +} +declare namespace foo { + var _5: number; + export { _5 as true }; +} +declare namespace foo { + var _6: number; + export { _6 as try }; +} +declare namespace foo { + var _7: number; + export { _7 as typeof }; +} +declare namespace foo { + var _8: number; + export { _8 as var }; +} +declare namespace foo { + var _9: number; + export { _9 as void }; +} +declare namespace foo { + var _10: number; + export { _10 as while }; +} +declare namespace foo { + var _11: number; + export { _11 as with }; +} +declare namespace foo { + var _12: number; + export { _12 as implements }; +} +declare namespace foo { + var _13: number; + export { _13 as interface }; +} +declare namespace foo { + var _14: number; + export { _14 as let }; +} +declare namespace foo { + var _15: number; + export { _15 as package }; +} +declare namespace foo { + var _16: number; + export { _16 as private }; +} +declare namespace foo { + var _17: number; + export { _17 as protected }; +} +declare namespace foo { + var _18: number; + export { _18 as public }; +} +declare namespace foo { + var _19: number; + export { _19 as static }; +} +declare namespace foo { + var _20: number; + export { _20 as yield }; +} +declare namespace foo { + var abstract: number; +} +declare namespace foo { + var as: number; +} +declare namespace foo { + var asserts: number; +} +declare namespace foo { + var any: number; +} +declare namespace foo { + var async: number; +} +declare namespace foo { + var await: number; +} +declare namespace foo { + var boolean: number; +} +declare namespace foo { + var constructor: number; +} +declare namespace foo { + var declare: number; +} +declare namespace foo { + var get: number; +} +declare namespace foo { + var infer: number; +} +declare namespace foo { + var is: number; +} +declare namespace foo { + var keyof: number; +} +declare namespace foo { + var module: number; +} +declare namespace foo { + var namespace: number; +} +declare namespace foo { + var never: number; +} +declare namespace foo { + var readonly: number; +} +declare namespace foo { + var require: number; +} +declare namespace foo { + var number: number; +} +declare namespace foo { + var object: number; +} +declare namespace foo { + var set: number; +} +declare namespace foo { + var string: number; +} +declare namespace foo { + var symbol: number; +} +declare namespace foo { + var type: number; +} +declare namespace foo { + var undefined: number; +} +declare namespace foo { + var unique: number; +} +declare namespace foo { + var unknown: number; +} +declare namespace foo { + var from: number; +} +declare namespace foo { + var global: number; +} +declare namespace foo { + var bigint: number; +} +declare namespace foo { + var of: number; +} diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionKeywordPropExhaustive.js.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionKeywordPropExhaustive.js.diff index fa3f869313..4dc3c418c2 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionKeywordPropExhaustive.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionKeywordPropExhaustive.js.diff @@ -1,10 +1,9 @@ --- old.jsDeclarationsFunctionKeywordPropExhaustive.js +++ new.jsDeclarationsFunctionKeywordPropExhaustive.js -@@= skipped -169, +169 lines =@@ - +@@= skipped -170, +170 lines =@@ //// [source.d.ts] declare function foo(): void; --declare namespace foo { + declare namespace foo { - export let x: number; - export let y: number; - let _break: number; @@ -128,4 +127,281 @@ - export let global: number; - export let bigint: number; - export let of: number; --} \ No newline at end of file ++ var x: number; ++} ++declare namespace foo { ++ var y: number; ++} ++declare namespace foo { ++ var _a: number; ++ export { _a as break }; ++} ++declare namespace foo { ++ var _b: number; ++ export { _b as case }; ++} ++declare namespace foo { ++ var _c: number; ++ export { _c as catch }; ++} ++declare namespace foo { ++ var _d: number; ++ export { _d as class }; ++} ++declare namespace foo { ++ var _e: number; ++ export { _e as const }; ++} ++declare namespace foo { ++ var _f: number; ++ export { _f as continue }; ++} ++declare namespace foo { ++ var _g: number; ++ export { _g as debugger }; ++} ++declare namespace foo { ++ var _h: number; ++ export { _h as default }; ++} ++declare namespace foo { ++ var _j: number; ++ export { _j as delete }; ++} ++declare namespace foo { ++ var _k: number; ++ export { _k as do }; ++} ++declare namespace foo { ++ var _l: number; ++ export { _l as else }; ++} ++declare namespace foo { ++ var _m: number; ++ export { _m as enum }; ++} ++declare namespace foo { ++ var _o: number; ++ export { _o as export }; ++} ++declare namespace foo { ++ var _p: number; ++ export { _p as extends }; ++} ++declare namespace foo { ++ var _q: number; ++ export { _q as false }; ++} ++declare namespace foo { ++ var _r: number; ++ export { _r as finally }; ++} ++declare namespace foo { ++ var _s: number; ++ export { _s as for }; ++} ++declare namespace foo { ++ var _t: number; ++ export { _t as function }; ++} ++declare namespace foo { ++ var _u: number; ++ export { _u as if }; ++} ++declare namespace foo { ++ var _v: number; ++ export { _v as import }; ++} ++declare namespace foo { ++ var _w: number; ++ export { _w as in }; ++} ++declare namespace foo { ++ var _x: number; ++ export { _x as instanceof }; ++} ++declare namespace foo { ++ var _y: number; ++ export { _y as new }; ++} ++declare namespace foo { ++ var _z: number; ++ export { _z as null }; ++} ++declare namespace foo { ++ var _0: number; ++ export { _0 as return }; ++} ++declare namespace foo { ++ var _1: number; ++ export { _1 as super }; ++} ++declare namespace foo { ++ var _2: number; ++ export { _2 as switch }; ++} ++declare namespace foo { ++ var _3: number; ++ export { _3 as this }; ++} ++declare namespace foo { ++ var _4: number; ++ export { _4 as throw }; ++} ++declare namespace foo { ++ var _5: number; ++ export { _5 as true }; ++} ++declare namespace foo { ++ var _6: number; ++ export { _6 as try }; ++} ++declare namespace foo { ++ var _7: number; ++ export { _7 as typeof }; ++} ++declare namespace foo { ++ var _8: number; ++ export { _8 as var }; ++} ++declare namespace foo { ++ var _9: number; ++ export { _9 as void }; ++} ++declare namespace foo { ++ var _10: number; ++ export { _10 as while }; ++} ++declare namespace foo { ++ var _11: number; ++ export { _11 as with }; ++} ++declare namespace foo { ++ var _12: number; ++ export { _12 as implements }; ++} ++declare namespace foo { ++ var _13: number; ++ export { _13 as interface }; ++} ++declare namespace foo { ++ var _14: number; ++ export { _14 as let }; ++} ++declare namespace foo { ++ var _15: number; ++ export { _15 as package }; ++} ++declare namespace foo { ++ var _16: number; ++ export { _16 as private }; ++} ++declare namespace foo { ++ var _17: number; ++ export { _17 as protected }; ++} ++declare namespace foo { ++ var _18: number; ++ export { _18 as public }; ++} ++declare namespace foo { ++ var _19: number; ++ export { _19 as static }; ++} ++declare namespace foo { ++ var _20: number; ++ export { _20 as yield }; ++} ++declare namespace foo { ++ var abstract: number; ++} ++declare namespace foo { ++ var as: number; ++} ++declare namespace foo { ++ var asserts: number; ++} ++declare namespace foo { ++ var any: number; ++} ++declare namespace foo { ++ var async: number; ++} ++declare namespace foo { ++ var await: number; ++} ++declare namespace foo { ++ var boolean: number; ++} ++declare namespace foo { ++ var constructor: number; ++} ++declare namespace foo { ++ var declare: number; ++} ++declare namespace foo { ++ var get: number; ++} ++declare namespace foo { ++ var infer: number; ++} ++declare namespace foo { ++ var is: number; ++} ++declare namespace foo { ++ var keyof: number; ++} ++declare namespace foo { ++ var module: number; ++} ++declare namespace foo { ++ var namespace: number; ++} ++declare namespace foo { ++ var never: number; ++} ++declare namespace foo { ++ var readonly: number; ++} ++declare namespace foo { ++ var require: number; ++} ++declare namespace foo { ++ var number: number; ++} ++declare namespace foo { ++ var object: number; ++} ++declare namespace foo { ++ var set: number; ++} ++declare namespace foo { ++ var string: number; ++} ++declare namespace foo { ++ var symbol: number; ++} ++declare namespace foo { ++ var type: number; ++} ++declare namespace foo { ++ var undefined: number; ++} ++declare namespace foo { ++ var unique: number; ++} ++declare namespace foo { ++ var unknown: number; ++} ++declare namespace foo { ++ var from: number; ++} ++declare namespace foo { ++ var global: number; ++} ++declare namespace foo { ++ var bigint: number; ++} ++declare namespace foo { ++ var of: number; + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionLikeClasses2.js b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionLikeClasses2.js index 48d1497385..8a89d1edb4 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionLikeClasses2.js +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionLikeClasses2.js @@ -159,10 +159,26 @@ exports.origin = new source_1.Point2D(0, 0); * @param {number} len */ export declare function Vec(len: number): void; +export declare namespace Vec { + var prototype: { + /** + * @param {Vec} other + */ + dot(other: Vec): number; + magnitude(): number; + }; +} /** * @param {number} x * @param {number} y */ export declare function Point2D(x: number, y: number): any; +export declare namespace Point2D { + var prototype: { + __proto__: typeof Vec; + x: number; + y: number; + }; +} //// [referencer.d.ts] export declare const origin: any; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionLikeClasses2.js.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionLikeClasses2.js.diff index f1c814c9f1..ed8d9f8f75 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionLikeClasses2.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionLikeClasses2.js.diff @@ -28,8 +28,16 @@ - */ - dot(other: Vec): number; - magnitude(): number; --} +export declare function Vec(len: number): void; ++export declare namespace Vec { ++ var prototype: { ++ /** ++ * @param {Vec} other ++ */ ++ dot(other: Vec): number; ++ magnitude(): number; ++ }; + } /** * @param {number} x * @param {number} y @@ -52,8 +60,14 @@ - set y(y: number); - get y(): number; - __proto__: typeof Vec; --} +export declare function Point2D(x: number, y: number): any; ++export declare namespace Point2D { ++ var prototype: { ++ __proto__: typeof Vec; ++ x: number; ++ y: number; ++ }; + } //// [referencer.d.ts] -export const origin: Point2D; -import { Point2D } from "./source"; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.js b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.js index 25aba9ecba..e3f53cb229 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.js +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.js @@ -34,6 +34,13 @@ MyClass.staticProperty = 123; //// [source.d.ts] export = MyClass; +declare function MyClass(): void; +declare namespace MyClass { + var staticMethod: () => void; +} +declare namespace MyClass { + var staticProperty: number; +} export type DoneCB = (failures: number) ; /** * Callback to be invoked when test execution is complete. diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.js.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.js.diff index a39243d2a7..c52be93a6e 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.js.diff @@ -10,11 +10,10 @@ module.exports = MyClass; function MyClass() { } MyClass.staticMethod = function () { }; -@@= skipped -15, +18 lines =@@ - +@@= skipped -16, +19 lines =@@ //// [source.d.ts] export = MyClass; --declare function MyClass(): void; + declare function MyClass(): void; -declare class MyClass { - method(): void; -} @@ -23,6 +22,12 @@ -} -declare function staticMethod(): void; -declare var staticProperty: number; ++declare namespace MyClass { ++ var staticMethod: () => void; ++} ++declare namespace MyClass { ++ var staticProperty: number; ++} +export type DoneCB = (failures: number) ; /** * Callback to be invoked when test execution is complete. diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.js b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.js index d76ffef284..8a62f4e062 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.js +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.js @@ -16,17 +16,12 @@ module.exports = foo; //// [index.d.ts] +declare function foo(): void; +declare namespace foo { + var foo: typeof import("."); +} +declare namespace foo { + var _a: typeof import("."); + export { _a as default }; +} export = foo; - - -//// [DtsFileErrors] - - -out/index.d.ts(1,10): error TS2304: Cannot find name 'foo'. - - -==== out/index.d.ts (1 errors) ==== - export = foo; - ~~~ -!!! error TS2304: Cannot find name 'foo'. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.js.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.js.diff index b57b340c63..9b567ef448 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.js.diff @@ -9,22 +9,16 @@ //// [index.d.ts] - export = foo; --declare function foo(): void; --declare namespace foo { +-export = foo; + declare function foo(): void; + declare namespace foo { - export { foo }; - export { foo as default }; -} -+ -+ -+//// [DtsFileErrors] -+ -+ -+out/index.d.ts(1,10): error TS2304: Cannot find name 'foo'. -+ -+ -+==== out/index.d.ts (1 errors) ==== -+ export = foo; -+ ~~~ -+!!! error TS2304: Cannot find name 'foo'. -+ \ No newline at end of file ++ var foo: typeof import("."); ++} ++declare namespace foo { ++ var _a: typeof import("."); ++ export { _a as default }; ++} ++export = foo; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctions.js b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctions.js index 7a1612bab4..8aa44cbc27 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctions.js +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctions.js @@ -123,7 +123,15 @@ function j() { } //// [index.d.ts] export declare function a(): void; export declare function b(): void; +export declare namespace b { + var cat: string; +} export declare function c(): void; +export declare namespace c { + var Cls: { + new (): {}; + }; +} /** * @param {number} a * @param {number} b @@ -142,6 +150,9 @@ export declare function e(a: T, b: U): T & U; * @param {T} a */ export declare function f(a: T): T; +export declare namespace f { + var self: typeof f; +} /** * @param {{x: string}} a * @param {{y: typeof b}} b diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctions.js.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctions.js.diff index 75088fe6e6..8e2b016ad7 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctions.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctions.js.diff @@ -25,14 +25,20 @@ -export function b(): void; -export namespace b { - let cat: string; --} ++export declare function a(): void; ++export declare function b(): void; ++export declare namespace b { ++ var cat: string; + } -export function c(): void; -export namespace c { - export { Cls }; --} -+export declare function a(): void; -+export declare function b(): void; +export declare function c(): void; ++export declare namespace c { ++ var Cls: { ++ new (): {}; ++ }; + } /** * @param {number} a * @param {number} b @@ -59,8 +65,10 @@ -export function i(): void; -export function j(): void; -declare class Cls { --} +export declare function f(a: T): T; ++export declare namespace f { ++ var self: typeof f; + } /** * @param {{x: string}} a * @param {{y: typeof b}} b @@ -77,7 +85,7 @@ /** * @param {{x: string}} a * @param {{y: typeof b}} b -@@= skipped -50, +38 lines =@@ +@@= skipped -50, +49 lines =@@ declare function hh(a: { x: string; }, b: { diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.js b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.js index 6be074102e..f707949cf4 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.js +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.js @@ -62,6 +62,13 @@ export {}; //// [base.d.ts] +declare class Base { + constructor(); +} +declare function BaseFactory(): Base; +declare namespace BaseFactory { + var Base: typeof Base; +} export = BaseFactory; //// [file.d.ts] export type BaseFactory = import('./base'); diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.js.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.js.diff index f2dae38cd5..13850b4946 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.js.diff @@ -16,13 +16,19 @@ //// [base.d.ts] - export = BaseFactory; --declare function BaseFactory(): Base; --declare namespace BaseFactory { +-export = BaseFactory; ++declare class Base { ++ constructor(); ++} + declare function BaseFactory(): Base; + declare namespace BaseFactory { - export { Base }; -} -declare class Base { -} ++ var Base: typeof Base; ++} ++export = BaseFactory; //// [file.d.ts] -type couldntThinkOfAny = { - (): {}; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.js b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.js index 3c6498cabf..25a713c08c 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.js +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.js @@ -50,6 +50,13 @@ export {}; //// [base.d.ts] +declare class Base { + constructor(); +} +declare function BaseFactory(): Base; +declare namespace BaseFactory { + var Base: typeof Base; +} export = BaseFactory; //// [file.d.ts] export type BaseFactory = typeof import('./base'); diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.js.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.js.diff index 4e00b4f79b..9f430cfe7a 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.js.diff @@ -16,13 +16,19 @@ //// [base.d.ts] - export = BaseFactory; --declare function BaseFactory(): Base; --declare namespace BaseFactory { +-export = BaseFactory; ++declare class Base { ++ constructor(); ++} + declare function BaseFactory(): Base; + declare namespace BaseFactory { - export { Base }; -} -declare class Base { -} ++ var Base: typeof Base; ++} ++export = BaseFactory; //// [file.d.ts] -/** @typedef {typeof import('./base')} BaseFactory */ -/** diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReactComponents.js b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReactComponents.js index 8f6c583f8a..41c2f8c81b 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReactComponents.js +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReactComponents.js @@ -186,47 +186,57 @@ exports.default = Tree; //// [jsDeclarationsReactComponents1.d.ts] /// import PropTypes from "prop-types"; -declare const TabbedShowLayout: { - ({}: {}): JSX.Element; - propTypes: { +declare function TabbedShowLayout({}: {}): JSX.Element; +declare namespace TabbedShowLayout { + var propTypes: { version: PropTypes.Requireable; }; - defaultProps: { +} +declare namespace TabbedShowLayout { + var defaultProps: { tabs: undefined; }; -}; +} export default TabbedShowLayout; //// [jsDeclarationsReactComponents2.d.ts] import React from "react"; -/** - * @type {React.SFC} - */ -declare const TabbedShowLayout: React.SFC; +declare function TabbedShowLayout(): JSX.Element; +declare namespace TabbedShowLayout { + var defaultProps: Partial<{}> | undefined; +} export default TabbedShowLayout; //// [jsDeclarationsReactComponents3.d.ts] -/** - * @type {{defaultProps: {tabs: string}} & ((props?: {elem: string}) => JSX.Element)} - */ -declare const TabbedShowLayout: { - defaultProps: { +declare function TabbedShowLayout(): JSX.Element; +declare namespace TabbedShowLayout { + var defaultProps: { tabs: string; }; -} & ((props?: { - elem: string; -}) => JSX.Element); +} export default TabbedShowLayout; //// [jsDeclarationsReactComponents4.d.ts] -declare const TabbedShowLayout: { - (prop: { - className: string; - }): JSX.Element; - defaultProps: { +declare function TabbedShowLayout(/** @type {{className: string}}*/ prop: { + className: string; +}): JSX.Element; +declare namespace TabbedShowLayout { + var defaultProps: { tabs: string; }; -}; +} export default TabbedShowLayout; //// [jsDeclarationsReactComponents5.d.ts] +import PropTypes from 'prop-types'; declare function Tree({ allowDropOnRoot }: { allowDropOnRoot: any; }): JSX.Element; +declare namespace Tree { + var propTypes: { + classes: PropTypes.Requireable; + }; +} +declare namespace Tree { + var defaultProps: { + classes: {}; + parentSource: string; + }; +} export default Tree; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReactComponents.js.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReactComponents.js.diff index 0422126dd6..4e509eca1c 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReactComponents.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReactComponents.js.diff @@ -64,15 +64,17 @@ - } -} import PropTypes from "prop-types"; -+declare const TabbedShowLayout: { -+ ({}: {}): JSX.Element; -+ propTypes: { ++declare function TabbedShowLayout({}: {}): JSX.Element; ++declare namespace TabbedShowLayout { ++ var propTypes: { + version: PropTypes.Requireable; + }; -+ defaultProps: { ++} ++declare namespace TabbedShowLayout { ++ var defaultProps: { + tabs: undefined; + }; -+}; ++} +export default TabbedShowLayout; //// [jsDeclarationsReactComponents2.d.ts] -export default TabbedShowLayout; @@ -81,45 +83,50 @@ - */ -declare const TabbedShowLayout: React.SFC; import React from "react"; -+/** -+ * @type {React.SFC} -+ */ -+declare const TabbedShowLayout: React.SFC; ++declare function TabbedShowLayout(): JSX.Element; ++declare namespace TabbedShowLayout { ++ var defaultProps: Partial<{}> | undefined; ++} +export default TabbedShowLayout; //// [jsDeclarationsReactComponents3.d.ts] -export default TabbedShowLayout; - /** - * @type {{defaultProps: {tabs: string}} & ((props?: {elem: string}) => JSX.Element)} - */ -@@= skipped -30, +29 lines =@@ - } & ((props?: { - elem: string; - }) => JSX.Element); +-/** +- * @type {{defaultProps: {tabs: string}} & ((props?: {elem: string}) => JSX.Element)} +- */ +-declare const TabbedShowLayout: { +- defaultProps: { ++declare function TabbedShowLayout(): JSX.Element; ++declare namespace TabbedShowLayout { ++ var defaultProps: { + tabs: string; + }; +-} & ((props?: { +- elem: string; +-}) => JSX.Element); ++} +export default TabbedShowLayout; //// [jsDeclarationsReactComponents4.d.ts] -+declare const TabbedShowLayout: { -+ (prop: { -+ className: string; -+ }): JSX.Element; -+ defaultProps: { -+ tabs: string; -+ }; -+}; - export default TabbedShowLayout; +-export default TabbedShowLayout; -declare function TabbedShowLayout(prop: { -- className: string; --}): JSX.Element; --declare namespace TabbedShowLayout { ++declare function TabbedShowLayout(/** @type {{className: string}}*/ prop: { + className: string; + }): JSX.Element; + declare namespace TabbedShowLayout { - namespace defaultProps { - let tabs: string; - } --} ++ var defaultProps: { ++ tabs: string; ++ }; + } ++export default TabbedShowLayout; //// [jsDeclarationsReactComponents5.d.ts] -export default Tree; ++import PropTypes from 'prop-types'; declare function Tree({ allowDropOnRoot }: { allowDropOnRoot: any; }): JSX.Element; --declare namespace Tree { + declare namespace Tree { - namespace propTypes { - let classes: PropTypes.Requireable; - } @@ -130,4 +137,14 @@ - } -} -import PropTypes from 'prop-types'; ++ var propTypes: { ++ classes: PropTypes.Requireable; ++ }; ++} ++declare namespace Tree { ++ var defaultProps: { ++ classes: {}; ++ parentSource: string; ++ }; ++} +export default Tree; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.js b/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.js index 83f4b967b4..3d7bf0d2a6 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.js +++ b/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.js @@ -83,6 +83,13 @@ declare var Ns: { /** @implements {A} */ C5: any; }; +declare namespace Ns { + var C1: { + new (): { + method(): number; + }; + }; +} /** @implements {A} */ declare var C2: { new (): { @@ -106,3 +113,6 @@ declare class CC { }; } declare var C5: any; +declare namespace Ns { + var C5: any; +} diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.js.diff b/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.js.diff index 97a55138f3..7119367ce6 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.js.diff @@ -4,23 +4,24 @@ /** @implements {A} */ declare class B3 implements A { } --declare namespace Ns { -- export { C1 }; -- export let C5: { +declare var Ns: { + /** @implements {A} */ + C1: { - new (): { - method(): number; - }; - }; --} ++ new (): { ++ method(): number; ++ }; ++ }; + /** @implements {A} */ + C5: any; +}; - /** @implements {A} */ - declare var C2: { - new (): { + declare namespace Ns { +- export { C1 }; +- export let C5: { ++ var C1: { + new (): { + method(): number; + }; +@@= skipped -14, +23 lines =@@ method(): number; }; }; @@ -38,7 +39,7 @@ declare class CC { /** @implements {A} */ C4: { -@@= skipped -26, +33 lines =@@ +@@= skipped -12, +17 lines =@@ }; } declare var C5: any; @@ -47,4 +48,6 @@ -} -declare class C3 implements A { - method(): number; --} \ No newline at end of file ++declare namespace Ns { ++ var C5: any; + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nullPropertyName.js b/testdata/baselines/reference/submodule/conformance/nullPropertyName.js index 687fcfe9e3..ab6060fccf 100644 --- a/testdata/baselines/reference/submodule/conformance/nullPropertyName.js +++ b/testdata/baselines/reference/submodule/conformance/nullPropertyName.js @@ -171,3 +171,282 @@ foo.of = 1; //// [nullPropertyName.d.ts] declare function foo(): void; +declare namespace foo { + var x: number; +} +declare namespace foo { + var y: number; +} +declare namespace foo { + var _a: number; + export { _a as break }; +} +declare namespace foo { + var _b: number; + export { _b as case }; +} +declare namespace foo { + var _c: number; + export { _c as catch }; +} +declare namespace foo { + var _d: number; + export { _d as class }; +} +declare namespace foo { + var _e: number; + export { _e as const }; +} +declare namespace foo { + var _f: number; + export { _f as continue }; +} +declare namespace foo { + var _g: number; + export { _g as debugger }; +} +declare namespace foo { + var _h: number; + export { _h as default }; +} +declare namespace foo { + var _j: number; + export { _j as delete }; +} +declare namespace foo { + var _k: number; + export { _k as do }; +} +declare namespace foo { + var _l: number; + export { _l as else }; +} +declare namespace foo { + var _m: number; + export { _m as enum }; +} +declare namespace foo { + var _o: number; + export { _o as export }; +} +declare namespace foo { + var _p: number; + export { _p as extends }; +} +declare namespace foo { + var _q: number; + export { _q as false }; +} +declare namespace foo { + var _r: number; + export { _r as finally }; +} +declare namespace foo { + var _s: number; + export { _s as for }; +} +declare namespace foo { + var _t: number; + export { _t as function }; +} +declare namespace foo { + var _u: number; + export { _u as if }; +} +declare namespace foo { + var _v: number; + export { _v as import }; +} +declare namespace foo { + var _w: number; + export { _w as in }; +} +declare namespace foo { + var _x: number; + export { _x as instanceof }; +} +declare namespace foo { + var _y: number; + export { _y as new }; +} +declare namespace foo { + var _z: number; + export { _z as null }; +} +declare namespace foo { + var _0: number; + export { _0 as return }; +} +declare namespace foo { + var _1: number; + export { _1 as super }; +} +declare namespace foo { + var _2: number; + export { _2 as switch }; +} +declare namespace foo { + var _3: number; + export { _3 as this }; +} +declare namespace foo { + var _4: number; + export { _4 as throw }; +} +declare namespace foo { + var _5: number; + export { _5 as true }; +} +declare namespace foo { + var _6: number; + export { _6 as try }; +} +declare namespace foo { + var _7: number; + export { _7 as typeof }; +} +declare namespace foo { + var _8: number; + export { _8 as var }; +} +declare namespace foo { + var _9: number; + export { _9 as void }; +} +declare namespace foo { + var _10: number; + export { _10 as while }; +} +declare namespace foo { + var _11: number; + export { _11 as with }; +} +declare namespace foo { + var _12: number; + export { _12 as implements }; +} +declare namespace foo { + var _13: number; + export { _13 as interface }; +} +declare namespace foo { + var _14: number; + export { _14 as let }; +} +declare namespace foo { + var _15: number; + export { _15 as package }; +} +declare namespace foo { + var _16: number; + export { _16 as private }; +} +declare namespace foo { + var _17: number; + export { _17 as protected }; +} +declare namespace foo { + var _18: number; + export { _18 as public }; +} +declare namespace foo { + var _19: number; + export { _19 as static }; +} +declare namespace foo { + var _20: number; + export { _20 as yield }; +} +declare namespace foo { + var abstract: number; +} +declare namespace foo { + var as: number; +} +declare namespace foo { + var asserts: number; +} +declare namespace foo { + var any: number; +} +declare namespace foo { + var async: number; +} +declare namespace foo { + var await: number; +} +declare namespace foo { + var boolean: number; +} +declare namespace foo { + var constructor: number; +} +declare namespace foo { + var declare: number; +} +declare namespace foo { + var get: number; +} +declare namespace foo { + var infer: number; +} +declare namespace foo { + var is: number; +} +declare namespace foo { + var keyof: number; +} +declare namespace foo { + var module: number; +} +declare namespace foo { + var namespace: number; +} +declare namespace foo { + var never: number; +} +declare namespace foo { + var readonly: number; +} +declare namespace foo { + var require: number; +} +declare namespace foo { + var number: number; +} +declare namespace foo { + var object: number; +} +declare namespace foo { + var set: number; +} +declare namespace foo { + var string: number; +} +declare namespace foo { + var symbol: number; +} +declare namespace foo { + var type: number; +} +declare namespace foo { + var undefined: number; +} +declare namespace foo { + var unique: number; +} +declare namespace foo { + var unknown: number; +} +declare namespace foo { + var from: number; +} +declare namespace foo { + var global: number; +} +declare namespace foo { + var bigint: number; +} +declare namespace foo { + var of: number; +} diff --git a/testdata/baselines/reference/submodule/conformance/nullPropertyName.js.diff b/testdata/baselines/reference/submodule/conformance/nullPropertyName.js.diff index 60cf26b0b5..a2d826927d 100644 --- a/testdata/baselines/reference/submodule/conformance/nullPropertyName.js.diff +++ b/testdata/baselines/reference/submodule/conformance/nullPropertyName.js.diff @@ -1,57 +1,194 @@ --- old.nullPropertyName.js +++ new.nullPropertyName.js -@@= skipped -170, +170 lines =@@ - +@@= skipped -171, +171 lines =@@ //// [nullPropertyName.d.ts] declare function foo(): void; --declare namespace foo { + declare namespace foo { - export var x: number; - export var y: number; -- var _a: number; -- var _b: number; -- var _c: number; -- var _d: number; -- var _e: number; -- var _f: number; -- var _g: number; -- var _h: number; -- var _j: number; -- var _k: number; -- var _l: number; -- var _m: number; -- var _o: number; -- var _p: number; -- var _q: number; -- var _r: number; -- var _s: number; -- var _t: number; -- var _u: number; -- var _v: number; -- var _w: number; -- var _x: number; -- var _y: number; -- var _z: number; -- var _0: number; -- var _1: number; -- var _2: number; -- var _3: number; -- var _4: number; -- var _5: number; -- var _6: number; -- var _7: number; -- var _8: number; -- var _9: number; -- var _10: number; -- var _11: number; -- var _12: number; -- var _13: number; -- var _14: number; -- var _15: number; -- var _16: number; -- var _17: number; -- var _18: number; -- var _19: number; -- var _20: number; ++ var x: number; ++} ++declare namespace foo { ++ var y: number; ++} ++declare namespace foo { + var _a: number; ++ export { _a as break }; ++} ++declare namespace foo { + var _b: number; ++ export { _b as case }; ++} ++declare namespace foo { + var _c: number; ++ export { _c as catch }; ++} ++declare namespace foo { + var _d: number; ++ export { _d as class }; ++} ++declare namespace foo { + var _e: number; ++ export { _e as const }; ++} ++declare namespace foo { + var _f: number; ++ export { _f as continue }; ++} ++declare namespace foo { + var _g: number; ++ export { _g as debugger }; ++} ++declare namespace foo { + var _h: number; ++ export { _h as default }; ++} ++declare namespace foo { + var _j: number; ++ export { _j as delete }; ++} ++declare namespace foo { + var _k: number; ++ export { _k as do }; ++} ++declare namespace foo { + var _l: number; ++ export { _l as else }; ++} ++declare namespace foo { + var _m: number; ++ export { _m as enum }; ++} ++declare namespace foo { + var _o: number; ++ export { _o as export }; ++} ++declare namespace foo { + var _p: number; ++ export { _p as extends }; ++} ++declare namespace foo { + var _q: number; ++ export { _q as false }; ++} ++declare namespace foo { + var _r: number; ++ export { _r as finally }; ++} ++declare namespace foo { + var _s: number; ++ export { _s as for }; ++} ++declare namespace foo { + var _t: number; ++ export { _t as function }; ++} ++declare namespace foo { + var _u: number; ++ export { _u as if }; ++} ++declare namespace foo { + var _v: number; ++ export { _v as import }; ++} ++declare namespace foo { + var _w: number; ++ export { _w as in }; ++} ++declare namespace foo { + var _x: number; ++ export { _x as instanceof }; ++} ++declare namespace foo { + var _y: number; ++ export { _y as new }; ++} ++declare namespace foo { + var _z: number; ++ export { _z as null }; ++} ++declare namespace foo { + var _0: number; ++ export { _0 as return }; ++} ++declare namespace foo { + var _1: number; ++ export { _1 as super }; ++} ++declare namespace foo { + var _2: number; ++ export { _2 as switch }; ++} ++declare namespace foo { + var _3: number; ++ export { _3 as this }; ++} ++declare namespace foo { + var _4: number; ++ export { _4 as throw }; ++} ++declare namespace foo { + var _5: number; ++ export { _5 as true }; ++} ++declare namespace foo { + var _6: number; ++ export { _6 as try }; ++} ++declare namespace foo { + var _7: number; ++ export { _7 as typeof }; ++} ++declare namespace foo { + var _8: number; ++ export { _8 as var }; ++} ++declare namespace foo { + var _9: number; ++ export { _9 as void }; ++} ++declare namespace foo { + var _10: number; ++ export { _10 as while }; ++} ++declare namespace foo { + var _11: number; ++ export { _11 as with }; ++} ++declare namespace foo { + var _12: number; ++ export { _12 as implements }; ++} ++declare namespace foo { + var _13: number; ++ export { _13 as interface }; ++} ++declare namespace foo { + var _14: number; ++ export { _14 as let }; ++} ++declare namespace foo { + var _15: number; ++ export { _15 as package }; ++} ++declare namespace foo { + var _16: number; ++ export { _16 as private }; ++} ++declare namespace foo { + var _17: number; ++ export { _17 as protected }; ++} ++declare namespace foo { + var _18: number; ++ export { _18 as public }; ++} ++declare namespace foo { + var _19: number; ++ export { _19 as static }; ++} ++declare namespace foo { + var _20: number; - export var abstract: number; - export var as: number; - export var asserts: number; @@ -84,4 +221,98 @@ - export var bigint: number; - export var of: number; - export { _a as break, _b as case, _c as catch, _d as class, _e as const, _f as continue, _g as debugger, _h as default, _j as delete, _k as do, _l as else, _m as enum, _o as export, _p as extends, _q as false, _r as finally, _s as for, _t as function, _u as if, _v as import, _w as in, _x as instanceof, _y as new, _z as null, _0 as return, _1 as super, _2 as switch, _3 as this, _4 as throw, _5 as true, _6 as try, _7 as typeof, _8 as var, _9 as void, _10 as while, _11 as with, _12 as implements, _13 as interface, _14 as let, _15 as package, _16 as private, _17 as protected, _18 as public, _19 as static, _20 as yield }; --} \ No newline at end of file ++ export { _20 as yield }; ++} ++declare namespace foo { ++ var abstract: number; ++} ++declare namespace foo { ++ var as: number; ++} ++declare namespace foo { ++ var asserts: number; ++} ++declare namespace foo { ++ var any: number; ++} ++declare namespace foo { ++ var async: number; ++} ++declare namespace foo { ++ var await: number; ++} ++declare namespace foo { ++ var boolean: number; ++} ++declare namespace foo { ++ var constructor: number; ++} ++declare namespace foo { ++ var declare: number; ++} ++declare namespace foo { ++ var get: number; ++} ++declare namespace foo { ++ var infer: number; ++} ++declare namespace foo { ++ var is: number; ++} ++declare namespace foo { ++ var keyof: number; ++} ++declare namespace foo { ++ var module: number; ++} ++declare namespace foo { ++ var namespace: number; ++} ++declare namespace foo { ++ var never: number; ++} ++declare namespace foo { ++ var readonly: number; ++} ++declare namespace foo { ++ var require: number; ++} ++declare namespace foo { ++ var number: number; ++} ++declare namespace foo { ++ var object: number; ++} ++declare namespace foo { ++ var set: number; ++} ++declare namespace foo { ++ var string: number; ++} ++declare namespace foo { ++ var symbol: number; ++} ++declare namespace foo { ++ var type: number; ++} ++declare namespace foo { ++ var undefined: number; ++} ++declare namespace foo { ++ var unique: number; ++} ++declare namespace foo { ++ var unknown: number; ++} ++declare namespace foo { ++ var from: number; ++} ++declare namespace foo { ++ var global: number; ++} ++declare namespace foo { ++ var bigint: number; ++} ++declare namespace foo { ++ var of: number; + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment29.js b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment29.js index 2726349e59..b31808bd20 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment29.js +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment29.js @@ -170,29 +170,54 @@ var n = ExpandoExpr3.prop + ExpandoExpr3.m(13) + new ExpandoExpr3().n; //// [typeFromPropertyAssignment29.d.ts] declare function ExpandoDecl(n: number): string; +declare namespace ExpandoDecl { + var prop: number; +} +declare namespace ExpandoDecl { + var m: (n: number) => number; +} declare var n: number; -declare const ExpandoExpr: { - (n: number): string; - prop: { +declare function ExpandoExpr(n: number): string; +declare namespace ExpandoExpr { + var prop: { x: number; y?: undefined; } | { x?: undefined; y: string; }; - m: (n: number) => number; -}; +} +declare namespace ExpandoExpr { + var prop: { + x: number; + y?: undefined; + } | { + x?: undefined; + y: string; + }; +} +declare namespace ExpandoExpr { + var m: (n: number) => number; +} declare var n: number; -declare const ExpandoArrow: { - (n: number): string; - prop: number; - m: (n: number) => number; -}; +declare function ExpandoArrow(n: number): string; +declare namespace ExpandoArrow { + var prop: number; +} +declare namespace ExpandoArrow { + var m: (n: number) => number; +} declare function ExpandoNested(n: number): { (m: number): number; total: number; }; +declare namespace ExpandoNested { + var also: number; +} declare function ExpandoMerge(n: number): number; +declare namespace ExpandoMerge { + var p1: number; +} declare namespace ExpandoMerge { var p2: number; } @@ -202,6 +227,9 @@ declare namespace ExpandoMerge { declare var n: number; declare namespace Ns { function ExpandoNamespace(): void; + declare namespace ExpandoNamespace { + var p6: number; + } export function foo(): typeof ExpandoNamespace; export {}; } diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment29.js.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment29.js.diff index ec27c63891..c3bef5520a 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment29.js.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment29.js.diff @@ -31,53 +31,74 @@ }; ExpandoExpr3.prop = 3; ExpandoExpr3.m = function (n) { -@@= skipped -13, +11 lines =@@ - - //// [typeFromPropertyAssignment29.d.ts] +@@= skipped -15, +13 lines =@@ declare function ExpandoDecl(n: number): string; --declare namespace ExpandoDecl { -- var prop: number; + declare namespace ExpandoDecl { + var prop: number; - var m: (n: number) => number; -} - declare var n: number; - declare const ExpandoExpr: { - (n: number): string; -@@= skipped -14, +10 lines =@@ - x?: undefined; - y: string; - }; +-declare var n: number; +-declare const ExpandoExpr: { +- (n: number): string; +- prop: { +- x: number; +- y?: undefined; +- } | { +- x?: undefined; +- y: string; +- }; - m(n: number): number; -+ m: (n: number) => number; - }; - declare var n: number; - declare const ExpandoArrow: { - (n: number): string; - prop: number; +-}; +-declare var n: number; +-declare const ExpandoArrow: { +- (n: number): string; +- prop: number; - m(n: number): number; -+ m: (n: number) => number; - }; +-}; ++} ++declare namespace ExpandoDecl { ++ var m: (n: number) => number; ++} ++declare var n: number; ++declare function ExpandoExpr(n: number): string; ++declare namespace ExpandoExpr { ++ var prop: { ++ x: number; ++ y?: undefined; ++ } | { ++ x?: undefined; ++ y: string; ++ }; ++} ++declare namespace ExpandoExpr { ++ var prop: { ++ x: number; ++ y?: undefined; ++ } | { ++ x?: undefined; ++ y: string; ++ }; ++} ++declare namespace ExpandoExpr { ++ var m: (n: number) => number; ++} ++declare var n: number; ++declare function ExpandoArrow(n: number): string; ++declare namespace ExpandoArrow { ++ var prop: number; ++} ++declare namespace ExpandoArrow { ++ var m: (n: number) => number; ++} declare function ExpandoNested(n: number): { (m: number): number; total: number; - }; --declare namespace ExpandoNested { -- var also: number; --} - declare function ExpandoMerge(n: number): number; - declare namespace ExpandoMerge { -- var p1: number; --} --declare namespace ExpandoMerge { - var p2: number; - } - declare namespace ExpandoMerge { -@@= skipped -28, +22 lines =@@ +@@= skipped -40, +55 lines =@@ declare var n: number; declare namespace Ns { function ExpandoNamespace(): void; - namespace ExpandoNamespace { -- var p6: number; -- } - export function foo(): typeof ExpandoNamespace; - export {}; - } \ No newline at end of file ++ declare namespace ExpandoNamespace { + var p6: number; + } + export function foo(): typeof ExpandoNamespace; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.js b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.js index 3c3d0d693b..32c4d0ca60 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.js +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.js @@ -14,3 +14,42 @@ declare const foo: { blah: number; }; }; +declare namespace foo { + var baz: { + blah: number; + }; +} +declare namespace foo { + var blah: number; +} + + +//// [DtsFileErrors] + + +a.d.ts(1,15): error TS2451: Cannot redeclare block-scoped variable 'foo'. +a.d.ts(6,19): error TS2451: Cannot redeclare block-scoped variable 'foo'. +a.d.ts(11,19): error TS2451: Cannot redeclare block-scoped variable 'foo'. + + +==== a.d.ts (3 errors) ==== + declare const foo: { + ~~~ +!!! error TS2451: Cannot redeclare block-scoped variable 'foo'. + baz: { + blah: number; + }; + }; + declare namespace foo { + ~~~ +!!! error TS2451: Cannot redeclare block-scoped variable 'foo'. + var baz: { + blah: number; + }; + } + declare namespace foo { + ~~~ +!!! error TS2451: Cannot redeclare block-scoped variable 'foo'. + var blah: number; + } + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.js.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.js.diff index aac1514602..0c5a6e3a9d 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.js.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.js.diff @@ -13,4 +13,43 @@ + baz: { + blah: number; + }; -+}; \ No newline at end of file ++}; ++declare namespace foo { ++ var baz: { ++ blah: number; ++ }; ++} ++declare namespace foo { ++ var blah: number; ++} ++ ++ ++//// [DtsFileErrors] ++ ++ ++a.d.ts(1,15): error TS2451: Cannot redeclare block-scoped variable 'foo'. ++a.d.ts(6,19): error TS2451: Cannot redeclare block-scoped variable 'foo'. ++a.d.ts(11,19): error TS2451: Cannot redeclare block-scoped variable 'foo'. ++ ++ ++==== a.d.ts (3 errors) ==== ++ declare const foo: { ++ ~~~ ++!!! error TS2451: Cannot redeclare block-scoped variable 'foo'. ++ baz: { ++ blah: number; ++ }; ++ }; ++ declare namespace foo { ++ ~~~ ++!!! error TS2451: Cannot redeclare block-scoped variable 'foo'. ++ var baz: { ++ blah: number; ++ }; ++ } ++ declare namespace foo { ++ ~~~ ++!!! error TS2451: Cannot redeclare block-scoped variable 'foo'. ++ var blah: number; ++ } ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment4.js b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment4.js index 05ea5715ce..c6a71ddc88 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment4.js +++ b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment4.js @@ -30,4 +30,13 @@ map4.__underscores__(); //// [a.d.ts] declare function Multimap4(): void; +declare namespace Multimap4 { + var prototype: { + /** + * @param {string} key + * @returns {number} the value ok + */ + get(key: string): number; + }; +} declare const map4: any; diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment4.js.diff b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment4.js.diff index d5ffe64194..1e1f280301 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment4.js.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment4.js.diff @@ -14,6 +14,14 @@ - "add-on"(): void; - addon(): void; - __underscores__(): void; --} ++declare namespace Multimap4 { ++ var prototype: { ++ /** ++ * @param {string} key ++ * @returns {number} the value ok ++ */ ++ get(key: string): number; ++ }; + } -declare const map4: Multimap4; +declare const map4: any; \ No newline at end of file diff --git a/testdata/tests/cases/compiler/declarationEmitExpandoFunction.ts b/testdata/tests/cases/compiler/declarationEmitExpandoFunction.ts new file mode 100644 index 0000000000..607d116295 --- /dev/null +++ b/testdata/tests/cases/compiler/declarationEmitExpandoFunction.ts @@ -0,0 +1,18 @@ +// @declaration: true + +export function A() { + return 'A'; +} + +export function B() { + return 'B'; +} + +export enum C { + C +} + +A.a = C; +A.b = C; + +B.c = C; From a05e479428cb43c6228f78dc04f8326bbd91317b Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:02:07 -0700 Subject: [PATCH 04/69] Re-port isUsedInFunctionOrInstanceProperty (#1872) --- internal/checker/checker.go | 74 ++++++++++++------- .../blockedScopeVariableNotUnused1.js | 23 ++++++ .../blockedScopeVariableNotUnused1.symbols | 17 +++++ .../blockedScopeVariableNotUnused1.types | 22 ++++++ .../blockedScopeVariableNotUnused1.ts | 9 +++ 5 files changed, 117 insertions(+), 28 deletions(-) create mode 100644 testdata/baselines/reference/compiler/blockedScopeVariableNotUnused1.js create mode 100644 testdata/baselines/reference/compiler/blockedScopeVariableNotUnused1.symbols create mode 100644 testdata/baselines/reference/compiler/blockedScopeVariableNotUnused1.types create mode 100644 testdata/tests/cases/compiler/blockedScopeVariableNotUnused1.ts diff --git a/internal/checker/checker.go b/internal/checker/checker.go index 48982081a7..ddf31c26ec 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -1905,46 +1905,64 @@ func (c *Checker) isBlockScopedNameDeclaredBeforeUse(declaration *ast.Node, usag } func (c *Checker) isUsedInFunctionOrInstanceProperty(usage *ast.Node, declaration *ast.Node, declContainer *ast.Node) bool { - for current := usage; current != nil && current != declContainer; current = current.Parent { + return ast.FindAncestorOrQuit(usage, func(current *ast.Node) ast.FindAncestorResult { + if current == declContainer { + return ast.FindAncestorQuit + } if ast.IsFunctionLike(current) { - return ast.GetImmediatelyInvokedFunctionExpression(current) == nil + return ast.ToFindAncestorResult(ast.GetImmediatelyInvokedFunctionExpression(current) == nil) } if ast.IsClassStaticBlockDeclaration(current) { - return declaration.Pos() < usage.Pos() + return ast.ToFindAncestorResult(declaration.Pos() < usage.Pos()) } - if current.Parent != nil && ast.IsPropertyDeclaration(current.Parent) && current.Parent.Initializer() == current { - if ast.IsStatic(current.Parent) { - if ast.IsMethodDeclaration(declaration) { - return true - } - if ast.IsPropertyDeclaration(declaration) && ast.GetContainingClass(usage) == ast.GetContainingClass(declaration) { - propName := declaration.Name() - if ast.IsIdentifier(propName) || ast.IsPrivateIdentifier(propName) { - t := c.getTypeOfSymbol(c.getSymbolOfDeclaration(declaration)) - staticBlocks := core.Filter(declaration.Parent.Members(), ast.IsClassStaticBlockDeclaration) - if c.isPropertyInitializedInStaticBlocks(propName, t, staticBlocks, declaration.Parent.Pos(), current.Pos()) { - return true + + if current.Parent != nil && ast.IsPropertyDeclaration(current.Parent) { + propertyDeclaration := current.Parent + initializerOfProperty := propertyDeclaration.Initializer() == current + if initializerOfProperty { + if ast.IsStatic(current.Parent) { + if ast.IsMethodDeclaration(declaration) { + return ast.FindAncestorTrue + } + if ast.IsPropertyDeclaration(declaration) && ast.GetContainingClass(usage) == ast.GetContainingClass(declaration) { + propName := declaration.Name() + if ast.IsIdentifier(propName) || ast.IsPrivateIdentifier(propName) { + t := c.getTypeOfSymbol(c.getSymbolOfDeclaration(declaration)) + staticBlocks := core.Filter(declaration.Parent.Members(), ast.IsClassStaticBlockDeclaration) + if c.isPropertyInitializedInStaticBlocks(propName, t, staticBlocks, declaration.Parent.Pos(), current.Pos()) { + return ast.FindAncestorTrue + } } } - } - } else { - isDeclarationInstanceProperty := ast.IsPropertyDeclaration(declaration) && !ast.IsStatic(declaration) - if !isDeclarationInstanceProperty || ast.GetContainingClass(usage) != ast.GetContainingClass(declaration) { - return true + } else { + isDeclarationInstanceProperty := ast.IsPropertyDeclaration(declaration) && !ast.IsStatic(declaration) + if !isDeclarationInstanceProperty || ast.GetContainingClass(usage) != ast.GetContainingClass(declaration) { + return ast.FindAncestorTrue + } } } } - if current.Parent != nil && ast.IsDecorator(current.Parent) && current.Parent.AsDecorator().Expression == current { + + if current.Parent != nil && ast.IsDecorator(current.Parent) { decorator := current.Parent.AsDecorator() - if ast.IsParameter(decorator.Parent) { - return c.isUsedInFunctionOrInstanceProperty(decorator.Parent.Parent.Parent, declaration, declContainer) - } - if ast.IsMethodDeclaration(decorator.Parent) { - return c.isUsedInFunctionOrInstanceProperty(decorator.Parent.Parent, declaration, declContainer) + if decorator.Expression == current { + if ast.IsParameter(decorator.Parent) { + if c.isUsedInFunctionOrInstanceProperty(decorator.Parent.Parent.Parent, declaration, declContainer) { + return ast.FindAncestorTrue + } + return ast.FindAncestorQuit + } + if ast.IsMethodDeclaration(decorator.Parent) { + if c.isUsedInFunctionOrInstanceProperty(decorator.Parent.Parent, declaration, declContainer) { + return ast.FindAncestorTrue + } + return ast.FindAncestorQuit + } } } - } - return false + + return ast.FindAncestorFalse + }) != nil } func isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration *ast.Node, usage *ast.Node, declContainer *ast.Node) bool { diff --git a/testdata/baselines/reference/compiler/blockedScopeVariableNotUnused1.js b/testdata/baselines/reference/compiler/blockedScopeVariableNotUnused1.js new file mode 100644 index 0000000000..54a3a527f9 --- /dev/null +++ b/testdata/baselines/reference/compiler/blockedScopeVariableNotUnused1.js @@ -0,0 +1,23 @@ +//// [tests/cases/compiler/blockedScopeVariableNotUnused1.ts] //// + +//// [blockedScopeVariableNotUnused1.ts] +export function foo() { + const _fn = () => { + ;(() => numFilesSelected)() + } + + const numFilesSelected = 1 +} + + +//// [blockedScopeVariableNotUnused1.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = foo; +function foo() { + const _fn = () => { + ; + (() => numFilesSelected)(); + }; + const numFilesSelected = 1; +} diff --git a/testdata/baselines/reference/compiler/blockedScopeVariableNotUnused1.symbols b/testdata/baselines/reference/compiler/blockedScopeVariableNotUnused1.symbols new file mode 100644 index 0000000000..7cb8b2fb75 --- /dev/null +++ b/testdata/baselines/reference/compiler/blockedScopeVariableNotUnused1.symbols @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/blockedScopeVariableNotUnused1.ts] //// + +=== blockedScopeVariableNotUnused1.ts === +export function foo() { +>foo : Symbol(foo, Decl(blockedScopeVariableNotUnused1.ts, 0, 0)) + + const _fn = () => { +>_fn : Symbol(_fn, Decl(blockedScopeVariableNotUnused1.ts, 1, 7)) + + ;(() => numFilesSelected)() +>numFilesSelected : Symbol(numFilesSelected, Decl(blockedScopeVariableNotUnused1.ts, 5, 7)) + } + + const numFilesSelected = 1 +>numFilesSelected : Symbol(numFilesSelected, Decl(blockedScopeVariableNotUnused1.ts, 5, 7)) +} + diff --git a/testdata/baselines/reference/compiler/blockedScopeVariableNotUnused1.types b/testdata/baselines/reference/compiler/blockedScopeVariableNotUnused1.types new file mode 100644 index 0000000000..51f64d7851 --- /dev/null +++ b/testdata/baselines/reference/compiler/blockedScopeVariableNotUnused1.types @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/blockedScopeVariableNotUnused1.ts] //// + +=== blockedScopeVariableNotUnused1.ts === +export function foo() { +>foo : () => void + + const _fn = () => { +>_fn : () => void +>() => { ;(() => numFilesSelected)() } : () => void + + ;(() => numFilesSelected)() +>(() => numFilesSelected)() : number +>(() => numFilesSelected) : () => number +>() => numFilesSelected : () => number +>numFilesSelected : 1 + } + + const numFilesSelected = 1 +>numFilesSelected : 1 +>1 : 1 +} + diff --git a/testdata/tests/cases/compiler/blockedScopeVariableNotUnused1.ts b/testdata/tests/cases/compiler/blockedScopeVariableNotUnused1.ts new file mode 100644 index 0000000000..e0598e702f --- /dev/null +++ b/testdata/tests/cases/compiler/blockedScopeVariableNotUnused1.ts @@ -0,0 +1,9 @@ +// @strict: true + +export function foo() { + const _fn = () => { + ;(() => numFilesSelected)() + } + + const numFilesSelected = 1 +} From c315580d40cfb2fc907d2046dea2b9fed119a9d5 Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Sat, 11 Oct 2025 21:11:32 +0900 Subject: [PATCH 05/69] add pnp resolution support --- go.mod | 3 +- go.sum | 2 + internal/compiler/fileloader.go | 6 +- internal/compiler/host.go | 16 + internal/compiler/pnp.go | 54 ++++ internal/execute/build/compilerHost.go | 5 + internal/execute/build/host.go | 10 +- internal/module/resolver.go | 124 +++++--- internal/module/resolver_pnp.go | 52 ++++ internal/module/resolver_test.go | 4 +- internal/project/ata/ata.go | 4 +- internal/project/compilerhost.go | 13 +- internal/vfs/pnpvfs/pnpvfs.go | 405 +++++++++++++++++++++++++ 13 files changed, 641 insertions(+), 57 deletions(-) create mode 100644 internal/compiler/pnp.go create mode 100644 internal/module/resolver_pnp.go create mode 100644 internal/vfs/pnpvfs/pnpvfs.go diff --git a/go.mod b/go.mod index 8f5243215c..1a8d1e9174 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,12 @@ module github.com/microsoft/typescript-go -go 1.25 +go 1.25.1 require ( github.com/dlclark/regexp2 v1.11.5 github.com/go-json-experiment/json v0.0.0-20250910080747-cc2cfa0554c3 github.com/google/go-cmp v0.7.0 + github.com/gun-yu/pnp-go v0.1.1 // indirect github.com/peter-evans/patience v0.3.0 github.com/zeebo/xxh3 v1.0.2 golang.org/x/sync v0.17.0 diff --git a/go.sum b/go.sum index 78724d28be..2cbdcfa8aa 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,8 @@ github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7 github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/gun-yu/pnp-go v0.1.1 h1:ehMA+adboRrCGmYVSvnYcrRFCUXDlM108EAzWhn5lHg= +github.com/gun-yu/pnp-go v0.1.1/go.mod h1:jxMQxemkTrBk3b9S/hQ486zHLbSFif+JJ/+7BbP2VNo= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= diff --git a/internal/compiler/fileloader.go b/internal/compiler/fileloader.go index 9fbbc49057..1feee58b52 100644 --- a/internal/compiler/fileloader.go +++ b/internal/compiler/fileloader.go @@ -2,6 +2,7 @@ package compiler import ( "cmp" + "fmt" "slices" "strings" "sync" @@ -104,7 +105,7 @@ func processAllProgramFiles( includeProcessor: &includeProcessor{}, } loader.addProjectReferenceTasks(singleThreaded) - loader.resolver = module.NewResolver(loader.projectReferenceFileMapper.host, compilerOptions, opts.TypingsLocation, opts.ProjectName) + loader.resolver = module.NewResolver(loader.projectReferenceFileMapper.host, compilerOptions, opts.TypingsLocation, opts.ProjectName, opts.Host.GetPNPResolutionConfig()) for index, rootFile := range rootFiles { loader.addRootTask(rootFile, nil, &fileIncludeReason{kind: fileIncludeKindRootFile, data: index}) } @@ -548,6 +549,9 @@ func (p *fileLoader) resolveImportsAndModuleAugmentations(t *parseTask) { resolutionsTrace = append(resolutionsTrace, trace...) if !resolvedModule.IsResolved() { + if moduleName == "@emotion/react" { + fmt.Println("resolveImportsAndModuleAugmentations", moduleName, fileName, mode) + } continue } diff --git a/internal/compiler/host.go b/internal/compiler/host.go index 68f3cf620a..e5370f0da2 100644 --- a/internal/compiler/host.go +++ b/internal/compiler/host.go @@ -1,6 +1,7 @@ package compiler import ( + "github.com/gun-yu/pnp-go/pkg" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/core" "github.com/microsoft/typescript-go/internal/parser" @@ -8,6 +9,7 @@ import ( "github.com/microsoft/typescript-go/internal/tspath" "github.com/microsoft/typescript-go/internal/vfs" "github.com/microsoft/typescript-go/internal/vfs/cachedvfs" + "github.com/microsoft/typescript-go/internal/vfs/pnpvfs" ) type CompilerHost interface { @@ -17,6 +19,7 @@ type CompilerHost interface { Trace(msg string) GetSourceFile(opts ast.SourceFileParseOptions) *ast.SourceFile GetResolvedProjectReference(fileName string, path tspath.Path) *tsoptions.ParsedCommandLine + GetPNPResolutionConfig() *pkg.ResolutionConfig } var _ CompilerHost = (*compilerHost)(nil) @@ -27,6 +30,7 @@ type compilerHost struct { defaultLibraryPath string extendedConfigCache tsoptions.ExtendedConfigCache trace func(msg string) + pnpResolutionConfig *pkg.ResolutionConfig } func NewCachedFSCompilerHost( @@ -49,12 +53,20 @@ func NewCompilerHost( if trace == nil { trace = func(msg string) {} } + + pnpResolutionConfig := TryGetPnpResolutionConfig(currentDirectory) + + if pnpResolutionConfig != nil { + fs = pnpvfs.From(fs) + } + return &compilerHost{ currentDirectory: currentDirectory, fs: fs, defaultLibraryPath: defaultLibraryPath, extendedConfigCache: extendedConfigCache, trace: trace, + pnpResolutionConfig: pnpResolutionConfig, } } @@ -86,3 +98,7 @@ func (h *compilerHost) GetResolvedProjectReference(fileName string, path tspath. commandLine, _ := tsoptions.GetParsedCommandLineOfConfigFilePath(fileName, path, nil, h, h.extendedConfigCache) return commandLine } + +func (h *compilerHost) GetPNPResolutionConfig() *pkg.ResolutionConfig { + return h.pnpResolutionConfig +} diff --git a/internal/compiler/pnp.go b/internal/compiler/pnp.go new file mode 100644 index 0000000000..6a4b5b4829 --- /dev/null +++ b/internal/compiler/pnp.go @@ -0,0 +1,54 @@ +package compiler + +import ( + "io/fs" + "os" + "path/filepath" + + "github.com/gun-yu/pnp-go/pkg" +) + +func TryGetPnpResolutionConfig(path string) *pkg.ResolutionConfig { + pnpManifestPath, err := findNearestPNPPath(path) + if err != nil { + return nil + } + pnpManifest, err := pkg.LoadPNPManifest(pnpManifestPath) + if err != nil { + return nil + } + + return &pkg.ResolutionConfig{ + Host: pkg.ResolutionHost{ + FindPNPManifest: func(_ string) (*pkg.Manifest, error) { + return &pnpManifest, nil + }, + }, + } +} + +func findNearestPNPPath(start string) (string, error) { + dir := start + if fi, err := os.Stat(start); err == nil { + if !fi.IsDir() { + dir = filepath.Dir(start) + } + } else { + dir = filepath.Dir(start) + } + + for { + for _, name := range []string{".pnp.data.json", ".pnp.cjs", ".pnp.js"} { + candidate := filepath.Join(dir, name) + if fi, err := os.Stat(candidate); err == nil && !fi.IsDir() { + return candidate, nil + } + } + parent := filepath.Dir(dir) + if parent == dir { + break + } + dir = parent + } + return "", fs.ErrNotExist +} diff --git a/internal/execute/build/compilerHost.go b/internal/execute/build/compilerHost.go index f11f06b9fc..60b8a6387d 100644 --- a/internal/execute/build/compilerHost.go +++ b/internal/execute/build/compilerHost.go @@ -1,6 +1,7 @@ package build import ( + "github.com/gun-yu/pnp-go/pkg" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/compiler" "github.com/microsoft/typescript-go/internal/tsoptions" @@ -38,3 +39,7 @@ func (h *compilerHost) GetSourceFile(opts ast.SourceFileParseOptions) *ast.Sourc func (h *compilerHost) GetResolvedProjectReference(fileName string, path tspath.Path) *tsoptions.ParsedCommandLine { return h.host.GetResolvedProjectReference(fileName, path) } + +func (h *compilerHost) GetPNPResolutionConfig() *pkg.ResolutionConfig { + return h.host.GetPNPResolutionConfig() +} diff --git a/internal/execute/build/host.go b/internal/execute/build/host.go index 91f50aa59c..35577abfd2 100644 --- a/internal/execute/build/host.go +++ b/internal/execute/build/host.go @@ -3,6 +3,7 @@ package build import ( "time" + "github.com/gun-yu/pnp-go/pkg" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/collections" "github.com/microsoft/typescript-go/internal/compiler" @@ -23,8 +24,9 @@ type host struct { configTimes collections.SyncMap[tspath.Path, time.Duration] // caches that stay as long as they are needed - resolvedReferences parseCache[tspath.Path, *tsoptions.ParsedCommandLine] - mTimes *collections.SyncMap[tspath.Path, time.Time] + resolvedReferences parseCache[tspath.Path, *tsoptions.ParsedCommandLine] + mTimes *collections.SyncMap[tspath.Path, time.Time] + pnpResolutionConfig *pkg.ResolutionConfig } var ( @@ -111,3 +113,7 @@ func (h *host) storeMTimeFromOldCache(file string, oldCache *collections.SyncMap h.mTimes.Store(path, mTime) } } + +func (h *host) GetPNPResolutionConfig() *pkg.ResolutionConfig { + return h.pnpResolutionConfig +} diff --git a/internal/module/resolver.go b/internal/module/resolver.go index e88a468cc0..82d9b4bf35 100644 --- a/internal/module/resolver.go +++ b/internal/module/resolver.go @@ -6,6 +6,7 @@ import ( "strings" "sync" + "github.com/gun-yu/pnp-go/pkg" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/collections" "github.com/microsoft/typescript-go/internal/core" @@ -144,11 +145,11 @@ func GetCompilerOptionsWithRedirect(compilerOptions *core.CompilerOptions, redir type Resolver struct { caches - host ResolutionHost - compilerOptions *core.CompilerOptions - typingsLocation string - projectName string - // reportDiagnostic: DiagnosticReporter + host ResolutionHost + compilerOptions *core.CompilerOptions + typingsLocation string + projectName string + pnpResolutionConfig *pkg.ResolutionConfig } func NewResolver( @@ -156,13 +157,15 @@ func NewResolver( options *core.CompilerOptions, typingsLocation string, projectName string, + pnpResolutionConfig *pkg.ResolutionConfig, ) *Resolver { return &Resolver{ - host: host, - caches: newCaches(host.GetCurrentDirectory(), host.FS().UseCaseSensitiveFileNames(), options), - compilerOptions: options, - typingsLocation: typingsLocation, - projectName: projectName, + host: host, + caches: newCaches(host.GetCurrentDirectory(), host.FS().UseCaseSensitiveFileNames(), options), + compilerOptions: options, + typingsLocation: typingsLocation, + projectName: projectName, + pnpResolutionConfig: pnpResolutionConfig, } } @@ -327,32 +330,38 @@ func (r *tracer) traceTypeReferenceDirectiveResult(typeReferenceDirectiveName st func (r *resolutionState) resolveTypeReferenceDirective(typeRoots []string, fromConfig bool, fromInferredTypesContainingFile bool) *ResolvedTypeReferenceDirective { // Primary lookup - if len(typeRoots) > 0 { - if r.tracer != nil { - r.tracer.write(diagnostics.Resolving_with_primary_search_path_0.Format(strings.Join(typeRoots, ", "))) - } - for _, typeRoot := range typeRoots { - candidate := r.getCandidateFromTypeRoot(typeRoot) - directoryExists := r.resolver.host.FS().DirectoryExists(candidate) - if !directoryExists && r.tracer != nil { - r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(typeRoot)) - } - if fromConfig { - // Custom typeRoots resolve as file or directory just like we do modules - if resolvedFromFile := r.loadModuleFromFile(extensionsDeclaration, candidate, !directoryExists); !resolvedFromFile.shouldContinueSearching() { - packageDirectory := ParseNodeModuleFromPath(resolvedFromFile.path, false) - if packageDirectory != "" { - resolvedFromFile.packageId = r.getPackageId(resolvedFromFile.path, r.getPackageJsonInfo(packageDirectory, false /*onlyRecordFailures*/)) + if r.resolver.pnpResolutionConfig != nil { + if resolvedFromNearestNodeModulesDirectory := r.loadModuleFromNearestNodeModulesDirectory(true /*typesScopeOnly*/); !resolvedFromNearestNodeModulesDirectory.shouldContinueSearching() { + return r.createResolvedTypeReferenceDirective(resolvedFromNearestNodeModulesDirectory, true /*primary*/) + } + } else { + if len(typeRoots) > 0 { + if r.tracer != nil { + r.tracer.write(diagnostics.Resolving_with_primary_search_path_0.Format(strings.Join(typeRoots, ", "))) + } + for _, typeRoot := range typeRoots { + candidate := r.getCandidateFromTypeRoot(typeRoot) + directoryExists := r.resolver.host.FS().DirectoryExists(candidate) + if !directoryExists && r.tracer != nil { + r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(typeRoot)) + } + if fromConfig { + // Custom typeRoots resolve as file or directory just like we do modules + if resolvedFromFile := r.loadModuleFromFile(extensionsDeclaration, candidate, !directoryExists); !resolvedFromFile.shouldContinueSearching() { + packageDirectory := ParseNodeModuleFromPath(resolvedFromFile.path, false) + if packageDirectory != "" { + resolvedFromFile.packageId = r.getPackageId(resolvedFromFile.path, r.getPackageJsonInfo(packageDirectory, false /*onlyRecordFailures*/)) + } + return r.createResolvedTypeReferenceDirective(resolvedFromFile, true /*primary*/) } - return r.createResolvedTypeReferenceDirective(resolvedFromFile, true /*primary*/) + } + if resolvedFromDirectory := r.loadNodeModuleFromDirectory(extensionsDeclaration, candidate, !directoryExists, true /*considerPackageJson*/); !resolvedFromDirectory.shouldContinueSearching() { + return r.createResolvedTypeReferenceDirective(resolvedFromDirectory, true /*primary*/) } } - if resolvedFromDirectory := r.loadNodeModuleFromDirectory(extensionsDeclaration, candidate, !directoryExists, true /*considerPackageJson*/); !resolvedFromDirectory.shouldContinueSearching() { - return r.createResolvedTypeReferenceDirective(resolvedFromDirectory, true /*primary*/) - } + } else if r.tracer != nil { + r.tracer.write(diagnostics.Root_directory_cannot_be_determined_skipping_primary_search_paths.Format()) } - } else if r.tracer != nil { - r.tracer.write(diagnostics.Root_directory_cannot_be_determined_skipping_primary_search_paths.Format()) } // Secondary lookup @@ -581,7 +590,8 @@ func (r *resolutionState) loadModuleFromExports(packageInfo *packagejson.InfoCac } } if mainExport.Type != packagejson.JSONValueTypeNotPresent { - return r.loadModuleFromTargetExportOrImport(ext, subpath, packageInfo, false /*isImports*/, mainExport, "", false /*isPattern*/, ".") + result := r.loadModuleFromTargetExportOrImport(ext, subpath, packageInfo, false /*isImports*/, mainExport, "", false /*isPattern*/, ".") + return result } } else if packageInfo.Contents.Exports.Type == packagejson.JSONValueTypeObject && packageInfo.Contents.Exports.IsSubpaths() { if result := r.loadModuleFromExportsOrImports(ext, subpath, packageInfo.Contents.Exports.AsObject(), packageInfo, false /*isImports*/); !result.shouldContinueSearching() { @@ -899,8 +909,14 @@ func (r *resolutionState) loadModuleFromNearestNodeModulesDirectory(typesScopeOn if r.tracer != nil { r.tracer.write(diagnostics.Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0.Format(priorityExtensions.String())) } - if result := r.loadModuleFromNearestNodeModulesDirectoryWorker(priorityExtensions, mode, typesScopeOnly); !result.shouldContinueSearching() { - return result + if r.resolver.pnpResolutionConfig != nil { + if result := r.loadModuleFromPNP(priorityExtensions, typesScopeOnly); !result.shouldContinueSearching() { + return result + } + } else { + if result := r.loadModuleFromNearestNodeModulesDirectoryWorker(priorityExtensions, mode, typesScopeOnly); !result.shouldContinueSearching() { + return result + } } } // (2) @@ -908,8 +924,17 @@ func (r *resolutionState) loadModuleFromNearestNodeModulesDirectory(typesScopeOn if r.tracer != nil { r.tracer.write(diagnostics.Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0.Format(secondaryExtensions.String())) } - return r.loadModuleFromNearestNodeModulesDirectoryWorker(secondaryExtensions, mode, typesScopeOnly) + if r.resolver.pnpResolutionConfig != nil { + if result := r.loadModuleFromPNP(secondaryExtensions, typesScopeOnly); !result.shouldContinueSearching() { + return result + } + } else { + if result := r.loadModuleFromNearestNodeModulesDirectoryWorker(secondaryExtensions, mode, typesScopeOnly); !result.shouldContinueSearching() { + return result + } + } } + return continueSearching() } @@ -936,7 +961,10 @@ func (r *resolutionState) loadModuleFromImmediateNodeModulesDirectory(extensions } if !typesScopeOnly { - if packageResult := r.loadModuleFromSpecificNodeModulesDirectory(extensions, r.name, nodeModulesFolder, nodeModulesFolderExists); !packageResult.shouldContinueSearching() { + candidate := tspath.NormalizePath(tspath.CombinePaths(nodeModulesFolder, r.name)) + packageName, rest := ParsePackageName(r.name) + packageDirectory := tspath.CombinePaths(nodeModulesFolder, packageName) + if packageResult := r.loadModuleFromSpecificNodeModulesDirectory(extensions, candidate, packageDirectory, rest, nodeModulesFolderExists); !packageResult.shouldContinueSearching() { return packageResult } } @@ -947,17 +975,19 @@ func (r *resolutionState) loadModuleFromImmediateNodeModulesDirectory(extensions if !nodeModulesAtTypesExists && r.tracer != nil { r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(nodeModulesAtTypes)) } - return r.loadModuleFromSpecificNodeModulesDirectory(extensionsDeclaration, r.mangleScopedPackageName(r.name), nodeModulesAtTypes, nodeModulesAtTypesExists) + mangledName := r.mangleScopedPackageName(r.name) + + candidate := tspath.NormalizePath(tspath.CombinePaths(nodeModulesAtTypes, mangledName)) + packageName, rest := ParsePackageName(mangledName) + packageDirectory := tspath.CombinePaths(nodeModulesAtTypes, packageName) + + return r.loadModuleFromSpecificNodeModulesDirectory(extensionsDeclaration, candidate, packageDirectory, rest, nodeModulesAtTypesExists) } return continueSearching() } -func (r *resolutionState) loadModuleFromSpecificNodeModulesDirectory(ext extensions, moduleName string, nodeModulesDirectory string, nodeModulesDirectoryExists bool) *resolved { - candidate := tspath.NormalizePath(tspath.CombinePaths(nodeModulesDirectory, moduleName)) - packageName, rest := ParsePackageName(moduleName) - packageDirectory := tspath.CombinePaths(nodeModulesDirectory, packageName) - +func (r *resolutionState) loadModuleFromSpecificNodeModulesDirectory(ext extensions, candidate string, packageDirectory string, rest string, nodeModulesDirectoryExists bool) *resolved { var rootPackageInfo *packagejson.InfoCacheEntry // First look for a nested package.json, as in `node_modules/foo/bar/package.json` packageInfo := r.getPackageJsonInfo(candidate, !nodeModulesDirectoryExists) @@ -970,7 +1000,6 @@ func (r *resolutionState) loadModuleFromSpecificNodeModulesDirectory(ext extensi if fromFile := r.loadModuleFromFile(ext, candidate, !nodeModulesDirectoryExists); !fromFile.shouldContinueSearching() { return fromFile } - if fromDirectory := r.loadNodeModuleFromDirectoryWorker(ext, candidate, !nodeModulesDirectoryExists, packageInfo); !fromDirectory.shouldContinueSearching() { fromDirectory.packageId = r.getPackageId(packageDirectory, packageInfo) return fromDirectory @@ -1016,7 +1045,8 @@ func (r *resolutionState) loadModuleFromSpecificNodeModulesDirectory(ext extensi packageInfo.Exists() && packageInfo.Contents.Exports.Type != packagejson.JSONValueTypeNotPresent { // package exports are higher priority than file/directory/typesVersions lookups and (and, if there's exports present, blocks them) - return r.loadModuleFromExports(packageInfo, ext, tspath.CombinePaths(".", rest)) + result := r.loadModuleFromExports(packageInfo, ext, tspath.CombinePaths(".", rest)) + return result } if rest != "" { versionPaths := packageInfo.Contents.GetVersionPaths(r.getTraceFunc()) @@ -1519,6 +1549,7 @@ func (r *resolutionState) loadNodeModuleFromDirectoryWorker(ext extensions, cand packageFile = file onlyRecordFailuresForPackageFile = !r.resolver.host.FS().DirectoryExists(tspath.GetDirectoryPath(file)) } + } else { } } @@ -1679,6 +1710,7 @@ func (r *resolutionState) getPackageJsonInfo(packageDirectory string, onlyRecord if r.tracer != nil { r.tracer.write(diagnostics.Found_package_json_at_0.Format(packageJsonPath)) } + result := &packagejson.InfoCacheEntry{ PackageDirectory: packageDirectory, DirectoryExists: true, @@ -1973,7 +2005,7 @@ func extensionIsOk(extensions extensions, extension string) bool { } func ResolveConfig(moduleName string, containingFile string, host ResolutionHost) *ResolvedModule { - resolver := NewResolver(host, &core.CompilerOptions{ModuleResolution: core.ModuleResolutionKindNodeNext}, "", "") + resolver := NewResolver(host, &core.CompilerOptions{ModuleResolution: core.ModuleResolutionKindNodeNext}, "", "", nil) return resolver.resolveConfig(moduleName, containingFile) } diff --git a/internal/module/resolver_pnp.go b/internal/module/resolver_pnp.go new file mode 100644 index 0000000000..030b88b421 --- /dev/null +++ b/internal/module/resolver_pnp.go @@ -0,0 +1,52 @@ +package module + +import ( + "strings" + + "github.com/gun-yu/pnp-go/pkg" + "github.com/microsoft/typescript-go/internal/tspath" +) + +func (r *resolutionState) loadPNPResolutionPath(moduleName string) (string, error) { + resolution, err := pkg.ResolveToUnqualified(moduleName, r.containingDirectory, r.resolver.pnpResolutionConfig) + if err != nil { + return "", err + } + + // trim trailing slash makes a bug in packageJsonInfoCache.Set + // like @emotion/react/ -> @emotion/react after packageJsonInfoCache.Set + // check why it's happening in packageJsonInfoCache and need to fix it + return strings.TrimSuffix(resolution.Path, "/"), nil +} + +func (r *resolutionState) loadModuleFromPNP(extensions extensions, typesScopeOnly bool) *resolved { + packageName, rest := ParsePackageName(r.name) + + if !typesScopeOnly { + pnpPath, err := r.loadPNPResolutionPath(packageName) + + if err == nil && r.resolver.host.FS().DirectoryExists(pnpPath) { + candidate := tspath.NormalizePath(tspath.CombinePaths(pnpPath, rest)) + packageDirectory := pnpPath + + if result := r.loadModuleFromSpecificNodeModulesDirectory(extensions, candidate, packageDirectory, rest, true); !result.shouldContinueSearching() { + return result + } + } + } + + if extensions&extensionsDeclaration != 0 { + typesPackageName := "@types/" + r.mangleScopedPackageName(packageName) + pnpTypesPath, err := r.loadPNPResolutionPath(typesPackageName) + if err == nil && r.resolver.host.FS().DirectoryExists(pnpTypesPath) { + candidate := tspath.NormalizePath(tspath.CombinePaths(pnpTypesPath, rest)) + packageDirectory := pnpTypesPath + + if result := r.loadModuleFromSpecificNodeModulesDirectory(extensionsDeclaration, candidate, packageDirectory, rest, true); !result.shouldContinueSearching() { + return result + } + } + } + + return continueSearching() +} diff --git a/internal/module/resolver_test.go b/internal/module/resolver_test.go index eb777c8e33..429a305f64 100644 --- a/internal/module/resolver_test.go +++ b/internal/module/resolver_test.go @@ -300,7 +300,7 @@ func runTraceBaseline(t *testing.T, test traceTestCase) { t.Parallel() host := newVFSModuleResolutionHost(test.files, test.currentDirectory) - resolver := module.NewResolver(host, test.compilerOptions, "", "") + resolver := module.NewResolver(host, test.compilerOptions, "", "", nil) for _, call := range test.calls { doCall(t, resolver, call, false /*skipLocations*/) @@ -311,7 +311,7 @@ func runTraceBaseline(t *testing.T, test traceTestCase) { t.Run("concurrent", func(t *testing.T) { concurrentHost := newVFSModuleResolutionHost(test.files, test.currentDirectory) - concurrentResolver := module.NewResolver(concurrentHost, test.compilerOptions, "", "") + concurrentResolver := module.NewResolver(concurrentHost, test.compilerOptions, "", "", nil) var wg sync.WaitGroup for _, call := range test.calls { diff --git a/internal/project/ata/ata.go b/internal/project/ata/ata.go index 16689bdb95..18930d419e 100644 --- a/internal/project/ata/ata.go +++ b/internal/project/ata/ata.go @@ -186,7 +186,7 @@ func (ti *TypingsInstaller) installTypings( if packageNames, ok := ti.installWorker(projectID, requestID, scopedTypings, logger); ok { logger.Log(fmt.Sprintf("ATA:: Installed typings %v", packageNames)) var installedTypingFiles []string - resolver := module.NewResolver(ti.host, &core.CompilerOptions{ModuleResolution: core.ModuleResolutionKindNodeNext}, "", "") + resolver := module.NewResolver(ti.host, &core.CompilerOptions{ModuleResolution: core.ModuleResolutionKindNodeNext}, "", "", nil) for _, packageName := range filteredTypings { typingFile := ti.typingToFileName(resolver, packageName) if typingFile == "" { @@ -416,7 +416,7 @@ func (ti *TypingsInstaller) processCacheLocation(projectID string, fs vfs.FS, lo logger.Log("ATA:: Loaded content of " + packageLockJson + ": " + npmLockContents) // !!! sheetal strada uses Node10 - resolver := module.NewResolver(ti.host, &core.CompilerOptions{ModuleResolution: core.ModuleResolutionKindNodeNext}, "", "") + resolver := module.NewResolver(ti.host, &core.CompilerOptions{ModuleResolution: core.ModuleResolutionKindNodeNext}, "", "", nil) if npmConfig.DevDependencies != nil && (npmLock.Packages != nil || npmLock.Dependencies != nil) { for key := range npmConfig.DevDependencies { npmLockValue, npmLockValueExists := npmLock.Packages["node_modules/"+key] diff --git a/internal/project/compilerhost.go b/internal/project/compilerhost.go index d58b3522b8..b038c56992 100644 --- a/internal/project/compilerhost.go +++ b/internal/project/compilerhost.go @@ -3,6 +3,7 @@ package project import ( "time" + "github.com/gun-yu/pnp-go/pkg" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/collections" "github.com/microsoft/typescript-go/internal/compiler" @@ -24,9 +25,10 @@ type compilerHost struct { configFileRegistry *ConfigFileRegistry seenFiles *collections.SyncSet[tspath.Path] - project *Project - builder *projectCollectionBuilder - logger *logging.LogTree + project *Project + builder *projectCollectionBuilder + logger *logging.LogTree + pnpResolutionConfig *pkg.ResolutionConfig } type builderFileSource struct { @@ -108,6 +110,11 @@ func (c *compilerHost) GetCurrentDirectory() string { return c.currentDirectory } +// GetPNPResolutionConfig implements compiler.CompilerHost. +func (c *compilerHost) GetPNPResolutionConfig() *pkg.ResolutionConfig { + return c.pnpResolutionConfig +} + // GetResolvedProjectReference implements compiler.CompilerHost. func (c *compilerHost) GetResolvedProjectReference(fileName string, path tspath.Path) *tsoptions.ParsedCommandLine { if c.builder == nil { diff --git a/internal/vfs/pnpvfs/pnpvfs.go b/internal/vfs/pnpvfs/pnpvfs.go new file mode 100644 index 0000000000..259d2c00e8 --- /dev/null +++ b/internal/vfs/pnpvfs/pnpvfs.go @@ -0,0 +1,405 @@ +package pnpvfs + +import ( + "archive/zip" + "fmt" + "io" + "strconv" + "strings" + "sync" + "time" + + "github.com/microsoft/typescript-go/internal/vfs" +) + +type EntryKind uint8 + +const ( + DirEntry EntryKind = 1 + FileEntry EntryKind = 2 +) + +type PNPFS struct { + inner vfs.FS + + zipFilesMutex sync.Mutex + zipFiles map[string]*zipFile +} + +type zipFile struct { + reader *zip.ReadCloser + err error + + dirs map[string]*compressedDir + files map[string]*compressedFile + wait sync.WaitGroup +} + +type compressedDir struct { + entries map[string]EntryKind + path string + mutex sync.Mutex +} + +type compressedFile struct { + compressed *zip.File + + // The file is decompressed lazily + mutex sync.Mutex + contents string + err error + wasRead bool +} + +func From(baseFS vfs.FS) *PNPFS { + return &PNPFS{ + inner: baseFS, + + zipFilesMutex: sync.Mutex{}, + zipFiles: make(map[string]*zipFile), + } +} + +func (fs *PNPFS) checkForZip(path string, kind EntryKind) (*zipFile, string) { + var zipPath string + var pathTail string + + // Do a quick check for a ".zip" in the path at all + path = strings.ReplaceAll(path, "\\", "/") + if i := strings.Index(path, ".zip/"); i != -1 { + zipPath = path[:i+len(".zip")] + pathTail = path[i+len(".zip/"):] + } else if kind == DirEntry && strings.HasSuffix(path, ".zip") { + zipPath = path + } else { + return nil, "" + } + + // If there is one, then check whether it's a file on the file system or not + fs.zipFilesMutex.Lock() + archive := fs.zipFiles[zipPath] + if archive != nil { + fs.zipFilesMutex.Unlock() + archive.wait.Wait() + } else { + archive = &zipFile{} + archive.wait.Add(1) + fs.zipFiles[zipPath] = archive + fs.zipFilesMutex.Unlock() + defer archive.wait.Done() + + // Try reading the zip archive if it's not in the cache + tryToReadZipArchive(zipPath, archive) + } + + if archive.err != nil { + return nil, "" + } + return archive, pathTail +} + +func tryToReadZipArchive(zipPath string, archive *zipFile) { + reader, err := zip.OpenReader(zipPath) + if err != nil { + archive.err = err + return + } + + dirs := make(map[string]*compressedDir) + files := make(map[string]*compressedFile) + seeds := []string{} + + // Build an index of all files in the archive + for _, file := range reader.File { + baseName := strings.TrimSuffix(file.Name, "/") + dirPath := "" + if slash := strings.LastIndexByte(baseName, '/'); slash != -1 { + dirPath = baseName[:slash] + baseName = baseName[slash+1:] + } + if file.FileInfo().IsDir() { + // Handle a directory + lowerDir := strings.ToLower(dirPath) + if _, ok := dirs[lowerDir]; !ok { + dir := &compressedDir{ + path: dirPath, + entries: make(map[string]EntryKind), + } + + // List the same directory both with and without the slash + dirs[lowerDir] = dir + dirs[lowerDir+"/"] = dir + seeds = append(seeds, lowerDir) + } + } else { + // Handle a file + files[strings.ToLower(file.Name)] = &compressedFile{compressed: file} + lowerDir := strings.ToLower(dirPath) + dir, ok := dirs[lowerDir] + if !ok { + dir = &compressedDir{ + path: dirPath, + entries: make(map[string]EntryKind), + } + + // List the same directory both with and without the slash + dirs[lowerDir] = dir + dirs[lowerDir+"/"] = dir + seeds = append(seeds, lowerDir) + } + dir.entries[baseName] = FileEntry + } + } + + // Populate child directories + for _, baseName := range seeds { + for baseName != "" { + dirPath := "" + if slash := strings.LastIndexByte(baseName, '/'); slash != -1 { + dirPath = baseName[:slash] + baseName = baseName[slash+1:] + } + lowerDir := strings.ToLower(dirPath) + dir, ok := dirs[lowerDir] + if !ok { + dir = &compressedDir{ + path: dirPath, + entries: make(map[string]EntryKind), + } + + // List the same directory both with and without the slash + dirs[lowerDir] = dir + dirs[lowerDir+"/"] = dir + } + dir.entries[baseName] = DirEntry + baseName = dirPath + } + } + + archive.dirs = dirs + archive.files = files + archive.reader = reader +} + +func (fs *PNPFS) UseCaseSensitiveFileNames() bool { + return fs.inner.UseCaseSensitiveFileNames() +} + +func (fs *PNPFS) FileExists(path string) bool { + path = mangleYarnPnPVirtualPath(path) + + if fs.inner.FileExists(path) { + return true + } + + zip, pathTail := fs.checkForZip(path, FileEntry) + if zip == nil { + return false + } + + _, ok := zip.files[strings.ToLower(pathTail)] + return ok +} + +func (fs *PNPFS) ReadFile(path string) (contents string, ok bool) { + path = mangleYarnPnPVirtualPath(path) + + isEmotion := strings.Contains(path, "@emotion/react") + + contents, ok = fs.inner.ReadFile(path) + if ok { + if isEmotion { + fmt.Println("inner Read", path, len(contents)) + } + return + } + + // If the file doesn't exist, try reading from an enclosing zip archive + zip, pathTail := fs.checkForZip(path, FileEntry) + if zip == nil { + return "", false + } + + // Does the zip archive have this file? + file, ok := zip.files[strings.ToLower(pathTail)] + if !ok { + return "", false + } + + // Check whether it has already been read + file.mutex.Lock() + defer file.mutex.Unlock() + + if file.wasRead { + return file.contents, file.err == nil + } + file.wasRead = true + + // If not, try to open it + reader, err := file.compressed.Open() + if err != nil { + file.err = err + return "", err == nil + } + defer reader.Close() + + // Then try to read it + bytes, err := io.ReadAll(reader) + if err != nil { + file.err = err + return "", false + } + + file.contents = string(bytes) + + return file.contents, true +} + +func (fs *PNPFS) WriteFile(path string, data string, writeByteOrderMark bool) error { + return fs.inner.WriteFile(path, data, writeByteOrderMark) +} + +func (fs *PNPFS) Remove(path string) error { + return fs.inner.Remove(path) +} + +func (fs *PNPFS) Chtimes(path string, aTime time.Time, mTime time.Time) error { + return fs.inner.Chtimes(path, aTime, mTime) +} + +func (fs *PNPFS) DirectoryExists(path string) bool { + path = mangleYarnPnPVirtualPath(path) + + if fs.inner.DirectoryExists(path) { + return true + } + + zip, pathTail := fs.checkForZip(path, DirEntry) + if zip == nil { + return false + } + + _, ok := zip.dirs[strings.ToLower(pathTail)] + return ok +} + +func (fs *PNPFS) GetAccessibleEntries(path string) vfs.Entries { + path = mangleYarnPnPVirtualPath(path) + + entries := fs.inner.GetAccessibleEntries(path) + if len(entries.Files) > 0 || len(entries.Directories) > 0 { + return entries + } + + zip, pathTail := fs.checkForZip(path, DirEntry) + if zip == nil { + return entries + } + + dir, ok := zip.dirs[strings.ToLower(pathTail)] + if !ok { + return entries + } + + files := make([]string, 0) + dirs := make([]string, 0) + + dir.mutex.Lock() + defer dir.mutex.Unlock() + + for name, kind := range dir.entries { + if kind == FileEntry { + files = append(files, name) + } else if kind == DirEntry { + dirs = append(dirs, name) + } + } + + return vfs.Entries{ + Files: files, + Directories: dirs, + } +} + +func (fs *PNPFS) Stat(path string) vfs.FileInfo { + return fs.inner.Stat(path) +} + +func (fs *PNPFS) WalkDir(root string, walkFn vfs.WalkDirFunc) error { + return fs.inner.WalkDir(root, walkFn) +} + +func (fs *PNPFS) Realpath(path string) string { + realPath := fs.inner.Realpath(path) + return realPath +} + +func ParseYarnPnPVirtualPath(path string) (string, string, bool) { + i := 0 + + for { + start := i + slash := strings.IndexAny(path[i:], "/\\") + if slash == -1 { + break + } + i += slash + 1 + + // Replace the segments "__virtual__//" with N times the ".." + // operation. Note: The "__virtual__" folder name appeared with Yarn 3.0. + // Earlier releases used "$$virtual", but it was changed after discovering + // that this pattern triggered bugs in software where paths were used as + // either regexps or replacement. For example, "$$" found in the second + // parameter of "String.prototype.replace" silently turned into "$". + if segment := path[start : i-1]; segment == "__virtual__" || segment == "$$virtual" { + if slash := strings.IndexAny(path[i:], "/\\"); slash != -1 { + var count string + var suffix string + j := i + slash + 1 + + // Find the range of the count + if slash := strings.IndexAny(path[j:], "/\\"); slash != -1 { + count = path[j : j+slash] + suffix = path[j+slash:] + } else { + count = path[j:] + } + + // Parse the count + if n, err := strconv.ParseInt(count, 10, 64); err == nil { + prefix := path[:start] + + // Apply N times the ".." operator + for n > 0 && (strings.HasSuffix(prefix, "/") || strings.HasSuffix(prefix, "\\")) { + slash := strings.LastIndexAny(prefix[:len(prefix)-1], "/\\") + if slash == -1 { + break + } + prefix = prefix[:slash+1] + n-- + } + + // Make sure the prefix and suffix work well when joined together + if suffix == "" && strings.IndexAny(prefix, "/\\") != strings.LastIndexAny(prefix, "/\\") { + prefix = prefix[:len(prefix)-1] + } else if prefix == "" { + prefix = "." + } else if strings.HasPrefix(suffix, "/") || strings.HasPrefix(suffix, "\\") { + suffix = suffix[1:] + } + + return prefix, suffix, true + } + } + } + } + + return "", "", false +} + +func mangleYarnPnPVirtualPath(path string) string { + if prefix, suffix, ok := ParseYarnPnPVirtualPath(path); ok { + return prefix + suffix + } + return path +} From 99dc36c4889aff6d8dd5964bfa12356efde28d3b Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Sat, 11 Oct 2025 21:14:33 +0900 Subject: [PATCH 06/69] remove fmt --- internal/compiler/fileloader.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/internal/compiler/fileloader.go b/internal/compiler/fileloader.go index 1feee58b52..328529e09b 100644 --- a/internal/compiler/fileloader.go +++ b/internal/compiler/fileloader.go @@ -2,7 +2,6 @@ package compiler import ( "cmp" - "fmt" "slices" "strings" "sync" @@ -549,9 +548,6 @@ func (p *fileLoader) resolveImportsAndModuleAugmentations(t *parseTask) { resolutionsTrace = append(resolutionsTrace, trace...) if !resolvedModule.IsResolved() { - if moduleName == "@emotion/react" { - fmt.Println("resolveImportsAndModuleAugmentations", moduleName, fileName, mode) - } continue } From 25b13ace4a257daa4883ab44dcc8efc2399e007a Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Sun, 12 Oct 2025 03:48:23 +0900 Subject: [PATCH 07/69] pnp internalize --- go.mod | 1 - go.sum | 2 - internal/compiler/host.go | 8 +- internal/compiler/pnp.go | 12 +- internal/execute/build/compilerHost.go | 4 +- internal/execute/build/host.go | 6 +- internal/module/pnp/builtins.go | 62 + .../global-cache/.yarn/install-state.gz | Bin 0 -> 1712 bytes .../pnp/fixtures/global-cache/.yarnrc.yml | 3 + .../pnp/fixtures/global-cache/package.json | 7 + .../module/pnp/fixtures/global-cache/test.js | 1 + .../pnp/fixtures/global-cache/yarn.lock | 38 + internal/module/pnp/fixtures/left-pad-1.zip | Bin 0 -> 11536 bytes internal/module/pnp/fixtures/left-pad-2.zip | Bin 0 -> 11184 bytes internal/module/pnp/lib.go | 468 + internal/module/pnp/lib_test.go | 301 + internal/module/pnp/manifest.go | 229 + ...-dynamic-import-npm-7.8.3-fb9ff5634a-8.zip | Bin 0 -> 2757 bytes .../testdata/edge_case_manifest_state.json | 117 + internal/module/pnp/testdata/pnp-yarn-v3.cjs | 10815 ++++++++++++++++ internal/module/pnp/testdata/pnp-yarn-v4.cjs | 7429 +++++++++++ .../pnp/testdata/test-expectations.json | 378 + internal/module/pnp/utils/normalize_path.go | 61 + .../module/pnp/utils/normalize_path_test.go | 35 + internal/module/pnp/utils/portable_path.go | 45 + internal/module/pnp/utils/trie.go | 32 + internal/module/pnp/utils/trie_internal.go | 80 + .../module/pnp/utils/trie_internal_test.go | 165 + internal/module/resolver.go | 6 +- internal/module/resolver_pnp.go | 4 +- internal/project/compilerhost.go | 6 +- 31 files changed, 20289 insertions(+), 26 deletions(-) create mode 100644 internal/module/pnp/builtins.go create mode 100644 internal/module/pnp/fixtures/global-cache/.yarn/install-state.gz create mode 100644 internal/module/pnp/fixtures/global-cache/.yarnrc.yml create mode 100644 internal/module/pnp/fixtures/global-cache/package.json create mode 100644 internal/module/pnp/fixtures/global-cache/test.js create mode 100644 internal/module/pnp/fixtures/global-cache/yarn.lock create mode 100644 internal/module/pnp/fixtures/left-pad-1.zip create mode 100644 internal/module/pnp/fixtures/left-pad-2.zip create mode 100644 internal/module/pnp/lib.go create mode 100644 internal/module/pnp/lib_test.go create mode 100644 internal/module/pnp/manifest.go create mode 100644 internal/module/pnp/testdata/@babel-plugin-syntax-dynamic-import-npm-7.8.3-fb9ff5634a-8.zip create mode 100644 internal/module/pnp/testdata/edge_case_manifest_state.json create mode 100644 internal/module/pnp/testdata/pnp-yarn-v3.cjs create mode 100644 internal/module/pnp/testdata/pnp-yarn-v4.cjs create mode 100644 internal/module/pnp/testdata/test-expectations.json create mode 100644 internal/module/pnp/utils/normalize_path.go create mode 100644 internal/module/pnp/utils/normalize_path_test.go create mode 100644 internal/module/pnp/utils/portable_path.go create mode 100644 internal/module/pnp/utils/trie.go create mode 100644 internal/module/pnp/utils/trie_internal.go create mode 100644 internal/module/pnp/utils/trie_internal_test.go diff --git a/go.mod b/go.mod index 1a8d1e9174..f2907fdfc7 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,6 @@ require ( github.com/dlclark/regexp2 v1.11.5 github.com/go-json-experiment/json v0.0.0-20250910080747-cc2cfa0554c3 github.com/google/go-cmp v0.7.0 - github.com/gun-yu/pnp-go v0.1.1 // indirect github.com/peter-evans/patience v0.3.0 github.com/zeebo/xxh3 v1.0.2 golang.org/x/sync v0.17.0 diff --git a/go.sum b/go.sum index 2cbdcfa8aa..78724d28be 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,6 @@ github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7 github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/gun-yu/pnp-go v0.1.1 h1:ehMA+adboRrCGmYVSvnYcrRFCUXDlM108EAzWhn5lHg= -github.com/gun-yu/pnp-go v0.1.1/go.mod h1:jxMQxemkTrBk3b9S/hQ486zHLbSFif+JJ/+7BbP2VNo= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= diff --git a/internal/compiler/host.go b/internal/compiler/host.go index e5370f0da2..a34f6edd27 100644 --- a/internal/compiler/host.go +++ b/internal/compiler/host.go @@ -1,9 +1,9 @@ package compiler import ( - "github.com/gun-yu/pnp-go/pkg" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/core" + "github.com/microsoft/typescript-go/internal/module/pnp" "github.com/microsoft/typescript-go/internal/parser" "github.com/microsoft/typescript-go/internal/tsoptions" "github.com/microsoft/typescript-go/internal/tspath" @@ -19,7 +19,7 @@ type CompilerHost interface { Trace(msg string) GetSourceFile(opts ast.SourceFileParseOptions) *ast.SourceFile GetResolvedProjectReference(fileName string, path tspath.Path) *tsoptions.ParsedCommandLine - GetPNPResolutionConfig() *pkg.ResolutionConfig + GetPNPResolutionConfig() *pnp.ResolutionConfig } var _ CompilerHost = (*compilerHost)(nil) @@ -30,7 +30,7 @@ type compilerHost struct { defaultLibraryPath string extendedConfigCache tsoptions.ExtendedConfigCache trace func(msg string) - pnpResolutionConfig *pkg.ResolutionConfig + pnpResolutionConfig *pnp.ResolutionConfig } func NewCachedFSCompilerHost( @@ -99,6 +99,6 @@ func (h *compilerHost) GetResolvedProjectReference(fileName string, path tspath. return commandLine } -func (h *compilerHost) GetPNPResolutionConfig() *pkg.ResolutionConfig { +func (h *compilerHost) GetPNPResolutionConfig() *pnp.ResolutionConfig { return h.pnpResolutionConfig } diff --git a/internal/compiler/pnp.go b/internal/compiler/pnp.go index 6a4b5b4829..fbae9873d8 100644 --- a/internal/compiler/pnp.go +++ b/internal/compiler/pnp.go @@ -5,22 +5,22 @@ import ( "os" "path/filepath" - "github.com/gun-yu/pnp-go/pkg" + module "github.com/microsoft/typescript-go/internal/module/pnp" ) -func TryGetPnpResolutionConfig(path string) *pkg.ResolutionConfig { +func TryGetPnpResolutionConfig(path string) *module.ResolutionConfig { pnpManifestPath, err := findNearestPNPPath(path) if err != nil { return nil } - pnpManifest, err := pkg.LoadPNPManifest(pnpManifestPath) + pnpManifest, err := module.LoadPNPManifest(pnpManifestPath) if err != nil { return nil } - return &pkg.ResolutionConfig{ - Host: pkg.ResolutionHost{ - FindPNPManifest: func(_ string) (*pkg.Manifest, error) { + return &module.ResolutionConfig{ + Host: module.ResolutionHost{ + FindPNPManifest: func(_ string) (*module.Manifest, error) { return &pnpManifest, nil }, }, diff --git a/internal/execute/build/compilerHost.go b/internal/execute/build/compilerHost.go index 60b8a6387d..e21454f35f 100644 --- a/internal/execute/build/compilerHost.go +++ b/internal/execute/build/compilerHost.go @@ -1,9 +1,9 @@ package build import ( - "github.com/gun-yu/pnp-go/pkg" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/compiler" + "github.com/microsoft/typescript-go/internal/module/pnp" "github.com/microsoft/typescript-go/internal/tsoptions" "github.com/microsoft/typescript-go/internal/tspath" "github.com/microsoft/typescript-go/internal/vfs" @@ -40,6 +40,6 @@ func (h *compilerHost) GetResolvedProjectReference(fileName string, path tspath. return h.host.GetResolvedProjectReference(fileName, path) } -func (h *compilerHost) GetPNPResolutionConfig() *pkg.ResolutionConfig { +func (h *compilerHost) GetPNPResolutionConfig() *pnp.ResolutionConfig { return h.host.GetPNPResolutionConfig() } diff --git a/internal/execute/build/host.go b/internal/execute/build/host.go index 35577abfd2..c5a0b6dc05 100644 --- a/internal/execute/build/host.go +++ b/internal/execute/build/host.go @@ -3,12 +3,12 @@ package build import ( "time" - "github.com/gun-yu/pnp-go/pkg" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/collections" "github.com/microsoft/typescript-go/internal/compiler" "github.com/microsoft/typescript-go/internal/execute/incremental" "github.com/microsoft/typescript-go/internal/execute/tsc" + "github.com/microsoft/typescript-go/internal/module/pnp" "github.com/microsoft/typescript-go/internal/tsoptions" "github.com/microsoft/typescript-go/internal/tspath" "github.com/microsoft/typescript-go/internal/vfs" @@ -26,7 +26,7 @@ type host struct { // caches that stay as long as they are needed resolvedReferences parseCache[tspath.Path, *tsoptions.ParsedCommandLine] mTimes *collections.SyncMap[tspath.Path, time.Time] - pnpResolutionConfig *pkg.ResolutionConfig + pnpResolutionConfig *pnp.ResolutionConfig } var ( @@ -114,6 +114,6 @@ func (h *host) storeMTimeFromOldCache(file string, oldCache *collections.SyncMap } } -func (h *host) GetPNPResolutionConfig() *pkg.ResolutionConfig { +func (h *host) GetPNPResolutionConfig() *pnp.ResolutionConfig { return h.pnpResolutionConfig } diff --git a/internal/module/pnp/builtins.go b/internal/module/pnp/builtins.go new file mode 100644 index 0000000000..b195d2275a --- /dev/null +++ b/internal/module/pnp/builtins.go @@ -0,0 +1,62 @@ +package pnp + +import "slices" + +var NodeJSBuiltins = []string{ + "assert", + "assert/strict", + "async_hooks", + "buffer", + "child_process", + "cluster", + "console", + "constants", + "crypto", + "dgram", + "diagnostics_channel", + "dns", + "dns/promises", + "domain", + "events", + "fs", + "fs/promises", + "http", + "http2", + "https", + "inspector", + "module", + "net", + "os", + "path", + "path/posix", + "path/win32", + "perf_hooks", + "process", + "punycode", + "querystring", + "readline", + "readline/promises", + "repl", + "stream", + "stream/consumers", + "stream/promises", + "stream/web", + "string_decoder", + "sys", + "timers", + "timers/promises", + "tls", + "trace_events", + "tty", + "url", + "util", + "util/types", + "v8", + "vm", + "worker_threads", + "zlib", +} + +func IsNodeJSBuiltin(s string) bool { + return slices.Contains(NodeJSBuiltins, s) +} diff --git a/internal/module/pnp/fixtures/global-cache/.yarn/install-state.gz b/internal/module/pnp/fixtures/global-cache/.yarn/install-state.gz new file mode 100644 index 0000000000000000000000000000000000000000..68ee175b15690987223d9d27070cf5448ae855a2 GIT binary patch literal 1712 zcmV;h22c4PiwFP!000006V+Hvj~vGhwd9rcX<2r1Npea0l8dz_2RjJh} z0rf03ay3xJ7Blx4N;dG|VjPM!qneE)x4=Ck<%Tsz>mf+-np-uFn5J*csh~xygl3+g z6f&}?F(eA$#u{o!p@nASaO*^t^X{ANINaRmdcN9j9?d=)K3lE5`}&{D)#CK%$PI>r z?aP(J*~i1d$$X>ZaM%C6U5jqNo-emghfiO~=J9-K^X1WBU#^~>T|c`%T`w4Q0?XdW z3#8b3?J-l($~}|_k|dB5B@N9AnM&wL5=xfpO(U@O>cvCH0wl=_cP7c;(4y5A%rf-E z0M;D3=|93Q+Ohz0?Z5XS53a*Sy~Ble25XpDuIx4r%RN0Q}>F+;XT>O6g@|kR3JeqxUc71j*d?Bj7+05I*U+>-gd3be= zOmZe5uoi>#+-nmew}}|FgSITvA=HFcMT0b=fW1^}4GS`a;8M5;(5k&rMe>}yB&b0v zQL>!B&6v2Lc;X_!o`kJ-XV2bU zY7A5>QG}$!jg5{ghvDE{+xLzZW0S>06@B5ueR~_b*T>y;^oAR2SswXt_lI$Pyjh9* z?C|Wy@akH$SX5$0;o_-4P&P`X*5ud~8MwH`h!MF^E!2@>bf5}IrW%?zgOasUtzJ-} zl49}PDzR(IUITa*6v~*<)s<}8;?9zx>J?av#MY9433?@GO;l29Mon4_jsdt^fXoePc6woV!-iAHH9Q0ghv)~j)d%#>JDq3lqSRy7S=YIkiVW_66#YHz7sf%S{c zc)C`9cp|HZo72^5TyK8{++D};Ex60o$?Q2CrbEJWa5YYhEuu|3M{;a{NJX-y08YXj zxNxu5G8;j6rdFV7PGX6%d5=Z3H%FALUWKwX)R0r9LRl%Hl3SDnJ(GiRwTcC6Z>5{B9=`o?ZBy9kQo&(mFTFRazw%8(qBli?bMHG-UBB;NESgz5DuMUymn0gX*q>_XgEF=cwW#9Kt!M z6}YrYY6&QriWqQJ-EgqsGWp zQ_eJn0J(F6hN2-kKqk=SrE!}io-!t`fw`3)W9Cvh*D9@amJTT^$rVuVyi@GYV7lwr zy^kpz@`UN^)|-<1t#8J~=~R#RqU7$!5q6$k_rlulJR9wWyWY8ecW>}#w}$%{+2Wb# zu^jncq>2y8o!@=kSnrE9zkNPt@TI~53h&0B7t28@UjHXt!&d{s;ee-Ge;;{T_Jc=YN>cc}kq)X-J z;`#s7-bAinmT|jwVjoT;e1&kk4%|-&H#Nfep5K|C_lt0|Tf>9JsK-y|3;*hc>+$CF zWQwJhnrl-QKuI~VqZJQQ3?k>q(Mt=8SS34Eh=3`f7;+BX1GX4abP~+HP#}&qm!f?N zqYFi05@fC+aZ!XEr88@aQbD6o<1l=>Ii9apZtv#z4=&n+^M&uWvi0fwcmE5nyb;-I G9RL8+n|+A@ literal 0 HcmV?d00001 diff --git a/internal/module/pnp/fixtures/global-cache/.yarnrc.yml b/internal/module/pnp/fixtures/global-cache/.yarnrc.yml new file mode 100644 index 0000000000..956fdce496 --- /dev/null +++ b/internal/module/pnp/fixtures/global-cache/.yarnrc.yml @@ -0,0 +1,3 @@ +enableGlobalCache: true + +nodeLinker: pnp diff --git a/internal/module/pnp/fixtures/global-cache/package.json b/internal/module/pnp/fixtures/global-cache/package.json new file mode 100644 index 0000000000..d963d9a21c --- /dev/null +++ b/internal/module/pnp/fixtures/global-cache/package.json @@ -0,0 +1,7 @@ +{ + "name": "global-cache", + "dependencies": { + "source-map-support": "^0.5.21" + }, + "packageManager": "yarn@4.10.0" +} diff --git a/internal/module/pnp/fixtures/global-cache/test.js b/internal/module/pnp/fixtures/global-cache/test.js new file mode 100644 index 0000000000..1e73bc006a --- /dev/null +++ b/internal/module/pnp/fixtures/global-cache/test.js @@ -0,0 +1 @@ +console.log(require.resolve('source-map-support')); diff --git a/internal/module/pnp/fixtures/global-cache/yarn.lock b/internal/module/pnp/fixtures/global-cache/yarn.lock new file mode 100644 index 0000000000..dd14adba93 --- /dev/null +++ b/internal/module/pnp/fixtures/global-cache/yarn.lock @@ -0,0 +1,38 @@ +# This file is generated by running "yarn install" inside your project. +# Manual changes might be lost - proceed with caution! + +__metadata: + version: 8 + cacheKey: 10c0 + +"buffer-from@npm:^1.0.0": + version: 1.1.2 + resolution: "buffer-from@npm:1.1.2" + checksum: 10c0/124fff9d66d691a86d3b062eff4663fe437a9d9ee4b47b1b9e97f5a5d14f6d5399345db80f796827be7c95e70a8e765dd404b7c3ff3b3324f98e9b0c8826cc34 + languageName: node + linkType: hard + +"global-cache@workspace:.": + version: 0.0.0-use.local + resolution: "global-cache@workspace:." + dependencies: + source-map-support: "npm:^0.5.21" + languageName: unknown + linkType: soft + +"source-map-support@npm:^0.5.21": + version: 0.5.21 + resolution: "source-map-support@npm:0.5.21" + dependencies: + buffer-from: "npm:^1.0.0" + source-map: "npm:^0.6.0" + checksum: 10c0/9ee09942f415e0f721d6daad3917ec1516af746a8120bba7bb56278707a37f1eb8642bde456e98454b8a885023af81a16e646869975f06afc1a711fb90484e7d + languageName: node + linkType: hard + +"source-map@npm:^0.6.0": + version: 0.6.1 + resolution: "source-map@npm:0.6.1" + checksum: 10c0/ab55398007c5e5532957cb0beee2368529618ac0ab372d789806f5718123cc4367d57de3904b4e6a4170eb5a0b0f41373066d02ca0735a0c4d75c7d328d3e011 + languageName: node + linkType: hard diff --git a/internal/module/pnp/fixtures/left-pad-1.zip b/internal/module/pnp/fixtures/left-pad-1.zip new file mode 100644 index 0000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vq?wHCO&70O2An*;qO;*_E5^^E^*9GKR;n~CR{1E=DtUi zv_ugY{b-k9_Dnh*9h7_&XH!~LP*D*~{Z|MBzhu}0+oMf)J~0Z)ep+9`;ndIyw|P%r z;(ikcNo^UIdBso5CZh@{y@^M$X#$548EaJjL~#sN14@SIz{YI39!jDpQmH2|IEL+JPtB1tj1#1nmS7RQ^#wVbw+n0p$ZD`B1iMy7SDxp19Do&7c zp_h!A>wIEDd2G57q5uH*hVnIO%p5U}RASd4Rl-}nrZ$3mWfQqV3G6u(--*!y8^wns z(Oo?;HtYh9#YT%AT_sxbbzMtfe<>-Ds5ncK*)Htf~ zkC$>(e@1vcoU;5=rg3cJpXcP*7QT2iw#U&puJIG!9M>E^nmwGd?EH5e+4#{^j_jka zPC}L*R4G)4t0rZ^`uFkD@5CfjX-+(v1HsNFK>z>% literal 0 HcmV?d00001 diff --git a/internal/module/pnp/fixtures/left-pad-2.zip b/internal/module/pnp/fixtures/left-pad-2.zip new file mode 100644 index 0000000000000000000000000000000000000000..5cd468d6a51d28c9205b99f90a97af6acce83ea4 GIT binary patch literal 11184 zcmeHNTW=gm74~je1TC##(LV43R3>P<#~Js`IL^&k=jIDB+1OU>5Ejd1db(?7I_~M7 z?XLD@HbmkHiNAqB2p;$cJR!k9K>Q6}c;-8&`sR3?u|p6bF;=^~>vHPUsqb9sRPQ{z z@D*c@es}-y*RRq27w_wfQ-j(h0zrTsjK!k2~+wa^*L z+OnwSEou!aJ(6+aMmTJ(1{O;z)u(Lb~Yu@?Kz2Ba0k-mx|ZFtZ!piqi!)-`%$Fk^%E>s2Jz{uY z^F`CoXOBMgn)k01`Y8~-EEw?56C=AX8)8A!u7L&IuIk&8zP0T3Vr|O6|9Ee1 zj;`;VI`HcD&gYw3KcHFVzqM`g^ufJ7vG-tIY&=zY_>h&AcTVOPdtvDI4o&_MguXf%oa{y+(9wT|NUlDLO;6Az<5 z{Wc9!@hPq1-8gc*E+CYU&~J0cb*S(p3Z?K90X-S|N=Z+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h z4JoT*BDIfP`Z9OQIH3Zns&m4avW!zKM#dnP9pERXXb}oumq`(yBcOJ+qg!GDRhF(; zFEh(-BZ+*>X--KslBFUUcV!>)&4W^`VR>+2CutW27UB)sr!U|+J6~W1hyuB1i^%xi z3y^7vTl{o!h3ICDQFi$<>UA=gdeJ(fejkMge2{=s638w8Ww{BCwg@To%gQJwp(34t znJNN&AeGSB6S%EN^9>T9kzN=sIQkoL!rt!BLuUZhwr`r z@r93(%AWoyB3IzwuW<~2YP!4fVd6A;)sMnTdVj_TkJHoVl~2T`k*j{{Rg$}N;WTpD zM@7>}RX+kMNsW-dp3YhENzgQ6)vpywVjq9~G-Bnq3)84o&*MvKKgUO-(^=Eho+s02 zRgZW|T9a>{MvJoZ`GLdLz9ev5M5tG@{j$gOcc9zV$|;**U^AdeuBt dN$+>xK8;?Mwc2_3!B?rdfxnM{sb5<3_D?<~v$g;L literal 0 HcmV?d00001 diff --git a/internal/module/pnp/lib.go b/internal/module/pnp/lib.go new file mode 100644 index 0000000000..cd46b507d4 --- /dev/null +++ b/internal/module/pnp/lib.go @@ -0,0 +1,468 @@ +package pnp + +import ( + "encoding/json" + "fmt" + "os" + "path/filepath" + "regexp" + "slices" + "strings" + + "github.com/microsoft/typescript-go/internal/module/pnp/utils" +) + +type ResolutionKind int + +const ( + ResolutionSkipped ResolutionKind = iota + ResolutionResolved +) + +type ResolutionHost struct { + FindPNPManifest func(start string) (*Manifest, error) +} + +type ResolutionConfig struct { + Host ResolutionHost +} + +type Resolution struct { + Kind ResolutionKind + Path string + ModulePath *string +} + +type UndeclaredDependency struct { + Message string + Request string + DependencyName string + IssuerLocator PackageLocator + IssuerPath string +} + +func (e *UndeclaredDependency) Error() string { return e.Message } + +type MissingPeerDependency struct { + Message string + Request string + DependencyName string + IssuerLocator PackageLocator + IssuerPath string + BrokenAncestors []PackageLocator +} + +func (e *MissingPeerDependency) Error() string { return e.Message } + +type FailedManifestHydration struct { + Message string + ManifestPath string + Err error +} + +func (e *FailedManifestHydration) Error() string { + if e.Err != nil { + return fmt.Sprintf("%s\n\nOriginal error: %v", e.Message, e.Err) + } + return e.Message +} +func (e *FailedManifestHydration) Unwrap() error { return e.Err } + +func parseScopedPackageName(spec string) (pkg string, sub *string, ok bool) { + parts := strings.SplitN(spec, "/", 3) + if len(parts) < 2 { + return "", nil, false + } + scope, name := parts[0], parts[1] + if scope == "" || name == "" { + return "", nil, false + } + pkg = scope + "/" + name + if len(parts) == 3 { + s := parts[2] + sub = &s + } + return pkg, sub, true +} + +func parseGlobalPackageName(spec string) (pkg string, sub *string, ok bool) { + parts := strings.SplitN(spec, "/", 2) + if len(parts) == 0 || parts[0] == "" { + return "", nil, false + } + pkg = parts[0] + if len(parts) == 2 { + s := parts[1] + sub = &s + } + return pkg, sub, true +} + +func ParseBareIdentifier(spec string) (string, *string, error) { + var ( + pkg string + sub *string + ok bool + ) + if strings.HasPrefix(spec, "@") { + pkg, sub, ok = parseScopedPackageName(spec) + } else { + pkg, sub, ok = parseGlobalPackageName(spec) + } + if !ok { + return "", nil, &FailedManifestHydration{ + Message: "Invalid specifier", + ManifestPath: spec, + } + } + return pkg, sub, nil +} + +func FindClosestPNPManifestPath(start string) (string, bool) { + dir := filepath.Clean(start) + + for { + candidate := filepath.Join(dir, ".pnp.cjs") + if st, err := os.Stat(candidate); err == nil && !st.IsDir() { + return candidate, true + } + parent := filepath.Dir(dir) + if parent == dir { + break + } + dir = parent + } + return "", false +} + +var rePNP = regexp.MustCompile(`(?s)(const[\ \r\n]+RAW_RUNTIME_STATE[\ \r\n]*=[\ \r\n]*|hydrateRuntimeState\(JSON\.parse\()'`) + +func InitPNPManifest(m *Manifest, manifestPath string) error { + if abs, err := filepath.Abs(manifestPath); err == nil { + m.ManifestPath = abs + m.ManifestDir = filepath.Dir(abs) + } else { + return fmt.Errorf("assertion failed: %w", err) + } + + m.LocationTrie = *utils.NewTrie[PackageLocator]() + + for name, ranges := range m.PackageRegistryData { + for reference, info := range ranges { + joined := filepath.Join(m.ManifestDir, info.PackageLocation) + + if strings.HasSuffix(info.PackageLocation, "/") { + joined = joined + "/" + } + + norm := utils.NormalizePath(joined) + + info.PackageLocation = norm + ranges[reference] = info + + if !info.DiscardFromLookup { + m.LocationTrie.Insert( + info.PackageLocation, + PackageLocator{Name: name, Reference: reference}, + ) + } + } + } + + ranges, ok := m.PackageRegistryData[""] + if !ok { + return fmt.Errorf("assertion failed: should have a top-level name key") + } + top, ok := ranges[""] + if !ok { + return fmt.Errorf("assertion failed: should have a top-level range key") + } + + if m.FallbackPool == nil { + m.FallbackPool = make(FallbackPool) + } + for depName, dep := range top.PackageDependencies { + if _, exists := m.FallbackPool[depName]; !exists { + m.FallbackPool[depName] = dep + } + } + + return nil +} + +func LoadPNPManifest(p string) (Manifest, error) { + content, err := os.ReadFile(p) + if err != nil { + return Manifest{}, &FailedManifestHydration{ + Message: "We failed to read the content of the manifest.", + Err: err, + ManifestPath: func() string { + if abs, e := filepath.Abs(p); e == nil { + return abs + } + return p + }(), + } + } + + loc := rePNP.FindIndex(content) + if loc == nil { + return Manifest{}, &FailedManifestHydration{ + Message: "We failed to locate the PnP data payload inside its manifest file. Did you manually edit the file?", + ManifestPath: p, + } + } + + i := loc[1] + escaped := false + jsonBuf := make([]byte, 0) + + for ; i < len(content); i++ { + c := content[i] + + if c == '\'' && !escaped { + i++ + break + } else if c == '\\' && !escaped { + escaped = true + } else { + escaped = false + jsonBuf = append(jsonBuf, c) + } + } + + var manifest Manifest + if err := json.Unmarshal(jsonBuf, &manifest); err != nil { + return Manifest{}, &FailedManifestHydration{ + Message: "We failed to parse the PnP data payload as proper JSON; Did you manually edit the file?", + ManifestPath: p, + Err: err, + } + } + + InitPNPManifest(&manifest, p) + return manifest, nil +} + +func FindPNPManifest(parent string) (*Manifest, error) { + path, ok := FindClosestPNPManifestPath(parent) + if !ok { + return nil, nil + } + manifest, err := LoadPNPManifest(path) + if err != nil { + return nil, err + } + return &manifest, nil +} + +func IsDependencyTreeRoot(m *Manifest, loc *PackageLocator) bool { + return slices.Contains(m.DependencyTreeRoots, PackageLocator{ + Name: loc.Name, + Reference: loc.Reference, + }) +} + +func FindLocator(manifest *Manifest, absPath string) *PackageLocator { + rel, err := filepath.Rel(manifest.ManifestDir, absPath) + if err != nil { + panic(fmt.Sprintf("Assertion failed: Provided path should be absolute but received %s", absPath)) + } + + if manifest.IgnorePatternData != nil { + re, err := manifest.IgnorePatternData.compile() + if err == nil { + if re.MatchString(utils.NormalizePath(rel)) { + return nil + } + } + } + + normFull := utils.NormalizePath(absPath) + if v, ok := manifest.LocationTrie.GetAncestorValue(normFull); ok && v != nil { + return v + } + return nil +} + +func GetPackage(manifest *Manifest, locator *PackageLocator) (*PackageInformation, error) { + refs, ok := manifest.PackageRegistryData[locator.Name] + if !ok { + return nil, fmt.Errorf("should have an entry in the package registry for %s", locator.Name) + } + info, ok := refs[locator.Reference] + if !ok { + return nil, fmt.Errorf("should have an entry in the package registry for %s", locator.Reference) + } + return &info, nil +} + +func IsExcludedFromFallback(manifest *Manifest, locator *PackageLocator) bool { + if refs, ok := manifest.FallbackExclusionList[locator.Name]; ok { + for _, r := range refs { + if r == locator.Reference { + return true + } + } + } + return false +} + +func FindBrokenPeerDependencies(specifier string, parent *PackageLocator) []PackageLocator { + return []PackageLocator{} +} + +func viaSuffix(specifier string, ident string) string { + if ident != specifier { + return fmt.Sprintf(" (via \"%s\")", ident) + } + return "" +} + +func ResolveToUnqualifiedViaManifest( + manifest *Manifest, + specifier string, + parentPath string, +) (Resolution, error) { + ident, modulePath, err := ParseBareIdentifier(specifier) + if err != nil { + return Resolution{}, err + } + + parentLocator := FindLocator(manifest, parentPath) + if parentLocator == nil { + return Resolution{Kind: ResolutionSkipped}, nil + } + + parentPkg, err := GetPackage(manifest, parentLocator) + if err != nil { + return Resolution{}, err + } + + var refOrAlias *PackageDependency + + if dep, ok := parentPkg.PackageDependencies[ident]; ok && dep != nil { + refOrAlias = dep + } + + if refOrAlias == nil && manifest.EnableTopLevelFallback && !IsExcludedFromFallback(manifest, parentLocator) { + if dep, ok := manifest.FallbackPool[ident]; ok { + refOrAlias = dep + } + } + + if refOrAlias == nil { + if IsNodeJSBuiltin(specifier) { + if IsDependencyTreeRoot(manifest, parentLocator) { + msg := fmt.Sprintf( + "Your application tried to access %s. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since %s isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: %s%s\nRequired by: %s", + ident, ident, ident, viaSuffix(specifier, ident), parentPath, + ) + return Resolution{}, &UndeclaredDependency{ + Message: msg, + Request: specifier, + DependencyName: ident, + IssuerLocator: *parentLocator, + IssuerPath: parentPath, + } + } + msg := fmt.Sprintf( + "%s tried to access %s. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since %s isn't otherwise declared in %s's dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: %s%s\nRequired by: %s", + parentLocator.Name, ident, ident, parentLocator.Name, ident, viaSuffix(specifier, ident), parentPath, + ) + return Resolution{}, &UndeclaredDependency{ + Message: msg, + Request: specifier, + DependencyName: ident, + IssuerLocator: *parentLocator, + IssuerPath: parentPath, + } + } + + if IsDependencyTreeRoot(manifest, parentLocator) { + msg := fmt.Sprintf( + "Your application tried to access %s, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.\n\nRequired package: %s%s\nRequired by: %s", + ident, ident, viaSuffix(specifier, ident), parentPath, + ) + return Resolution{}, &UndeclaredDependency{ + Message: msg, + Request: specifier, + DependencyName: ident, + IssuerLocator: *parentLocator, + IssuerPath: parentPath, + } + } + + brokenAncestors := FindBrokenPeerDependencies(specifier, parentLocator) + allBrokenAreRoots := len(brokenAncestors) > 0 + if allBrokenAreRoots { + for _, brokenAncestor := range brokenAncestors { + if !IsDependencyTreeRoot(manifest, &brokenAncestor) { + allBrokenAreRoots = false + break + } + } + } + + var msg string + if len(brokenAncestors) > 0 && allBrokenAreRoots { + msg = fmt.Sprintf( + "%s tried to access %s (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.\n\nRequired package: %s%s\nRequired by: %s@%s (via %s)", + parentLocator.Name, ident, ident, viaSuffix(specifier, ident), + parentLocator.Name, parentLocator.Reference, parentPath, + ) + } else { + msg = fmt.Sprintf( + "%s tried to access %s (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.\n\nRequired package: %s%s\nRequired by: %s@%s (via %s)", + parentLocator.Name, ident, ident, viaSuffix(specifier, ident), + parentLocator.Name, parentLocator.Reference, parentPath, + ) + } + + return Resolution{}, &MissingPeerDependency{ + Message: msg, + Request: specifier, + DependencyName: ident, + IssuerLocator: *parentLocator, + IssuerPath: parentPath, + BrokenAncestors: brokenAncestors, + } + } + + var target PackageLocator + if refOrAlias.IsAlias { + target = PackageLocator{ + Name: refOrAlias.Alias[0], + Reference: refOrAlias.Alias[1], + } + } else { + target = PackageLocator{ + Name: ident, + Reference: refOrAlias.Reference, + } + } + depPkg, err := GetPackage(manifest, &target) + if err != nil { + return Resolution{}, err + } + + return Resolution{ + Kind: ResolutionResolved, + Path: depPkg.PackageLocation, + ModulePath: modulePath, + }, nil +} + +func ResolveToUnqualified(specifier, parentPath string, cfg *ResolutionConfig) (Resolution, error) { + if cfg == nil || cfg.Host.FindPNPManifest == nil { + return Resolution{}, fmt.Errorf("no host configured") + } + m, err := cfg.Host.FindPNPManifest(parentPath) + if err != nil { + return Resolution{}, err + } + if m == nil { + return Resolution{Kind: ResolutionSkipped}, nil + } + return ResolveToUnqualifiedViaManifest(m, specifier, parentPath) +} diff --git a/internal/module/pnp/lib_test.go b/internal/module/pnp/lib_test.go new file mode 100644 index 0000000000..d0085850f8 --- /dev/null +++ b/internal/module/pnp/lib_test.go @@ -0,0 +1,301 @@ +package pnp + +import ( + "encoding/json" + "fmt" + "log" + "os" + "path/filepath" + "runtime" + "strings" + "testing" + + "github.com/microsoft/typescript-go/internal/module/pnp/utils" +) + +type TestSuite struct { + Manifest Manifest `json:"manifest"` + Tests []TestCase `json:"tests"` +} + +type TestCase struct { + Imported string `json:"imported"` + Importer string `json:"importer"` + Expected string `json:"expected"` + It string `json:"it"` +} + +func Example() { + m, err := LoadPNPManifest("/testdata/pnp-yarn-v3.cjs") + if err != nil { + log.Fatalf("Expected to load the .pnp.cjs file generated by Yarn 3: %v", err) + } + + host := ResolutionHost{ + FindPNPManifest: func(_ string) (*Manifest, error) { + return &m, nil + }, + } + cfg := &ResolutionConfig{Host: host} + + res, err := ResolveToUnqualified("lodash/cloneDeep", "/path/to/file", cfg) + if err != nil { + log.Printf("resolution error: %v", err) + return + } + + switch res.Kind { + case ResolutionResolved: + sub := "" + if res.ModulePath != nil { + sub = *res.ModulePath + } + log.Printf("Resolved: path=%s subpath=%s", res.Path, sub) + + case ResolutionSkipped: + log.Printf("Skipped by PnP resolver; use default resolver") + } +} + +func TestLoadPnPManifest(t *testing.T) { + cases := []struct { + path string + msg string + }{ + {"./testdata/pnp-yarn-v3.cjs", "Expected to load the .pnp.cjs file generated by Yarn 3"}, + {"./testdata/pnp-yarn-v4.cjs", "Expected to load the .pnp.cjs file generated by Yarn 4"}, + } + + for _, tc := range cases { + t.Run(tc.path, func(t *testing.T) { + if _, err := LoadPNPManifest(tc.path); err != nil { + t.Fatalf("%s: %v", tc.msg, err) + } + }) + } +} + +func TestResolveUnqualified(t *testing.T) { + cwd, err := os.Getwd() + if err != nil { + t.Fatalf("Assertion failed: Expected a valid current working directory: %v", err) + } + expectationsPath := filepath.Join(cwd, "/testdata", "test-expectations.json") + + content, err := os.ReadFile(expectationsPath) + if err != nil { + t.Fatalf("Assertion failed: Expected the expectations to be found: %v", err) + } + + var suites []TestSuite + if err := json.Unmarshal(content, &suites); err != nil { + t.Fatalf("Assertion failed: Expected the expectations to be loaded: %v", err) + } + + for si := range suites { + if si != 0 { + continue + } + testSuite := &suites[si] + + manifest := &testSuite.Manifest + InitPNPManifest(manifest, "/path/to/project/.pnp.cjs") + + for _, tc := range testSuite.Tests { + parent := filepath.Join(tc.Importer, "fooo") + manifestCopy := *manifest + + host := ResolutionHost{ + FindPNPManifest: func(_ string) (*Manifest, error) { + cp := manifestCopy + return &cp, nil + }, + } + cfg := &ResolutionConfig{Host: host} + + t.Run(tc.It, func(t *testing.T) { + res, err := ResolveToUnqualified(tc.Imported, parent, cfg) + + switch { + case err == nil && res.Kind == ResolutionResolved: + if res.Path != tc.Expected { + t.Fatalf("'%s': expected resolved path %q, got %q", tc.It, tc.Expected, res.Path) + } + case err == nil && res.Kind == ResolutionSkipped: + if tc.Imported != tc.Expected { + t.Fatalf("'%s': expected skipped specifier %q, got %q", tc.It, tc.Expected, tc.Imported) + } + case err != nil: + if tc.Expected != "error!" { + t.Fatalf("'%s': unexpected error: %v (expected=%q)", tc.It, err, tc.Expected) + } + default: + t.Fatalf("'%s': unreachable state", tc.It) + } + }) + } + } +} +func TestEdgeCase_OnePkgCachedAndUnplugged(t *testing.T) { + cwd, err := os.Getwd() + if err != nil { + t.Fatalf("failed to get cwd: %v", err) + } + + manifestJSONPath := filepath.Join(cwd, "/testdata", "edge_case_manifest_state.json") + content, err := os.ReadFile(manifestJSONPath) + if err != nil { + t.Fatalf("failed to read manifest json: %v", err) + } + + var manifest Manifest + if err := json.Unmarshal(content, &manifest); err != nil { + t.Fatalf("failed to unmarshal manifest: %v", err) + } + + InitPNPManifest(&manifest, manifestJSONPath) + + issuer := filepath.Join( + cwd, + "testdata", + ".yarn", + "unplugged", + "@carbon-icons-react-virtual-379302d360", + "node_modules", + "@carbon", + "icons-react", + "es", + ) + "/" + + res, err := ResolveToUnqualifiedViaManifest(&manifest, "@carbon/icon-helpers", issuer) + if err != nil { + t.Fatalf("resolve failed: %v", err) + } + + switch res.Kind { + case ResolutionResolved: + suffix := ".yarn/unplugged/@carbon-icon-helpers-npm-10.54.0-a58f8b7b6c/node_modules/@carbon/icon-helpers/" + got := filepath.ToSlash(res.Path) + if !strings.HasSuffix(got, suffix) { + t.Fatalf("expected resolved path to end with %q, got %q", suffix, got) + } + default: + t.Fatalf("unexpected resolution kind: %v", res.Kind) + } +} + +func TestParseSinglePackageName(t *testing.T) { + name, sub, err := ParseBareIdentifier("pkg") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if name != "pkg" { + t.Fatalf("expected name %q, got %q", "pkg", name) + } + if sub != nil { + t.Fatalf("expected subpath=nil, got %v", *sub) + } +} + +func TestParseScopedPackageName(t *testing.T) { + name, sub, err := ParseBareIdentifier("@scope/pkg") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if name != "@scope/pkg" { + t.Fatalf("expected name %q, got %q", "@scope/pkg", name) + } + if sub != nil { + t.Fatalf("expected subpath=nil, got %v", *sub) + } +} + +func TestParsePackageNameWithLongSubpath(t *testing.T) { + name, sub, err := ParseBareIdentifier("pkg/a/b/c/index.js") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if name != "pkg" { + t.Fatalf("expected name %q, got %q", "pkg", name) + } + if sub == nil || *sub != "a/b/c/index.js" { + if sub == nil { + t.Fatalf("expected subpath=%q, got nil", "a/b/c/index.js") + } + t.Fatalf("expected subpath=%q, got %q", "a/b/c/index.js", *sub) + } +} + +func TestParseScopedPackageWithLongSubpath(t *testing.T) { + name, sub, err := ParseBareIdentifier("@scope/pkg/a/b/c/index.js") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if name != "@scope/pkg" { + t.Fatalf("expected name %q, got %q", "@scope/pkg", name) + } + if sub == nil || *sub != "a/b/c/index.js" { + if sub == nil { + t.Fatalf("expected subpath=%q, got nil", "a/b/c/index.js") + } + t.Fatalf("expected subpath=%q, got %q", "a/b/c/index.js", *sub) + } +} + +// need fixtures to be yarn install and make global cache +func TestGlobalCache(t *testing.T) { + t.Skip("skipping global cache test") + cwd, err := os.Getwd() + if err != nil { + t.Fatalf("failed to get cwd: %v", err) + } + + pnpPath := filepath.Join(cwd, "/fixtures", "global-cache", ".pnp.cjs") + manifest, err := LoadPNPManifest(pnpPath) + if err != nil { + t.Fatalf("failed to load pnp manifest: %v", err) + } + + home, err := os.UserHomeDir() + if err != nil { + t.Fatalf("failed to get home dir: %v", err) + } + + var globalCache string + if runtime.GOOS == "windows" { + globalCache = filepath.Join(home, "AppData", "Local", "Yarn", "Berry", "cache") + } else { + globalCache = filepath.Join(home, ".yarn", "berry", "cache") + } + + issuer := filepath.Join( + globalCache, + "source-map-support-npm-0.5.21-09ca99e250-10c0.zip", + "node_modules", + "source-map-support", + ) + + res, err := ResolveToUnqualifiedViaManifest(&manifest, "source-map", issuer) + fmt.Println("res", res.Path) + if err != nil { + t.Fatalf("resolve failed: %v", err) + } + if res.Kind != ResolutionResolved { + t.Fatalf("unexpected resolution kind: %v", res.Kind) + } + + got := utils.NormalizePath(res.Path) + expected := utils.NormalizePath(filepath.Join( + globalCache, + "source-map-npm-0.6.1-1a3621db16-10c0.zip", + "node_modules", + "source-map", + )) + "/" + + if got != expected { + t.Fatalf("expected resolved path %q, got %q", expected, got) + } + if res.ModulePath != nil { + t.Fatalf("expected subpath=\"\", got %q", *res.ModulePath) + } +} diff --git a/internal/module/pnp/manifest.go b/internal/module/pnp/manifest.go new file mode 100644 index 0000000000..4206add898 --- /dev/null +++ b/internal/module/pnp/manifest.go @@ -0,0 +1,229 @@ +package pnp + +import ( + "bytes" + "encoding/json" + "errors" + "regexp" + + "github.com/microsoft/typescript-go/internal/module/pnp/utils" +) + +type Trie[T any] = utils.Trie[T] + +type RegexDef struct { + Source string `json:"source"` + Flags string `json:"flags,omitempty"` +} + +type Manifest struct { + ManifestDir string `json:"-"` + ManifestPath string `json:"-"` + LocationTrie Trie[PackageLocator] `json:"-"` + + EnableTopLevelFallback bool `json:"enableTopLevelFallback"` + IgnorePatternData *RegexDef `json:"ignorePatternData,omitempty"` + + DependencyTreeRoots []PackageLocator `json:"dependencyTreeRoots"` + + FallbackPool FallbackPool `json:"fallbackPool"` + + FallbackExclusionList FallbackExclusionList `json:"fallbackExclusionList"` + + PackageRegistryData PackageRegistryData `json:"packageRegistryData"` +} + +type PackageLocator struct { + Name string `json:"name"` + Reference string `json:"reference"` +} + +type PackageInformation struct { + PackageLocation string `json:"packageLocation"` + + DiscardFromLookup bool `json:"discardFromLookup"` + + PackageDependencies FallbackPool `json:"packageDependencies"` +} + +type PackageDependency struct { + Reference string + Alias [2]string + IsAlias bool +} + +func (p *PackageDependency) UnmarshalJSON(data []byte) error { + // case 1: string + var s string + if err := json.Unmarshal(data, &s); err == nil { + p.Reference = s + p.IsAlias = false + return nil + } + + // case 2: [string, string] + var arr []string + if err := json.Unmarshal(data, &arr); err == nil { + if len(arr) != 2 { + return errors.New("PackageDependency: array must have length 2") + } + p.IsAlias = true + p.Alias = [2]string{arr[0], arr[1]} + return nil + } + + return errors.New("PackageDependency: unsupported JSON shape") +} + +type FallbackPool map[string]*PackageDependency + +func (r *RegexDef) UnmarshalJSON(b []byte) error { + if bytes.Equal(bytes.TrimSpace(b), []byte("null")) { + *r = RegexDef{} + return nil + } + if len(b) > 0 && b[0] == '"' { + var s string + if err := json.Unmarshal(b, &s); err != nil { + return err + } + r.Source = s + r.Flags = "" + return nil + } + type alias RegexDef + var a alias + if err := json.Unmarshal(b, &a); err != nil { + return err + } + *r = RegexDef(a) + return nil +} + +func (m *FallbackPool) UnmarshalJSON(data []byte) error { + var items []json.RawMessage + if err := json.Unmarshal(data, &items); err != nil { + return err + } + res := make(FallbackPool, len(items)) + for _, it := range items { + var pair []json.RawMessage + if err := json.Unmarshal(it, &pair); err != nil { + return err + } + if len(pair) != 2 { + return errors.New("fallbackPool: each item must have 2 elements") + } + var key string + if err := json.Unmarshal(pair[0], &key); err != nil { + return err + } + + raw := bytes.TrimSpace(pair[1]) + if bytes.Equal(raw, []byte("null")) { + res[key] = nil + continue + } + + var dep PackageDependency + if err := json.Unmarshal(pair[1], &dep); err != nil { + return err + } + res[key] = &dep + } + *m = res + return nil +} + +type FallbackExclusionList map[string][]string + +func (m *FallbackExclusionList) UnmarshalJSON(data []byte) error { + var items []json.RawMessage + if err := json.Unmarshal(data, &items); err != nil { + return err + } + res := make(FallbackExclusionList, len(items)) + for _, it := range items { + var pair []json.RawMessage + if err := json.Unmarshal(it, &pair); err != nil { + return err + } + if len(pair) != 2 { + return errors.New("fallbackExclusionList: each item must have 2 elements") + } + var key string + if err := json.Unmarshal(pair[0], &key); err != nil { + return err + } + var arr []string + if err := json.Unmarshal(pair[1], &arr); err != nil { + return err + } + res[key] = arr + } + *m = res + return nil +} + +type PackageRegistryData map[string]map[string]PackageInformation + +func (m *PackageRegistryData) UnmarshalJSON(data []byte) error { + var items []json.RawMessage + if err := json.Unmarshal(data, &items); err != nil { + return err + } + res := make(PackageRegistryData, len(items)) + for _, it := range items { + var pair []json.RawMessage + if err := json.Unmarshal(it, &pair); err != nil { + return err + } + if len(pair) != 2 { + return errors.New("packageRegistryData: each item must have 2 elements") + } + + var key1 *string + if err := json.Unmarshal(pair[0], &key1); err != nil { + return err + } + k1 := "" + if key1 != nil { + k1 = *key1 + } + + var inner []json.RawMessage + if err := json.Unmarshal(pair[1], &inner); err != nil { + return err + } + innerMap := make(map[string]PackageInformation, len(inner)) + for _, e := range inner { + var p2 []json.RawMessage + if err := json.Unmarshal(e, &p2); err != nil { + return err + } + if len(p2) != 2 { + return errors.New("packageRegistryData: inner item must have 2 elements") + } + var key2 *string + if err := json.Unmarshal(p2[0], &key2); err != nil { + return err + } + k2 := "" + if key2 != nil { + k2 = *key2 + } + var info PackageInformation + if err := json.Unmarshal(p2[1], &info); err != nil { + return err + } + innerMap[k2] = info + } + res[k1] = innerMap + } + *m = res + return nil +} + +func (r *RegexDef) compile() (*regexp.Regexp, error) { + return regexp.Compile(r.Source) +} diff --git a/internal/module/pnp/testdata/@babel-plugin-syntax-dynamic-import-npm-7.8.3-fb9ff5634a-8.zip b/internal/module/pnp/testdata/@babel-plugin-syntax-dynamic-import-npm-7.8.3-fb9ff5634a-8.zip new file mode 100644 index 0000000000000000000000000000000000000000..a41ecb49c10bb595383d8f771560dd9d758e0ad7 GIT binary patch literal 2757 zcmWIWW@Zs#00D<}*EqloD8UP)^YT+t<8$*Syz_4x@a%gXE?~R0;kxaH%XwXEO`LL1Pneo!X|+u#yFlk~kXXw8x+#;^ zy=`D%bp2F)ku`k6?67`6;Yqh%8qIco|8QSzLw@|ey8k9;Z@s+eytcge^D@bW8S}sX zIG&MljBm~RuRLpI|K^mb=cl`SEPcMX@Z1f-9_BZ%@3Qh08&};`-7tSE+wS&l`OljD z4n(u;I-T#dh?T_%3NbNjKoy2QnQCjA~OcV}ErN}2d^dS0yq=i_Q?o^L(Z4xO|Tmf0!a zqLE{2{X5!S|GIv{7P+Nysx8bu`QdxF#@t`swii+l&{$+hN z|8Lj0{1a`C(z)8^#kQx-t4n;|MxJ*WyEO8;0>5)u(d_I>RJFOn^AWrjx@pIO2j#VryhonW)cWhT-o&1u^d)EWY@Y^iY zVx}?{cP5s2(neu4q~i6$n;9|>}Lnq~i zYFDnJa0 zqT;FteS!kDI#ZkUmj2ql>!GQ4gI8R;!?YlUnhs%e7nXy2C&dOjUHR}($wKH=>DhZ* zQhJ_sgtkBZez^Y$p6p^uPWsNtOhU^t;mynMvokUed|K8i4=6pNBbNSrtYgLm?TW-hHL6#mnB zblslEi%;&ICdaKfx9M;3y-BB{+8h$?F0iNeR;Vamcrs(pNsfkz%Bl|&%>v_AB`(|l zO51c@W5r1$W3R*ik-^QbIIoVjM}w(4go zTW0m$uQ8%IwXb_GuJVhk)g#}?}L(}cPCNTqgfufyd-jrGBO zw+?ODzR&lHyWdW|X+n0>KU;Jx2;?aFS-7*3|5l^DzA@XC;_me&_kLYE#Q0o3Q4>EN-XmTUIa~LDx!^I&$8(Q8YWc8*>F4g5EnGTRkt3kzs3b-i4znb;0wQrLwOVWaZ}OY^e|MW@NHw#$B5O zLkJAsI)W&a3LBqRh=DMz+UQ#0bv e && typeof e === 'object' && 'default' in e ? e : { default: e }; + +function _interopNamespace(e) { + if (e && e.__esModule) return e; + const n = Object.create(null); + if (e) { + for (const k in e) { + if (k !== 'default') { + const d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: () => e[k] + }); + } + } + } + n.default = e; + return Object.freeze(n); +} + +const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); +const path__default = /*#__PURE__*/_interopDefaultLegacy(path); +const require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); +const StringDecoder__default = /*#__PURE__*/_interopDefaultLegacy(StringDecoder); +const nodeUtils__namespace = /*#__PURE__*/_interopNamespace(nodeUtils); +const assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); +const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); + +const S_IFMT = 61440; +const S_IFDIR = 16384; +const S_IFREG = 32768; +const S_IFLNK = 40960; +const SAFE_TIME = 456789e3; + +const DEFAULT_MODE = S_IFREG | 420; +class StatEntry { + constructor() { + this.uid = 0; + this.gid = 0; + this.size = 0; + this.blksize = 0; + this.atimeMs = 0; + this.mtimeMs = 0; + this.ctimeMs = 0; + this.birthtimeMs = 0; + this.atime = new Date(0); + this.mtime = new Date(0); + this.ctime = new Date(0); + this.birthtime = new Date(0); + this.dev = 0; + this.ino = 0; + this.mode = DEFAULT_MODE; + this.nlink = 1; + this.rdev = 0; + this.blocks = 1; + } + isBlockDevice() { + return false; + } + isCharacterDevice() { + return false; + } + isDirectory() { + return (this.mode & S_IFMT) === S_IFDIR; + } + isFIFO() { + return false; + } + isFile() { + return (this.mode & S_IFMT) === S_IFREG; + } + isSocket() { + return false; + } + isSymbolicLink() { + return (this.mode & S_IFMT) === S_IFLNK; + } +} +class BigIntStatsEntry { + constructor() { + this.uid = BigInt(0); + this.gid = BigInt(0); + this.size = BigInt(0); + this.blksize = BigInt(0); + this.atimeMs = BigInt(0); + this.mtimeMs = BigInt(0); + this.ctimeMs = BigInt(0); + this.birthtimeMs = BigInt(0); + this.atimeNs = BigInt(0); + this.mtimeNs = BigInt(0); + this.ctimeNs = BigInt(0); + this.birthtimeNs = BigInt(0); + this.atime = new Date(0); + this.mtime = new Date(0); + this.ctime = new Date(0); + this.birthtime = new Date(0); + this.dev = BigInt(0); + this.ino = BigInt(0); + this.mode = BigInt(DEFAULT_MODE); + this.nlink = BigInt(1); + this.rdev = BigInt(0); + this.blocks = BigInt(1); + } + isBlockDevice() { + return false; + } + isCharacterDevice() { + return false; + } + isDirectory() { + return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFDIR); + } + isFIFO() { + return false; + } + isFile() { + return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFREG); + } + isSocket() { + return false; + } + isSymbolicLink() { + return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFLNK); + } +} +function makeDefaultStats() { + return new StatEntry(); +} +function clearStats(stats) { + for (const key in stats) { + if (Object.prototype.hasOwnProperty.call(stats, key)) { + const element = stats[key]; + if (typeof element === `number`) { + stats[key] = 0; + } else if (typeof element === `bigint`) { + stats[key] = BigInt(0); + } else if (nodeUtils__namespace.types.isDate(element)) { + stats[key] = new Date(0); + } + } + } + return stats; +} +function convertToBigIntStats(stats) { + const bigintStats = new BigIntStatsEntry(); + for (const key in stats) { + if (Object.prototype.hasOwnProperty.call(stats, key)) { + const element = stats[key]; + if (typeof element === `number`) { + bigintStats[key] = BigInt(element); + } else if (nodeUtils__namespace.types.isDate(element)) { + bigintStats[key] = new Date(element); + } + } + } + bigintStats.atimeNs = bigintStats.atimeMs * BigInt(1e6); + bigintStats.mtimeNs = bigintStats.mtimeMs * BigInt(1e6); + bigintStats.ctimeNs = bigintStats.ctimeMs * BigInt(1e6); + bigintStats.birthtimeNs = bigintStats.birthtimeMs * BigInt(1e6); + return bigintStats; +} +function areStatsEqual(a, b) { + if (a.atimeMs !== b.atimeMs) + return false; + if (a.birthtimeMs !== b.birthtimeMs) + return false; + if (a.blksize !== b.blksize) + return false; + if (a.blocks !== b.blocks) + return false; + if (a.ctimeMs !== b.ctimeMs) + return false; + if (a.dev !== b.dev) + return false; + if (a.gid !== b.gid) + return false; + if (a.ino !== b.ino) + return false; + if (a.isBlockDevice() !== b.isBlockDevice()) + return false; + if (a.isCharacterDevice() !== b.isCharacterDevice()) + return false; + if (a.isDirectory() !== b.isDirectory()) + return false; + if (a.isFIFO() !== b.isFIFO()) + return false; + if (a.isFile() !== b.isFile()) + return false; + if (a.isSocket() !== b.isSocket()) + return false; + if (a.isSymbolicLink() !== b.isSymbolicLink()) + return false; + if (a.mode !== b.mode) + return false; + if (a.mtimeMs !== b.mtimeMs) + return false; + if (a.nlink !== b.nlink) + return false; + if (a.rdev !== b.rdev) + return false; + if (a.size !== b.size) + return false; + if (a.uid !== b.uid) + return false; + const aN = a; + const bN = b; + if (aN.atimeNs !== bN.atimeNs) + return false; + if (aN.mtimeNs !== bN.mtimeNs) + return false; + if (aN.ctimeNs !== bN.ctimeNs) + return false; + if (aN.birthtimeNs !== bN.birthtimeNs) + return false; + return true; +} + +const PortablePath = { + root: `/`, + dot: `.`, + parent: `..` +}; +const Filename = { + nodeModules: `node_modules`, + manifest: `package.json`, + lockfile: `yarn.lock`, + virtual: `__virtual__`, + pnpJs: `.pnp.js`, + pnpCjs: `.pnp.cjs`, + rc: `.yarnrc.yml` +}; +const npath = Object.create(path__default.default); +const ppath = Object.create(path__default.default.posix); +npath.cwd = () => process.cwd(); +ppath.cwd = () => toPortablePath(process.cwd()); +ppath.resolve = (...segments) => { + if (segments.length > 0 && ppath.isAbsolute(segments[0])) { + return path__default.default.posix.resolve(...segments); + } else { + return path__default.default.posix.resolve(ppath.cwd(), ...segments); + } +}; +const contains = function(pathUtils, from, to) { + from = pathUtils.normalize(from); + to = pathUtils.normalize(to); + if (from === to) + return `.`; + if (!from.endsWith(pathUtils.sep)) + from = from + pathUtils.sep; + if (to.startsWith(from)) { + return to.slice(from.length); + } else { + return null; + } +}; +npath.fromPortablePath = fromPortablePath; +npath.toPortablePath = toPortablePath; +npath.contains = (from, to) => contains(npath, from, to); +ppath.contains = (from, to) => contains(ppath, from, to); +const WINDOWS_PATH_REGEXP = /^([a-zA-Z]:.*)$/; +const UNC_WINDOWS_PATH_REGEXP = /^\/\/(\.\/)?(.*)$/; +const PORTABLE_PATH_REGEXP = /^\/([a-zA-Z]:.*)$/; +const UNC_PORTABLE_PATH_REGEXP = /^\/unc\/(\.dot\/)?(.*)$/; +function fromPortablePath(p) { + if (process.platform !== `win32`) + return p; + let portablePathMatch, uncPortablePathMatch; + if (portablePathMatch = p.match(PORTABLE_PATH_REGEXP)) + p = portablePathMatch[1]; + else if (uncPortablePathMatch = p.match(UNC_PORTABLE_PATH_REGEXP)) + p = `\\\\${uncPortablePathMatch[1] ? `.\\` : ``}${uncPortablePathMatch[2]}`; + else + return p; + return p.replace(/\//g, `\\`); +} +function toPortablePath(p) { + if (process.platform !== `win32`) + return p; + p = p.replace(/\\/g, `/`); + let windowsPathMatch, uncWindowsPathMatch; + if (windowsPathMatch = p.match(WINDOWS_PATH_REGEXP)) + p = `/${windowsPathMatch[1]}`; + else if (uncWindowsPathMatch = p.match(UNC_WINDOWS_PATH_REGEXP)) + p = `/unc/${uncWindowsPathMatch[1] ? `.dot/` : ``}${uncWindowsPathMatch[2]}`; + return p; +} +function convertPath(targetPathUtils, sourcePath) { + return targetPathUtils === npath ? fromPortablePath(sourcePath) : toPortablePath(sourcePath); +} + +const defaultTime = new Date(SAFE_TIME * 1e3); +async function copyPromise(destinationFs, destination, sourceFs, source, opts) { + const normalizedDestination = destinationFs.pathUtils.normalize(destination); + const normalizedSource = sourceFs.pathUtils.normalize(source); + const prelayout = []; + const postlayout = []; + const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : await sourceFs.lstatPromise(normalizedSource); + await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination), { utimes: [atime, mtime] }); + const updateTime = typeof destinationFs.lutimesPromise === `function` ? destinationFs.lutimesPromise.bind(destinationFs) : destinationFs.utimesPromise.bind(destinationFs); + await copyImpl(prelayout, postlayout, updateTime, destinationFs, normalizedDestination, sourceFs, normalizedSource, { ...opts, didParentExist: true }); + for (const operation of prelayout) + await operation(); + await Promise.all(postlayout.map((operation) => { + return operation(); + })); +} +async function copyImpl(prelayout, postlayout, updateTime, destinationFs, destination, sourceFs, source, opts) { + var _a, _b; + const destinationStat = opts.didParentExist ? await maybeLStat(destinationFs, destination) : null; + const sourceStat = await sourceFs.lstatPromise(source); + const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : sourceStat; + let updated; + switch (true) { + case sourceStat.isDirectory(): + { + updated = await copyFolder(prelayout, postlayout, updateTime, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); + } + break; + case sourceStat.isFile(): + { + updated = await copyFile(prelayout, postlayout, updateTime, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); + } + break; + case sourceStat.isSymbolicLink(): + { + updated = await copySymlink(prelayout, postlayout, updateTime, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); + } + break; + default: + { + throw new Error(`Unsupported file type (${sourceStat.mode})`); + } + } + if (updated || ((_a = destinationStat == null ? void 0 : destinationStat.mtime) == null ? void 0 : _a.getTime()) !== mtime.getTime() || ((_b = destinationStat == null ? void 0 : destinationStat.atime) == null ? void 0 : _b.getTime()) !== atime.getTime()) { + postlayout.push(() => updateTime(destination, atime, mtime)); + updated = true; + } + if (destinationStat === null || (destinationStat.mode & 511) !== (sourceStat.mode & 511)) { + postlayout.push(() => destinationFs.chmodPromise(destination, sourceStat.mode & 511)); + updated = true; + } + return updated; +} +async function maybeLStat(baseFs, p) { + try { + return await baseFs.lstatPromise(p); + } catch (e) { + return null; + } +} +async function copyFolder(prelayout, postlayout, updateTime, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { + if (destinationStat !== null && !destinationStat.isDirectory()) { + if (opts.overwrite) { + prelayout.push(async () => destinationFs.removePromise(destination)); + destinationStat = null; + } else { + return false; + } + } + let updated = false; + if (destinationStat === null) { + prelayout.push(async () => { + try { + await destinationFs.mkdirPromise(destination, { mode: sourceStat.mode }); + } catch (err) { + if (err.code !== `EEXIST`) { + throw err; + } + } + }); + updated = true; + } + const entries = await sourceFs.readdirPromise(source); + const nextOpts = opts.didParentExist && !destinationStat ? { ...opts, didParentExist: false } : opts; + if (opts.stableSort) { + for (const entry of entries.sort()) { + if (await copyImpl(prelayout, postlayout, updateTime, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts)) { + updated = true; + } + } + } else { + const entriesUpdateStatus = await Promise.all(entries.map(async (entry) => { + await copyImpl(prelayout, postlayout, updateTime, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts); + })); + if (entriesUpdateStatus.some((status) => status)) { + updated = true; + } + } + return updated; +} +const isCloneSupportedCache = /* @__PURE__ */ new WeakMap(); +function makeLinkOperation(opFs, destination, source, sourceStat, linkStrategy) { + return async () => { + await opFs.linkPromise(source, destination); + if (linkStrategy === "readOnly" /* ReadOnly */) { + sourceStat.mode &= ~146; + await opFs.chmodPromise(destination, sourceStat.mode); + } + }; +} +function makeCloneLinkOperation(opFs, destination, source, sourceStat, linkStrategy) { + const isCloneSupported = isCloneSupportedCache.get(opFs); + if (typeof isCloneSupported === `undefined`) { + return async () => { + try { + await opFs.copyFilePromise(source, destination, fs__default.default.constants.COPYFILE_FICLONE_FORCE); + isCloneSupportedCache.set(opFs, true); + } catch (err) { + if (err.code === `ENOSYS` || err.code === `ENOTSUP`) { + isCloneSupportedCache.set(opFs, false); + await makeLinkOperation(opFs, destination, source, sourceStat, linkStrategy)(); + } else { + throw err; + } + } + }; + } else { + if (isCloneSupported) { + return async () => opFs.copyFilePromise(source, destination, fs__default.default.constants.COPYFILE_FICLONE_FORCE); + } else { + return makeLinkOperation(opFs, destination, source, sourceStat, linkStrategy); + } + } +} +async function copyFile(prelayout, postlayout, updateTime, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { + var _a; + if (destinationStat !== null) { + if (opts.overwrite) { + prelayout.push(async () => destinationFs.removePromise(destination)); + destinationStat = null; + } else { + return false; + } + } + const linkStrategy = (_a = opts.linkStrategy) != null ? _a : null; + const op = destinationFs === sourceFs ? linkStrategy !== null ? makeCloneLinkOperation(destinationFs, destination, source, sourceStat, linkStrategy) : async () => destinationFs.copyFilePromise(source, destination, fs__default.default.constants.COPYFILE_FICLONE) : linkStrategy !== null ? makeLinkOperation(destinationFs, destination, source, sourceStat, linkStrategy) : async () => destinationFs.writeFilePromise(destination, await sourceFs.readFilePromise(source)); + prelayout.push(async () => op()); + return true; +} +async function copySymlink(prelayout, postlayout, updateTime, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { + if (destinationStat !== null) { + if (opts.overwrite) { + prelayout.push(async () => destinationFs.removePromise(destination)); + destinationStat = null; + } else { + return false; + } + } + prelayout.push(async () => { + await destinationFs.symlinkPromise(convertPath(destinationFs.pathUtils, await sourceFs.readlinkPromise(source)), destination); + }); + return true; +} + +function makeError$1(code, message) { + return Object.assign(new Error(`${code}: ${message}`), { code }); +} +function EBUSY(message) { + return makeError$1(`EBUSY`, message); +} +function ENOSYS(message, reason) { + return makeError$1(`ENOSYS`, `${message}, ${reason}`); +} +function EINVAL(reason) { + return makeError$1(`EINVAL`, `invalid argument, ${reason}`); +} +function EBADF(reason) { + return makeError$1(`EBADF`, `bad file descriptor, ${reason}`); +} +function ENOENT(reason) { + return makeError$1(`ENOENT`, `no such file or directory, ${reason}`); +} +function ENOTDIR(reason) { + return makeError$1(`ENOTDIR`, `not a directory, ${reason}`); +} +function EISDIR(reason) { + return makeError$1(`EISDIR`, `illegal operation on a directory, ${reason}`); +} +function EEXIST(reason) { + return makeError$1(`EEXIST`, `file already exists, ${reason}`); +} +function EROFS(reason) { + return makeError$1(`EROFS`, `read-only filesystem, ${reason}`); +} +function ENOTEMPTY(reason) { + return makeError$1(`ENOTEMPTY`, `directory not empty, ${reason}`); +} +function EOPNOTSUPP(reason) { + return makeError$1(`EOPNOTSUPP`, `operation not supported, ${reason}`); +} +function ERR_DIR_CLOSED() { + return makeError$1(`ERR_DIR_CLOSED`, `Directory handle was closed`); +} +class LibzipError extends Error { + constructor(message, code) { + super(message); + this.name = `Libzip Error`; + this.code = code; + } +} + +class CustomDir { + constructor(path, nextDirent, opts = {}) { + this.path = path; + this.nextDirent = nextDirent; + this.opts = opts; + this.closed = false; + } + throwIfClosed() { + if (this.closed) { + throw ERR_DIR_CLOSED(); + } + } + async *[Symbol.asyncIterator]() { + try { + let dirent; + while ((dirent = await this.read()) !== null) { + yield dirent; + } + } finally { + await this.close(); + } + } + read(cb) { + const dirent = this.readSync(); + if (typeof cb !== `undefined`) + return cb(null, dirent); + return Promise.resolve(dirent); + } + readSync() { + this.throwIfClosed(); + return this.nextDirent(); + } + close(cb) { + this.closeSync(); + if (typeof cb !== `undefined`) + return cb(null); + return Promise.resolve(); + } + closeSync() { + var _a, _b; + this.throwIfClosed(); + (_b = (_a = this.opts).onClose) == null ? void 0 : _b.call(_a); + this.closed = true; + } +} +function opendir(fakeFs, path, entries, opts) { + const nextDirent = () => { + const filename = entries.shift(); + if (typeof filename === `undefined`) + return null; + return Object.assign(fakeFs.statSync(fakeFs.pathUtils.join(path, filename)), { + name: filename + }); + }; + return new CustomDir(path, nextDirent, opts); +} + +class FakeFS { + constructor(pathUtils) { + this.pathUtils = pathUtils; + } + async *genTraversePromise(init, { stableSort = false } = {}) { + const stack = [init]; + while (stack.length > 0) { + const p = stack.shift(); + const entry = await this.lstatPromise(p); + if (entry.isDirectory()) { + const entries = await this.readdirPromise(p); + if (stableSort) { + for (const entry2 of entries.sort()) { + stack.push(this.pathUtils.join(p, entry2)); + } + } else { + throw new Error(`Not supported`); + } + } else { + yield p; + } + } + } + async removePromise(p, { recursive = true, maxRetries = 5 } = {}) { + let stat; + try { + stat = await this.lstatPromise(p); + } catch (error) { + if (error.code === `ENOENT`) { + return; + } else { + throw error; + } + } + if (stat.isDirectory()) { + if (recursive) { + const entries = await this.readdirPromise(p); + await Promise.all(entries.map((entry) => { + return this.removePromise(this.pathUtils.resolve(p, entry)); + })); + } + for (let t = 0; t <= maxRetries; t++) { + try { + await this.rmdirPromise(p); + break; + } catch (error) { + if (error.code !== `EBUSY` && error.code !== `ENOTEMPTY`) { + throw error; + } else if (t < maxRetries) { + await new Promise((resolve) => setTimeout(resolve, t * 100)); + } + } + } + } else { + await this.unlinkPromise(p); + } + } + removeSync(p, { recursive = true } = {}) { + let stat; + try { + stat = this.lstatSync(p); + } catch (error) { + if (error.code === `ENOENT`) { + return; + } else { + throw error; + } + } + if (stat.isDirectory()) { + if (recursive) + for (const entry of this.readdirSync(p)) + this.removeSync(this.pathUtils.resolve(p, entry)); + this.rmdirSync(p); + } else { + this.unlinkSync(p); + } + } + async mkdirpPromise(p, { chmod, utimes } = {}) { + p = this.resolve(p); + if (p === this.pathUtils.dirname(p)) + return void 0; + const parts = p.split(this.pathUtils.sep); + let createdDirectory; + for (let u = 2; u <= parts.length; ++u) { + const subPath = parts.slice(0, u).join(this.pathUtils.sep); + if (!this.existsSync(subPath)) { + try { + await this.mkdirPromise(subPath); + } catch (error) { + if (error.code === `EEXIST`) { + continue; + } else { + throw error; + } + } + createdDirectory != null ? createdDirectory : createdDirectory = subPath; + if (chmod != null) + await this.chmodPromise(subPath, chmod); + if (utimes != null) { + await this.utimesPromise(subPath, utimes[0], utimes[1]); + } else { + const parentStat = await this.statPromise(this.pathUtils.dirname(subPath)); + await this.utimesPromise(subPath, parentStat.atime, parentStat.mtime); + } + } + } + return createdDirectory; + } + mkdirpSync(p, { chmod, utimes } = {}) { + p = this.resolve(p); + if (p === this.pathUtils.dirname(p)) + return void 0; + const parts = p.split(this.pathUtils.sep); + let createdDirectory; + for (let u = 2; u <= parts.length; ++u) { + const subPath = parts.slice(0, u).join(this.pathUtils.sep); + if (!this.existsSync(subPath)) { + try { + this.mkdirSync(subPath); + } catch (error) { + if (error.code === `EEXIST`) { + continue; + } else { + throw error; + } + } + createdDirectory != null ? createdDirectory : createdDirectory = subPath; + if (chmod != null) + this.chmodSync(subPath, chmod); + if (utimes != null) { + this.utimesSync(subPath, utimes[0], utimes[1]); + } else { + const parentStat = this.statSync(this.pathUtils.dirname(subPath)); + this.utimesSync(subPath, parentStat.atime, parentStat.mtime); + } + } + } + return createdDirectory; + } + async copyPromise(destination, source, { baseFs = this, overwrite = true, stableSort = false, stableTime = false, linkStrategy = null } = {}) { + return await copyPromise(this, destination, baseFs, source, { overwrite, stableSort, stableTime, linkStrategy }); + } + copySync(destination, source, { baseFs = this, overwrite = true } = {}) { + const stat = baseFs.lstatSync(source); + const exists = this.existsSync(destination); + if (stat.isDirectory()) { + this.mkdirpSync(destination); + const directoryListing = baseFs.readdirSync(source); + for (const entry of directoryListing) { + this.copySync(this.pathUtils.join(destination, entry), baseFs.pathUtils.join(source, entry), { baseFs, overwrite }); + } + } else if (stat.isFile()) { + if (!exists || overwrite) { + if (exists) + this.removeSync(destination); + const content = baseFs.readFileSync(source); + this.writeFileSync(destination, content); + } + } else if (stat.isSymbolicLink()) { + if (!exists || overwrite) { + if (exists) + this.removeSync(destination); + const target = baseFs.readlinkSync(source); + this.symlinkSync(convertPath(this.pathUtils, target), destination); + } + } else { + throw new Error(`Unsupported file type (file: ${source}, mode: 0o${stat.mode.toString(8).padStart(6, `0`)})`); + } + const mode = stat.mode & 511; + this.chmodSync(destination, mode); + } + async changeFilePromise(p, content, opts = {}) { + if (Buffer.isBuffer(content)) { + return this.changeFileBufferPromise(p, content, opts); + } else { + return this.changeFileTextPromise(p, content, opts); + } + } + async changeFileBufferPromise(p, content, { mode } = {}) { + let current = Buffer.alloc(0); + try { + current = await this.readFilePromise(p); + } catch (error) { + } + if (Buffer.compare(current, content) === 0) + return; + await this.writeFilePromise(p, content, { mode }); + } + async changeFileTextPromise(p, content, { automaticNewlines, mode } = {}) { + let current = ``; + try { + current = await this.readFilePromise(p, `utf8`); + } catch (error) { + } + const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; + if (current === normalizedContent) + return; + await this.writeFilePromise(p, normalizedContent, { mode }); + } + changeFileSync(p, content, opts = {}) { + if (Buffer.isBuffer(content)) { + return this.changeFileBufferSync(p, content, opts); + } else { + return this.changeFileTextSync(p, content, opts); + } + } + changeFileBufferSync(p, content, { mode } = {}) { + let current = Buffer.alloc(0); + try { + current = this.readFileSync(p); + } catch (error) { + } + if (Buffer.compare(current, content) === 0) + return; + this.writeFileSync(p, content, { mode }); + } + changeFileTextSync(p, content, { automaticNewlines = false, mode } = {}) { + let current = ``; + try { + current = this.readFileSync(p, `utf8`); + } catch (error) { + } + const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; + if (current === normalizedContent) + return; + this.writeFileSync(p, normalizedContent, { mode }); + } + async movePromise(fromP, toP) { + try { + await this.renamePromise(fromP, toP); + } catch (error) { + if (error.code === `EXDEV`) { + await this.copyPromise(toP, fromP); + await this.removePromise(fromP); + } else { + throw error; + } + } + } + moveSync(fromP, toP) { + try { + this.renameSync(fromP, toP); + } catch (error) { + if (error.code === `EXDEV`) { + this.copySync(toP, fromP); + this.removeSync(fromP); + } else { + throw error; + } + } + } + async lockPromise(affectedPath, callback) { + const lockPath = `${affectedPath}.flock`; + const interval = 1e3 / 60; + const startTime = Date.now(); + let fd = null; + const isAlive = async () => { + let pid; + try { + [pid] = await this.readJsonPromise(lockPath); + } catch (error) { + return Date.now() - startTime < 500; + } + try { + process.kill(pid, 0); + return true; + } catch (error) { + return false; + } + }; + while (fd === null) { + try { + fd = await this.openPromise(lockPath, `wx`); + } catch (error) { + if (error.code === `EEXIST`) { + if (!await isAlive()) { + try { + await this.unlinkPromise(lockPath); + continue; + } catch (error2) { + } + } + if (Date.now() - startTime < 60 * 1e3) { + await new Promise((resolve) => setTimeout(resolve, interval)); + } else { + throw new Error(`Couldn't acquire a lock in a reasonable time (via ${lockPath})`); + } + } else { + throw error; + } + } + } + await this.writePromise(fd, JSON.stringify([process.pid])); + try { + return await callback(); + } finally { + try { + await this.closePromise(fd); + await this.unlinkPromise(lockPath); + } catch (error) { + } + } + } + async readJsonPromise(p) { + const content = await this.readFilePromise(p, `utf8`); + try { + return JSON.parse(content); + } catch (error) { + error.message += ` (in ${p})`; + throw error; + } + } + readJsonSync(p) { + const content = this.readFileSync(p, `utf8`); + try { + return JSON.parse(content); + } catch (error) { + error.message += ` (in ${p})`; + throw error; + } + } + async writeJsonPromise(p, data) { + return await this.writeFilePromise(p, `${JSON.stringify(data, null, 2)} +`); + } + writeJsonSync(p, data) { + return this.writeFileSync(p, `${JSON.stringify(data, null, 2)} +`); + } + async preserveTimePromise(p, cb) { + const stat = await this.lstatPromise(p); + const result = await cb(); + if (typeof result !== `undefined`) + p = result; + if (this.lutimesPromise) { + await this.lutimesPromise(p, stat.atime, stat.mtime); + } else if (!stat.isSymbolicLink()) { + await this.utimesPromise(p, stat.atime, stat.mtime); + } + } + async preserveTimeSync(p, cb) { + const stat = this.lstatSync(p); + const result = cb(); + if (typeof result !== `undefined`) + p = result; + if (this.lutimesSync) { + this.lutimesSync(p, stat.atime, stat.mtime); + } else if (!stat.isSymbolicLink()) { + this.utimesSync(p, stat.atime, stat.mtime); + } + } +} +class BasePortableFakeFS extends FakeFS { + constructor() { + super(ppath); + } +} +function getEndOfLine(content) { + const matches = content.match(/\r?\n/g); + if (matches === null) + return os.EOL; + const crlf = matches.filter((nl) => nl === `\r +`).length; + const lf = matches.length - crlf; + return crlf > lf ? `\r +` : ` +`; +} +function normalizeLineEndings(originalContent, newContent) { + return newContent.replace(/\r?\n/g, getEndOfLine(originalContent)); +} + +class NodeFS extends BasePortableFakeFS { + constructor(realFs = fs__default.default) { + super(); + this.realFs = realFs; + if (typeof this.realFs.lutimes !== `undefined`) { + this.lutimesPromise = this.lutimesPromiseImpl; + this.lutimesSync = this.lutimesSyncImpl; + } + } + getExtractHint() { + return false; + } + getRealPath() { + return PortablePath.root; + } + resolve(p) { + return ppath.resolve(p); + } + async openPromise(p, flags, mode) { + return await new Promise((resolve, reject) => { + this.realFs.open(npath.fromPortablePath(p), flags, mode, this.makeCallback(resolve, reject)); + }); + } + openSync(p, flags, mode) { + return this.realFs.openSync(npath.fromPortablePath(p), flags, mode); + } + async opendirPromise(p, opts) { + return await new Promise((resolve, reject) => { + if (typeof opts !== `undefined`) { + this.realFs.opendir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + } + }).then((dir) => { + return Object.defineProperty(dir, `path`, { value: p, configurable: true, writable: true }); + }); + } + opendirSync(p, opts) { + const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p)); + return Object.defineProperty(dir, `path`, { value: p, configurable: true, writable: true }); + } + async readPromise(fd, buffer, offset = 0, length = 0, position = -1) { + return await new Promise((resolve, reject) => { + this.realFs.read(fd, buffer, offset, length, position, (error, bytesRead) => { + if (error) { + reject(error); + } else { + resolve(bytesRead); + } + }); + }); + } + readSync(fd, buffer, offset, length, position) { + return this.realFs.readSync(fd, buffer, offset, length, position); + } + async writePromise(fd, buffer, offset, length, position) { + return await new Promise((resolve, reject) => { + if (typeof buffer === `string`) { + return this.realFs.write(fd, buffer, offset, this.makeCallback(resolve, reject)); + } else { + return this.realFs.write(fd, buffer, offset, length, position, this.makeCallback(resolve, reject)); + } + }); + } + writeSync(fd, buffer, offset, length, position) { + if (typeof buffer === `string`) { + return this.realFs.writeSync(fd, buffer, offset); + } else { + return this.realFs.writeSync(fd, buffer, offset, length, position); + } + } + async closePromise(fd) { + await new Promise((resolve, reject) => { + this.realFs.close(fd, this.makeCallback(resolve, reject)); + }); + } + closeSync(fd) { + this.realFs.closeSync(fd); + } + createReadStream(p, opts) { + const realPath = p !== null ? npath.fromPortablePath(p) : p; + return this.realFs.createReadStream(realPath, opts); + } + createWriteStream(p, opts) { + const realPath = p !== null ? npath.fromPortablePath(p) : p; + return this.realFs.createWriteStream(realPath, opts); + } + async realpathPromise(p) { + return await new Promise((resolve, reject) => { + this.realFs.realpath(npath.fromPortablePath(p), {}, this.makeCallback(resolve, reject)); + }).then((path) => { + return npath.toPortablePath(path); + }); + } + realpathSync(p) { + return npath.toPortablePath(this.realFs.realpathSync(npath.fromPortablePath(p), {})); + } + async existsPromise(p) { + return await new Promise((resolve) => { + this.realFs.exists(npath.fromPortablePath(p), resolve); + }); + } + accessSync(p, mode) { + return this.realFs.accessSync(npath.fromPortablePath(p), mode); + } + async accessPromise(p, mode) { + return await new Promise((resolve, reject) => { + this.realFs.access(npath.fromPortablePath(p), mode, this.makeCallback(resolve, reject)); + }); + } + existsSync(p) { + return this.realFs.existsSync(npath.fromPortablePath(p)); + } + async statPromise(p, opts) { + return await new Promise((resolve, reject) => { + if (opts) { + this.realFs.stat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.stat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + } + }); + } + statSync(p, opts) { + if (opts) { + return this.realFs.statSync(npath.fromPortablePath(p), opts); + } else { + return this.realFs.statSync(npath.fromPortablePath(p)); + } + } + async fstatPromise(fd, opts) { + return await new Promise((resolve, reject) => { + if (opts) { + this.realFs.fstat(fd, opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.fstat(fd, this.makeCallback(resolve, reject)); + } + }); + } + fstatSync(fd, opts) { + if (opts) { + return this.realFs.fstatSync(fd, opts); + } else { + return this.realFs.fstatSync(fd); + } + } + async lstatPromise(p, opts) { + return await new Promise((resolve, reject) => { + if (opts) { + this.realFs.lstat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.lstat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + } + }); + } + lstatSync(p, opts) { + if (opts) { + return this.realFs.lstatSync(npath.fromPortablePath(p), opts); + } else { + return this.realFs.lstatSync(npath.fromPortablePath(p)); + } + } + async fchmodPromise(fd, mask) { + return await new Promise((resolve, reject) => { + this.realFs.fchmod(fd, mask, this.makeCallback(resolve, reject)); + }); + } + fchmodSync(fd, mask) { + return this.realFs.fchmodSync(fd, mask); + } + async chmodPromise(p, mask) { + return await new Promise((resolve, reject) => { + this.realFs.chmod(npath.fromPortablePath(p), mask, this.makeCallback(resolve, reject)); + }); + } + chmodSync(p, mask) { + return this.realFs.chmodSync(npath.fromPortablePath(p), mask); + } + async fchownPromise(fd, uid, gid) { + return await new Promise((resolve, reject) => { + this.realFs.fchown(fd, uid, gid, this.makeCallback(resolve, reject)); + }); + } + fchownSync(fd, uid, gid) { + return this.realFs.fchownSync(fd, uid, gid); + } + async chownPromise(p, uid, gid) { + return await new Promise((resolve, reject) => { + this.realFs.chown(npath.fromPortablePath(p), uid, gid, this.makeCallback(resolve, reject)); + }); + } + chownSync(p, uid, gid) { + return this.realFs.chownSync(npath.fromPortablePath(p), uid, gid); + } + async renamePromise(oldP, newP) { + return await new Promise((resolve, reject) => { + this.realFs.rename(npath.fromPortablePath(oldP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); + }); + } + renameSync(oldP, newP) { + return this.realFs.renameSync(npath.fromPortablePath(oldP), npath.fromPortablePath(newP)); + } + async copyFilePromise(sourceP, destP, flags = 0) { + return await new Promise((resolve, reject) => { + this.realFs.copyFile(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags, this.makeCallback(resolve, reject)); + }); + } + copyFileSync(sourceP, destP, flags = 0) { + return this.realFs.copyFileSync(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags); + } + async appendFilePromise(p, content, opts) { + return await new Promise((resolve, reject) => { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + if (opts) { + this.realFs.appendFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.appendFile(fsNativePath, content, this.makeCallback(resolve, reject)); + } + }); + } + appendFileSync(p, content, opts) { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + if (opts) { + this.realFs.appendFileSync(fsNativePath, content, opts); + } else { + this.realFs.appendFileSync(fsNativePath, content); + } + } + async writeFilePromise(p, content, opts) { + return await new Promise((resolve, reject) => { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + if (opts) { + this.realFs.writeFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.writeFile(fsNativePath, content, this.makeCallback(resolve, reject)); + } + }); + } + writeFileSync(p, content, opts) { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + if (opts) { + this.realFs.writeFileSync(fsNativePath, content, opts); + } else { + this.realFs.writeFileSync(fsNativePath, content); + } + } + async unlinkPromise(p) { + return await new Promise((resolve, reject) => { + this.realFs.unlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + }); + } + unlinkSync(p) { + return this.realFs.unlinkSync(npath.fromPortablePath(p)); + } + async utimesPromise(p, atime, mtime) { + return await new Promise((resolve, reject) => { + this.realFs.utimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); + }); + } + utimesSync(p, atime, mtime) { + this.realFs.utimesSync(npath.fromPortablePath(p), atime, mtime); + } + async lutimesPromiseImpl(p, atime, mtime) { + const lutimes = this.realFs.lutimes; + if (typeof lutimes === `undefined`) + throw ENOSYS(`unavailable Node binding`, `lutimes '${p}'`); + return await new Promise((resolve, reject) => { + lutimes.call(this.realFs, npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); + }); + } + lutimesSyncImpl(p, atime, mtime) { + const lutimesSync = this.realFs.lutimesSync; + if (typeof lutimesSync === `undefined`) + throw ENOSYS(`unavailable Node binding`, `lutimes '${p}'`); + lutimesSync.call(this.realFs, npath.fromPortablePath(p), atime, mtime); + } + async mkdirPromise(p, opts) { + return await new Promise((resolve, reject) => { + this.realFs.mkdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); + }); + } + mkdirSync(p, opts) { + return this.realFs.mkdirSync(npath.fromPortablePath(p), opts); + } + async rmdirPromise(p, opts) { + return await new Promise((resolve, reject) => { + if (opts) { + this.realFs.rmdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.rmdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + } + }); + } + rmdirSync(p, opts) { + return this.realFs.rmdirSync(npath.fromPortablePath(p), opts); + } + async linkPromise(existingP, newP) { + return await new Promise((resolve, reject) => { + this.realFs.link(npath.fromPortablePath(existingP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); + }); + } + linkSync(existingP, newP) { + return this.realFs.linkSync(npath.fromPortablePath(existingP), npath.fromPortablePath(newP)); + } + async symlinkPromise(target, p, type) { + return await new Promise((resolve, reject) => { + this.realFs.symlink(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type, this.makeCallback(resolve, reject)); + }); + } + symlinkSync(target, p, type) { + return this.realFs.symlinkSync(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type); + } + async readFilePromise(p, encoding) { + return await new Promise((resolve, reject) => { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + this.realFs.readFile(fsNativePath, encoding, this.makeCallback(resolve, reject)); + }); + } + readFileSync(p, encoding) { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + return this.realFs.readFileSync(fsNativePath, encoding); + } + async readdirPromise(p, opts) { + return await new Promise((resolve, reject) => { + if (opts == null ? void 0 : opts.withFileTypes) { + this.realFs.readdir(npath.fromPortablePath(p), { withFileTypes: true }, this.makeCallback(resolve, reject)); + } else { + this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback((value) => resolve(value), reject)); + } + }); + } + readdirSync(p, opts) { + if (opts == null ? void 0 : opts.withFileTypes) { + return this.realFs.readdirSync(npath.fromPortablePath(p), { withFileTypes: true }); + } else { + return this.realFs.readdirSync(npath.fromPortablePath(p)); + } + } + async readlinkPromise(p) { + return await new Promise((resolve, reject) => { + this.realFs.readlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + }).then((path) => { + return npath.toPortablePath(path); + }); + } + readlinkSync(p) { + return npath.toPortablePath(this.realFs.readlinkSync(npath.fromPortablePath(p))); + } + async truncatePromise(p, len) { + return await new Promise((resolve, reject) => { + this.realFs.truncate(npath.fromPortablePath(p), len, this.makeCallback(resolve, reject)); + }); + } + truncateSync(p, len) { + return this.realFs.truncateSync(npath.fromPortablePath(p), len); + } + async ftruncatePromise(fd, len) { + return await new Promise((resolve, reject) => { + this.realFs.ftruncate(fd, len, this.makeCallback(resolve, reject)); + }); + } + ftruncateSync(fd, len) { + return this.realFs.ftruncateSync(fd, len); + } + watch(p, a, b) { + return this.realFs.watch( + npath.fromPortablePath(p), + a, + b + ); + } + watchFile(p, a, b) { + return this.realFs.watchFile( + npath.fromPortablePath(p), + a, + b + ); + } + unwatchFile(p, cb) { + return this.realFs.unwatchFile(npath.fromPortablePath(p), cb); + } + makeCallback(resolve, reject) { + return (err, result) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }; + } +} + +function assertStatus(current, expected) { + if (current !== expected) { + throw new Error(`Invalid StatWatcher status: expected '${expected}', got '${current}'`); + } +} +class CustomStatWatcher extends events.EventEmitter { + constructor(fakeFs, path, { bigint = false } = {}) { + super(); + this.status = "ready" /* Ready */; + this.changeListeners = /* @__PURE__ */ new Map(); + this.startTimeout = null; + this.fakeFs = fakeFs; + this.path = path; + this.bigint = bigint; + this.lastStats = this.stat(); + } + static create(fakeFs, path, opts) { + const statWatcher = new CustomStatWatcher(fakeFs, path, opts); + statWatcher.start(); + return statWatcher; + } + start() { + assertStatus(this.status, "ready" /* Ready */); + this.status = "running" /* Running */; + this.startTimeout = setTimeout(() => { + this.startTimeout = null; + if (!this.fakeFs.existsSync(this.path)) { + this.emit("change" /* Change */, this.lastStats, this.lastStats); + } + }, 3); + } + stop() { + assertStatus(this.status, "running" /* Running */); + this.status = "stopped" /* Stopped */; + if (this.startTimeout !== null) { + clearTimeout(this.startTimeout); + this.startTimeout = null; + } + this.emit("stop" /* Stop */); + } + stat() { + try { + return this.fakeFs.statSync(this.path, { bigint: this.bigint }); + } catch (error) { + const statInstance = this.bigint ? new BigIntStatsEntry() : new StatEntry(); + return clearStats(statInstance); + } + } + makeInterval(opts) { + const interval = setInterval(() => { + const currentStats = this.stat(); + const previousStats = this.lastStats; + if (areStatsEqual(currentStats, previousStats)) + return; + this.lastStats = currentStats; + this.emit("change" /* Change */, currentStats, previousStats); + }, opts.interval); + return opts.persistent ? interval : interval.unref(); + } + registerChangeListener(listener, opts) { + this.addListener("change" /* Change */, listener); + this.changeListeners.set(listener, this.makeInterval(opts)); + } + unregisterChangeListener(listener) { + this.removeListener("change" /* Change */, listener); + const interval = this.changeListeners.get(listener); + if (typeof interval !== `undefined`) + clearInterval(interval); + this.changeListeners.delete(listener); + } + unregisterAllChangeListeners() { + for (const listener of this.changeListeners.keys()) { + this.unregisterChangeListener(listener); + } + } + hasChangeListeners() { + return this.changeListeners.size > 0; + } + ref() { + for (const interval of this.changeListeners.values()) + interval.ref(); + return this; + } + unref() { + for (const interval of this.changeListeners.values()) + interval.unref(); + return this; + } +} + +const statWatchersByFakeFS = /* @__PURE__ */ new WeakMap(); +function watchFile(fakeFs, path, a, b) { + let bigint; + let persistent; + let interval; + let listener; + switch (typeof a) { + case `function`: + { + bigint = false; + persistent = true; + interval = 5007; + listener = a; + } + break; + default: + { + ({ + bigint = false, + persistent = true, + interval = 5007 + } = a); + listener = b; + } + break; + } + let statWatchers = statWatchersByFakeFS.get(fakeFs); + if (typeof statWatchers === `undefined`) + statWatchersByFakeFS.set(fakeFs, statWatchers = /* @__PURE__ */ new Map()); + let statWatcher = statWatchers.get(path); + if (typeof statWatcher === `undefined`) { + statWatcher = CustomStatWatcher.create(fakeFs, path, { bigint }); + statWatchers.set(path, statWatcher); + } + statWatcher.registerChangeListener(listener, { persistent, interval }); + return statWatcher; +} +function unwatchFile(fakeFs, path, cb) { + const statWatchers = statWatchersByFakeFS.get(fakeFs); + if (typeof statWatchers === `undefined`) + return; + const statWatcher = statWatchers.get(path); + if (typeof statWatcher === `undefined`) + return; + if (typeof cb === `undefined`) + statWatcher.unregisterAllChangeListeners(); + else + statWatcher.unregisterChangeListener(cb); + if (!statWatcher.hasChangeListeners()) { + statWatcher.stop(); + statWatchers.delete(path); + } +} +function unwatchAllFiles(fakeFs) { + const statWatchers = statWatchersByFakeFS.get(fakeFs); + if (typeof statWatchers === `undefined`) + return; + for (const path of statWatchers.keys()) { + unwatchFile(fakeFs, path); + } +} + +const DEFAULT_COMPRESSION_LEVEL = `mixed`; +function toUnixTimestamp(time) { + if (typeof time === `string` && String(+time) === time) + return +time; + if (Number.isFinite(time)) { + if (time < 0) { + return Date.now() / 1e3; + } else { + return time; + } + } + if (nodeUtils.types.isDate(time)) + return time.getTime() / 1e3; + throw new Error(`Invalid time`); +} +function makeEmptyArchive() { + return Buffer.from([ + 80, + 75, + 5, + 6, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ]); +} +class ZipFS extends BasePortableFakeFS { + constructor(source, opts) { + super(); + this.lzSource = null; + this.listings = /* @__PURE__ */ new Map(); + this.entries = /* @__PURE__ */ new Map(); + this.fileSources = /* @__PURE__ */ new Map(); + this.fds = /* @__PURE__ */ new Map(); + this.nextFd = 0; + this.ready = false; + this.readOnly = false; + this.libzip = opts.libzip; + const pathOptions = opts; + this.level = typeof pathOptions.level !== `undefined` ? pathOptions.level : DEFAULT_COMPRESSION_LEVEL; + source != null ? source : source = makeEmptyArchive(); + if (typeof source === `string`) { + const { baseFs = new NodeFS() } = pathOptions; + this.baseFs = baseFs; + this.path = source; + } else { + this.path = null; + this.baseFs = null; + } + if (opts.stats) { + this.stats = opts.stats; + } else { + if (typeof source === `string`) { + try { + this.stats = this.baseFs.statSync(source); + } catch (error) { + if (error.code === `ENOENT` && pathOptions.create) { + this.stats = makeDefaultStats(); + } else { + throw error; + } + } + } else { + this.stats = makeDefaultStats(); + } + } + const errPtr = this.libzip.malloc(4); + try { + let flags = 0; + if (typeof source === `string` && pathOptions.create) + flags |= this.libzip.ZIP_CREATE | this.libzip.ZIP_TRUNCATE; + if (opts.readOnly) { + flags |= this.libzip.ZIP_RDONLY; + this.readOnly = true; + } + if (typeof source === `string`) { + this.zip = this.libzip.open(npath.fromPortablePath(source), flags, errPtr); + } else { + const lzSource = this.allocateUnattachedSource(source); + try { + this.zip = this.libzip.openFromSource(lzSource, flags, errPtr); + this.lzSource = lzSource; + } catch (error) { + this.libzip.source.free(lzSource); + throw error; + } + } + if (this.zip === 0) { + const error = this.libzip.struct.errorS(); + this.libzip.error.initWithCode(error, this.libzip.getValue(errPtr, `i32`)); + throw this.makeLibzipError(error); + } + } finally { + this.libzip.free(errPtr); + } + this.listings.set(PortablePath.root, /* @__PURE__ */ new Set()); + const entryCount = this.libzip.getNumEntries(this.zip, 0); + for (let t = 0; t < entryCount; ++t) { + const raw = this.libzip.getName(this.zip, t, 0); + if (ppath.isAbsolute(raw)) + continue; + const p = ppath.resolve(PortablePath.root, raw); + this.registerEntry(p, t); + if (raw.endsWith(`/`)) { + this.registerListing(p); + } + } + this.symlinkCount = this.libzip.ext.countSymlinks(this.zip); + if (this.symlinkCount === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + this.ready = true; + } + makeLibzipError(error) { + const errorCode = this.libzip.struct.errorCodeZip(error); + const strerror = this.libzip.error.strerror(error); + const libzipError = new LibzipError(strerror, this.libzip.errors[errorCode]); + if (errorCode === this.libzip.errors.ZIP_ER_CHANGED) + throw new Error(`Assertion failed: Unexpected libzip error: ${libzipError.message}`); + return libzipError; + } + getExtractHint(hints) { + for (const fileName of this.entries.keys()) { + const ext = this.pathUtils.extname(fileName); + if (hints.relevantExtensions.has(ext)) { + return true; + } + } + return false; + } + getAllFiles() { + return Array.from(this.entries.keys()); + } + getRealPath() { + if (!this.path) + throw new Error(`ZipFS don't have real paths when loaded from a buffer`); + return this.path; + } + getBufferAndClose() { + this.prepareClose(); + if (!this.lzSource) + throw new Error(`ZipFS was not created from a Buffer`); + if (this.entries.size === 0) { + this.discardAndClose(); + return makeEmptyArchive(); + } + try { + this.libzip.source.keep(this.lzSource); + if (this.libzip.close(this.zip) === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + if (this.libzip.source.open(this.lzSource) === -1) + throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); + if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_END) === -1) + throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); + const size = this.libzip.source.tell(this.lzSource); + if (size === -1) + throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); + if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_SET) === -1) + throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); + const buffer = this.libzip.malloc(size); + if (!buffer) + throw new Error(`Couldn't allocate enough memory`); + try { + const rc = this.libzip.source.read(this.lzSource, buffer, size); + if (rc === -1) + throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); + else if (rc < size) + throw new Error(`Incomplete read`); + else if (rc > size) + throw new Error(`Overread`); + const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); + return Buffer.from(memory); + } finally { + this.libzip.free(buffer); + } + } finally { + this.libzip.source.close(this.lzSource); + this.libzip.source.free(this.lzSource); + this.ready = false; + } + } + prepareClose() { + if (!this.ready) + throw EBUSY(`archive closed, close`); + unwatchAllFiles(this); + } + saveAndClose() { + if (!this.path || !this.baseFs) + throw new Error(`ZipFS cannot be saved and must be discarded when loaded from a buffer`); + this.prepareClose(); + if (this.readOnly) { + this.discardAndClose(); + return; + } + const newMode = this.baseFs.existsSync(this.path) || this.stats.mode === DEFAULT_MODE ? void 0 : this.stats.mode; + if (this.entries.size === 0) { + this.discardAndClose(); + this.baseFs.writeFileSync(this.path, makeEmptyArchive(), { mode: newMode }); + } else { + const rc = this.libzip.close(this.zip); + if (rc === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + if (typeof newMode !== `undefined`) { + this.baseFs.chmodSync(this.path, newMode); + } + } + this.ready = false; + } + discardAndClose() { + this.prepareClose(); + this.libzip.discard(this.zip); + this.ready = false; + } + resolve(p) { + return ppath.resolve(PortablePath.root, p); + } + async openPromise(p, flags, mode) { + return this.openSync(p, flags, mode); + } + openSync(p, flags, mode) { + const fd = this.nextFd++; + this.fds.set(fd, { cursor: 0, p }); + return fd; + } + hasOpenFileHandles() { + return !!this.fds.size; + } + async opendirPromise(p, opts) { + return this.opendirSync(p, opts); + } + opendirSync(p, opts = {}) { + const resolvedP = this.resolveFilename(`opendir '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) + throw ENOENT(`opendir '${p}'`); + const directoryListing = this.listings.get(resolvedP); + if (!directoryListing) + throw ENOTDIR(`opendir '${p}'`); + const entries = [...directoryListing]; + const fd = this.openSync(resolvedP, `r`); + const onClose = () => { + this.closeSync(fd); + }; + return opendir(this, resolvedP, entries, { onClose }); + } + async readPromise(fd, buffer, offset, length, position) { + return this.readSync(fd, buffer, offset, length, position); + } + readSync(fd, buffer, offset = 0, length = buffer.byteLength, position = -1) { + const entry = this.fds.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`read`); + const realPosition = position === -1 || position === null ? entry.cursor : position; + const source = this.readFileSync(entry.p); + source.copy(buffer, offset, realPosition, realPosition + length); + const bytesRead = Math.max(0, Math.min(source.length - realPosition, length)); + if (position === -1 || position === null) + entry.cursor += bytesRead; + return bytesRead; + } + async writePromise(fd, buffer, offset, length, position) { + if (typeof buffer === `string`) { + return this.writeSync(fd, buffer, position); + } else { + return this.writeSync(fd, buffer, offset, length, position); + } + } + writeSync(fd, buffer, offset, length, position) { + const entry = this.fds.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`read`); + throw new Error(`Unimplemented`); + } + async closePromise(fd) { + return this.closeSync(fd); + } + closeSync(fd) { + const entry = this.fds.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`read`); + this.fds.delete(fd); + } + createReadStream(p, { encoding } = {}) { + if (p === null) + throw new Error(`Unimplemented`); + const fd = this.openSync(p, `r`); + const stream$1 = Object.assign( + new stream.PassThrough({ + emitClose: true, + autoDestroy: true, + destroy: (error, callback) => { + clearImmediate(immediate); + this.closeSync(fd); + callback(error); + } + }), + { + close() { + stream$1.destroy(); + }, + bytesRead: 0, + path: p + } + ); + const immediate = setImmediate(async () => { + try { + const data = await this.readFilePromise(p, encoding); + stream$1.bytesRead = data.length; + stream$1.end(data); + } catch (error) { + stream$1.destroy(error); + } + }); + return stream$1; + } + createWriteStream(p, { encoding } = {}) { + if (this.readOnly) + throw EROFS(`open '${p}'`); + if (p === null) + throw new Error(`Unimplemented`); + const chunks = []; + const fd = this.openSync(p, `w`); + const stream$1 = Object.assign( + new stream.PassThrough({ + autoDestroy: true, + emitClose: true, + destroy: (error, callback) => { + try { + if (error) { + callback(error); + } else { + this.writeFileSync(p, Buffer.concat(chunks), encoding); + callback(null); + } + } catch (err) { + callback(err); + } finally { + this.closeSync(fd); + } + } + }), + { + bytesWritten: 0, + path: p, + close() { + stream$1.destroy(); + } + } + ); + stream$1.on(`data`, (chunk) => { + const chunkBuffer = Buffer.from(chunk); + stream$1.bytesWritten += chunkBuffer.length; + chunks.push(chunkBuffer); + }); + return stream$1; + } + async realpathPromise(p) { + return this.realpathSync(p); + } + realpathSync(p) { + const resolvedP = this.resolveFilename(`lstat '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) + throw ENOENT(`lstat '${p}'`); + return resolvedP; + } + async existsPromise(p) { + return this.existsSync(p); + } + existsSync(p) { + if (!this.ready) + throw EBUSY(`archive closed, existsSync '${p}'`); + if (this.symlinkCount === 0) { + const resolvedP2 = ppath.resolve(PortablePath.root, p); + return this.entries.has(resolvedP2) || this.listings.has(resolvedP2); + } + let resolvedP; + try { + resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, false); + } catch (error) { + return false; + } + if (resolvedP === void 0) + return false; + return this.entries.has(resolvedP) || this.listings.has(resolvedP); + } + async accessPromise(p, mode) { + return this.accessSync(p, mode); + } + accessSync(p, mode = fs.constants.F_OK) { + const resolvedP = this.resolveFilename(`access '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) + throw ENOENT(`access '${p}'`); + if (this.readOnly && mode & fs.constants.W_OK) { + throw EROFS(`access '${p}'`); + } + } + async statPromise(p, opts = { bigint: false }) { + if (opts.bigint) + return this.statSync(p, { bigint: true }); + return this.statSync(p); + } + statSync(p, opts = { bigint: false, throwIfNoEntry: true }) { + const resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, opts.throwIfNoEntry); + if (resolvedP === void 0) + return void 0; + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { + if (opts.throwIfNoEntry === false) + return void 0; + throw ENOENT(`stat '${p}'`); + } + if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) + throw ENOTDIR(`stat '${p}'`); + return this.statImpl(`stat '${p}'`, resolvedP, opts); + } + async fstatPromise(fd, opts) { + return this.fstatSync(fd, opts); + } + fstatSync(fd, opts) { + const entry = this.fds.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`fstatSync`); + const { p } = entry; + const resolvedP = this.resolveFilename(`stat '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) + throw ENOENT(`stat '${p}'`); + if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) + throw ENOTDIR(`stat '${p}'`); + return this.statImpl(`fstat '${p}'`, resolvedP, opts); + } + async lstatPromise(p, opts = { bigint: false }) { + if (opts.bigint) + return this.lstatSync(p, { bigint: true }); + return this.lstatSync(p); + } + lstatSync(p, opts = { bigint: false, throwIfNoEntry: true }) { + const resolvedP = this.resolveFilename(`lstat '${p}'`, p, false, opts.throwIfNoEntry); + if (resolvedP === void 0) + return void 0; + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { + if (opts.throwIfNoEntry === false) + return void 0; + throw ENOENT(`lstat '${p}'`); + } + if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) + throw ENOTDIR(`lstat '${p}'`); + return this.statImpl(`lstat '${p}'`, resolvedP, opts); + } + statImpl(reason, p, opts = {}) { + const entry = this.entries.get(p); + if (typeof entry !== `undefined`) { + const stat = this.libzip.struct.statS(); + const rc = this.libzip.statIndex(this.zip, entry, 0, 0, stat); + if (rc === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + const uid = this.stats.uid; + const gid = this.stats.gid; + const size = this.libzip.struct.statSize(stat) >>> 0; + const blksize = 512; + const blocks = Math.ceil(size / blksize); + const mtimeMs = (this.libzip.struct.statMtime(stat) >>> 0) * 1e3; + const atimeMs = mtimeMs; + const birthtimeMs = mtimeMs; + const ctimeMs = mtimeMs; + const atime = new Date(atimeMs); + const birthtime = new Date(birthtimeMs); + const ctime = new Date(ctimeMs); + const mtime = new Date(mtimeMs); + const type = this.listings.has(p) ? S_IFDIR : this.isSymbolicLink(entry) ? S_IFLNK : S_IFREG; + const defaultMode = type === S_IFDIR ? 493 : 420; + const mode = type | this.getUnixMode(entry, defaultMode) & 511; + const crc = this.libzip.struct.statCrc(stat); + const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); + return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; + } + if (this.listings.has(p)) { + const uid = this.stats.uid; + const gid = this.stats.gid; + const size = 0; + const blksize = 512; + const blocks = 0; + const atimeMs = this.stats.mtimeMs; + const birthtimeMs = this.stats.mtimeMs; + const ctimeMs = this.stats.mtimeMs; + const mtimeMs = this.stats.mtimeMs; + const atime = new Date(atimeMs); + const birthtime = new Date(birthtimeMs); + const ctime = new Date(ctimeMs); + const mtime = new Date(mtimeMs); + const mode = S_IFDIR | 493; + const crc = 0; + const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); + return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; + } + throw new Error(`Unreachable`); + } + getUnixMode(index, defaultMode) { + const rc = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); + if (rc === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; + if (opsys !== this.libzip.ZIP_OPSYS_UNIX) + return defaultMode; + return this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; + } + registerListing(p) { + const existingListing = this.listings.get(p); + if (existingListing) + return existingListing; + const parentListing = this.registerListing(ppath.dirname(p)); + parentListing.add(ppath.basename(p)); + const newListing = /* @__PURE__ */ new Set(); + this.listings.set(p, newListing); + return newListing; + } + registerEntry(p, index) { + const parentListing = this.registerListing(ppath.dirname(p)); + parentListing.add(ppath.basename(p)); + this.entries.set(p, index); + } + unregisterListing(p) { + this.listings.delete(p); + const parentListing = this.listings.get(ppath.dirname(p)); + parentListing == null ? void 0 : parentListing.delete(ppath.basename(p)); + } + unregisterEntry(p) { + this.unregisterListing(p); + const entry = this.entries.get(p); + this.entries.delete(p); + if (typeof entry === `undefined`) + return; + this.fileSources.delete(entry); + if (this.isSymbolicLink(entry)) { + this.symlinkCount--; + } + } + deleteEntry(p, index) { + this.unregisterEntry(p); + const rc = this.libzip.delete(this.zip, index); + if (rc === -1) { + throw this.makeLibzipError(this.libzip.getError(this.zip)); + } + } + resolveFilename(reason, p, resolveLastComponent = true, throwIfNoEntry = true) { + if (!this.ready) + throw EBUSY(`archive closed, ${reason}`); + let resolvedP = ppath.resolve(PortablePath.root, p); + if (resolvedP === `/`) + return PortablePath.root; + const fileIndex = this.entries.get(resolvedP); + if (resolveLastComponent && fileIndex !== void 0) { + if (this.symlinkCount !== 0 && this.isSymbolicLink(fileIndex)) { + const target = this.getFileSource(fileIndex).toString(); + return this.resolveFilename(reason, ppath.resolve(ppath.dirname(resolvedP), target), true, throwIfNoEntry); + } else { + return resolvedP; + } + } + while (true) { + const parentP = this.resolveFilename(reason, ppath.dirname(resolvedP), true, throwIfNoEntry); + if (parentP === void 0) + return parentP; + const isDir = this.listings.has(parentP); + const doesExist = this.entries.has(parentP); + if (!isDir && !doesExist) { + if (throwIfNoEntry === false) + return void 0; + throw ENOENT(reason); + } + if (!isDir) + throw ENOTDIR(reason); + resolvedP = ppath.resolve(parentP, ppath.basename(resolvedP)); + if (!resolveLastComponent || this.symlinkCount === 0) + break; + const index = this.libzip.name.locate(this.zip, resolvedP.slice(1)); + if (index === -1) + break; + if (this.isSymbolicLink(index)) { + const target = this.getFileSource(index).toString(); + resolvedP = ppath.resolve(ppath.dirname(resolvedP), target); + } else { + break; + } + } + return resolvedP; + } + allocateBuffer(content) { + if (!Buffer.isBuffer(content)) + content = Buffer.from(content); + const buffer = this.libzip.malloc(content.byteLength); + if (!buffer) + throw new Error(`Couldn't allocate enough memory`); + const heap = new Uint8Array(this.libzip.HEAPU8.buffer, buffer, content.byteLength); + heap.set(content); + return { buffer, byteLength: content.byteLength }; + } + allocateUnattachedSource(content) { + const error = this.libzip.struct.errorS(); + const { buffer, byteLength } = this.allocateBuffer(content); + const source = this.libzip.source.fromUnattachedBuffer(buffer, byteLength, 0, true, error); + if (source === 0) { + this.libzip.free(error); + throw this.makeLibzipError(error); + } + return source; + } + allocateSource(content) { + const { buffer, byteLength } = this.allocateBuffer(content); + const source = this.libzip.source.fromBuffer(this.zip, buffer, byteLength, 0, true); + if (source === 0) { + this.libzip.free(buffer); + throw this.makeLibzipError(this.libzip.getError(this.zip)); + } + return source; + } + setFileSource(p, content) { + const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content); + const target = ppath.relative(PortablePath.root, p); + const lzSource = this.allocateSource(content); + try { + const newIndex = this.libzip.file.add(this.zip, target, lzSource, this.libzip.ZIP_FL_OVERWRITE); + if (newIndex === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + if (this.level !== `mixed`) { + const method = this.level === 0 ? this.libzip.ZIP_CM_STORE : this.libzip.ZIP_CM_DEFLATE; + const rc = this.libzip.file.setCompression(this.zip, newIndex, 0, method, this.level); + if (rc === -1) { + throw this.makeLibzipError(this.libzip.getError(this.zip)); + } + } + this.fileSources.set(newIndex, buffer); + return newIndex; + } catch (error) { + this.libzip.source.free(lzSource); + throw error; + } + } + isSymbolicLink(index) { + if (this.symlinkCount === 0) + return false; + const attrs = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); + if (attrs === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; + if (opsys !== this.libzip.ZIP_OPSYS_UNIX) + return false; + const attributes = this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; + return (attributes & S_IFMT) === S_IFLNK; + } + getFileSource(index, opts = { asyncDecompress: false }) { + const cachedFileSource = this.fileSources.get(index); + if (typeof cachedFileSource !== `undefined`) + return cachedFileSource; + const stat = this.libzip.struct.statS(); + const rc = this.libzip.statIndex(this.zip, index, 0, 0, stat); + if (rc === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + const size = this.libzip.struct.statCompSize(stat); + const compressionMethod = this.libzip.struct.statCompMethod(stat); + const buffer = this.libzip.malloc(size); + try { + const file = this.libzip.fopenIndex(this.zip, index, 0, this.libzip.ZIP_FL_COMPRESSED); + if (file === 0) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + try { + const rc2 = this.libzip.fread(file, buffer, size, 0); + if (rc2 === -1) + throw this.makeLibzipError(this.libzip.file.getError(file)); + else if (rc2 < size) + throw new Error(`Incomplete read`); + else if (rc2 > size) + throw new Error(`Overread`); + const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); + const data = Buffer.from(memory); + if (compressionMethod === 0) { + this.fileSources.set(index, data); + return data; + } else if (opts.asyncDecompress) { + return new Promise((resolve, reject) => { + zlib__default.default.inflateRaw(data, (error, result) => { + if (error) { + reject(error); + } else { + this.fileSources.set(index, result); + resolve(result); + } + }); + }); + } else { + const decompressedData = zlib__default.default.inflateRawSync(data); + this.fileSources.set(index, decompressedData); + return decompressedData; + } + } finally { + this.libzip.fclose(file); + } + } finally { + this.libzip.free(buffer); + } + } + async fchmodPromise(fd, mask) { + return this.chmodPromise(this.fdToPath(fd, `fchmod`), mask); + } + fchmodSync(fd, mask) { + return this.chmodSync(this.fdToPath(fd, `fchmodSync`), mask); + } + async chmodPromise(p, mask) { + return this.chmodSync(p, mask); + } + chmodSync(p, mask) { + if (this.readOnly) + throw EROFS(`chmod '${p}'`); + mask &= 493; + const resolvedP = this.resolveFilename(`chmod '${p}'`, p, false); + const entry = this.entries.get(resolvedP); + if (typeof entry === `undefined`) + throw new Error(`Assertion failed: The entry should have been registered (${resolvedP})`); + const oldMod = this.getUnixMode(entry, S_IFREG | 0); + const newMod = oldMod & ~511 | mask; + const rc = this.libzip.file.setExternalAttributes(this.zip, entry, 0, 0, this.libzip.ZIP_OPSYS_UNIX, newMod << 16); + if (rc === -1) { + throw this.makeLibzipError(this.libzip.getError(this.zip)); + } + } + async fchownPromise(fd, uid, gid) { + return this.chownPromise(this.fdToPath(fd, `fchown`), uid, gid); + } + fchownSync(fd, uid, gid) { + return this.chownSync(this.fdToPath(fd, `fchownSync`), uid, gid); + } + async chownPromise(p, uid, gid) { + return this.chownSync(p, uid, gid); + } + chownSync(p, uid, gid) { + throw new Error(`Unimplemented`); + } + async renamePromise(oldP, newP) { + return this.renameSync(oldP, newP); + } + renameSync(oldP, newP) { + throw new Error(`Unimplemented`); + } + async copyFilePromise(sourceP, destP, flags) { + const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); + const source = await this.getFileSource(indexSource, { asyncDecompress: true }); + const newIndex = this.setFileSource(resolvedDestP, source); + if (newIndex !== indexDest) { + this.registerEntry(resolvedDestP, newIndex); + } + } + copyFileSync(sourceP, destP, flags = 0) { + const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); + const source = this.getFileSource(indexSource); + const newIndex = this.setFileSource(resolvedDestP, source); + if (newIndex !== indexDest) { + this.registerEntry(resolvedDestP, newIndex); + } + } + prepareCopyFile(sourceP, destP, flags = 0) { + if (this.readOnly) + throw EROFS(`copyfile '${sourceP} -> '${destP}'`); + if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) + throw ENOSYS(`unsupported clone operation`, `copyfile '${sourceP}' -> ${destP}'`); + const resolvedSourceP = this.resolveFilename(`copyfile '${sourceP} -> ${destP}'`, sourceP); + const indexSource = this.entries.get(resolvedSourceP); + if (typeof indexSource === `undefined`) + throw EINVAL(`copyfile '${sourceP}' -> '${destP}'`); + const resolvedDestP = this.resolveFilename(`copyfile '${sourceP}' -> ${destP}'`, destP); + const indexDest = this.entries.get(resolvedDestP); + if ((flags & (fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE_FORCE)) !== 0 && typeof indexDest !== `undefined`) + throw EEXIST(`copyfile '${sourceP}' -> '${destP}'`); + return { + indexSource, + resolvedDestP, + indexDest + }; + } + async appendFilePromise(p, content, opts) { + if (this.readOnly) + throw EROFS(`open '${p}'`); + if (typeof opts === `undefined`) + opts = { flag: `a` }; + else if (typeof opts === `string`) + opts = { flag: `a`, encoding: opts }; + else if (typeof opts.flag === `undefined`) + opts = { flag: `a`, ...opts }; + return this.writeFilePromise(p, content, opts); + } + appendFileSync(p, content, opts = {}) { + if (this.readOnly) + throw EROFS(`open '${p}'`); + if (typeof opts === `undefined`) + opts = { flag: `a` }; + else if (typeof opts === `string`) + opts = { flag: `a`, encoding: opts }; + else if (typeof opts.flag === `undefined`) + opts = { flag: `a`, ...opts }; + return this.writeFileSync(p, content, opts); + } + fdToPath(fd, reason) { + var _a; + const path = (_a = this.fds.get(fd)) == null ? void 0 : _a.p; + if (typeof path === `undefined`) + throw EBADF(reason); + return path; + } + async writeFilePromise(p, content, opts) { + const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); + if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) + content = Buffer.concat([await this.getFileSource(index, { asyncDecompress: true }), Buffer.from(content)]); + if (encoding !== null) + content = content.toString(encoding); + const newIndex = this.setFileSource(resolvedP, content); + if (newIndex !== index) + this.registerEntry(resolvedP, newIndex); + if (mode !== null) { + await this.chmodPromise(resolvedP, mode); + } + } + writeFileSync(p, content, opts) { + const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); + if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) + content = Buffer.concat([this.getFileSource(index), Buffer.from(content)]); + if (encoding !== null) + content = content.toString(encoding); + const newIndex = this.setFileSource(resolvedP, content); + if (newIndex !== index) + this.registerEntry(resolvedP, newIndex); + if (mode !== null) { + this.chmodSync(resolvedP, mode); + } + } + prepareWriteFile(p, opts) { + if (typeof p === `number`) + p = this.fdToPath(p, `read`); + if (this.readOnly) + throw EROFS(`open '${p}'`); + const resolvedP = this.resolveFilename(`open '${p}'`, p); + if (this.listings.has(resolvedP)) + throw EISDIR(`open '${p}'`); + let encoding = null, mode = null; + if (typeof opts === `string`) { + encoding = opts; + } else if (typeof opts === `object`) { + ({ + encoding = null, + mode = null + } = opts); + } + const index = this.entries.get(resolvedP); + return { + encoding, + mode, + resolvedP, + index + }; + } + async unlinkPromise(p) { + return this.unlinkSync(p); + } + unlinkSync(p) { + if (this.readOnly) + throw EROFS(`unlink '${p}'`); + const resolvedP = this.resolveFilename(`unlink '${p}'`, p); + if (this.listings.has(resolvedP)) + throw EISDIR(`unlink '${p}'`); + const index = this.entries.get(resolvedP); + if (typeof index === `undefined`) + throw EINVAL(`unlink '${p}'`); + this.deleteEntry(resolvedP, index); + } + async utimesPromise(p, atime, mtime) { + return this.utimesSync(p, atime, mtime); + } + utimesSync(p, atime, mtime) { + if (this.readOnly) + throw EROFS(`utimes '${p}'`); + const resolvedP = this.resolveFilename(`utimes '${p}'`, p); + this.utimesImpl(resolvedP, mtime); + } + async lutimesPromise(p, atime, mtime) { + return this.lutimesSync(p, atime, mtime); + } + lutimesSync(p, atime, mtime) { + if (this.readOnly) + throw EROFS(`lutimes '${p}'`); + const resolvedP = this.resolveFilename(`utimes '${p}'`, p, false); + this.utimesImpl(resolvedP, mtime); + } + utimesImpl(resolvedP, mtime) { + if (this.listings.has(resolvedP)) { + if (!this.entries.has(resolvedP)) + this.hydrateDirectory(resolvedP); + } + const entry = this.entries.get(resolvedP); + if (entry === void 0) + throw new Error(`Unreachable`); + const rc = this.libzip.file.setMtime(this.zip, entry, 0, toUnixTimestamp(mtime), 0); + if (rc === -1) { + throw this.makeLibzipError(this.libzip.getError(this.zip)); + } + } + async mkdirPromise(p, opts) { + return this.mkdirSync(p, opts); + } + mkdirSync(p, { mode = 493, recursive = false } = {}) { + if (recursive) + return this.mkdirpSync(p, { chmod: mode }); + if (this.readOnly) + throw EROFS(`mkdir '${p}'`); + const resolvedP = this.resolveFilename(`mkdir '${p}'`, p); + if (this.entries.has(resolvedP) || this.listings.has(resolvedP)) + throw EEXIST(`mkdir '${p}'`); + this.hydrateDirectory(resolvedP); + this.chmodSync(resolvedP, mode); + return void 0; + } + async rmdirPromise(p, opts) { + return this.rmdirSync(p, opts); + } + rmdirSync(p, { recursive = false } = {}) { + if (this.readOnly) + throw EROFS(`rmdir '${p}'`); + if (recursive) { + this.removeSync(p); + return; + } + const resolvedP = this.resolveFilename(`rmdir '${p}'`, p); + const directoryListing = this.listings.get(resolvedP); + if (!directoryListing) + throw ENOTDIR(`rmdir '${p}'`); + if (directoryListing.size > 0) + throw ENOTEMPTY(`rmdir '${p}'`); + const index = this.entries.get(resolvedP); + if (typeof index === `undefined`) + throw EINVAL(`rmdir '${p}'`); + this.deleteEntry(p, index); + } + hydrateDirectory(resolvedP) { + const index = this.libzip.dir.add(this.zip, ppath.relative(PortablePath.root, resolvedP)); + if (index === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + this.registerListing(resolvedP); + this.registerEntry(resolvedP, index); + return index; + } + async linkPromise(existingP, newP) { + return this.linkSync(existingP, newP); + } + linkSync(existingP, newP) { + throw EOPNOTSUPP(`link '${existingP}' -> '${newP}'`); + } + async symlinkPromise(target, p) { + return this.symlinkSync(target, p); + } + symlinkSync(target, p) { + if (this.readOnly) + throw EROFS(`symlink '${target}' -> '${p}'`); + const resolvedP = this.resolveFilename(`symlink '${target}' -> '${p}'`, p); + if (this.listings.has(resolvedP)) + throw EISDIR(`symlink '${target}' -> '${p}'`); + if (this.entries.has(resolvedP)) + throw EEXIST(`symlink '${target}' -> '${p}'`); + const index = this.setFileSource(resolvedP, target); + this.registerEntry(resolvedP, index); + const rc = this.libzip.file.setExternalAttributes(this.zip, index, 0, 0, this.libzip.ZIP_OPSYS_UNIX, (S_IFLNK | 511) << 16); + if (rc === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + this.symlinkCount += 1; + } + async readFilePromise(p, encoding) { + if (typeof encoding === `object`) + encoding = encoding ? encoding.encoding : void 0; + const data = await this.readFileBuffer(p, { asyncDecompress: true }); + return encoding ? data.toString(encoding) : data; + } + readFileSync(p, encoding) { + if (typeof encoding === `object`) + encoding = encoding ? encoding.encoding : void 0; + const data = this.readFileBuffer(p); + return encoding ? data.toString(encoding) : data; + } + readFileBuffer(p, opts = { asyncDecompress: false }) { + if (typeof p === `number`) + p = this.fdToPath(p, `read`); + const resolvedP = this.resolveFilename(`open '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) + throw ENOENT(`open '${p}'`); + if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) + throw ENOTDIR(`open '${p}'`); + if (this.listings.has(resolvedP)) + throw EISDIR(`read`); + const entry = this.entries.get(resolvedP); + if (entry === void 0) + throw new Error(`Unreachable`); + return this.getFileSource(entry, opts); + } + async readdirPromise(p, opts) { + return this.readdirSync(p, opts); + } + readdirSync(p, opts) { + const resolvedP = this.resolveFilename(`scandir '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) + throw ENOENT(`scandir '${p}'`); + const directoryListing = this.listings.get(resolvedP); + if (!directoryListing) + throw ENOTDIR(`scandir '${p}'`); + const entries = [...directoryListing]; + if (!(opts == null ? void 0 : opts.withFileTypes)) + return entries; + return entries.map((name) => { + return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { + name + }); + }); + } + async readlinkPromise(p) { + const entry = this.prepareReadlink(p); + return (await this.getFileSource(entry, { asyncDecompress: true })).toString(); + } + readlinkSync(p) { + const entry = this.prepareReadlink(p); + return this.getFileSource(entry).toString(); + } + prepareReadlink(p) { + const resolvedP = this.resolveFilename(`readlink '${p}'`, p, false); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) + throw ENOENT(`readlink '${p}'`); + if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) + throw ENOTDIR(`open '${p}'`); + if (this.listings.has(resolvedP)) + throw EINVAL(`readlink '${p}'`); + const entry = this.entries.get(resolvedP); + if (entry === void 0) + throw new Error(`Unreachable`); + if (!this.isSymbolicLink(entry)) + throw EINVAL(`readlink '${p}'`); + return entry; + } + async truncatePromise(p, len = 0) { + const resolvedP = this.resolveFilename(`open '${p}'`, p); + const index = this.entries.get(resolvedP); + if (typeof index === `undefined`) + throw EINVAL(`open '${p}'`); + const source = await this.getFileSource(index, { asyncDecompress: true }); + const truncated = Buffer.alloc(len, 0); + source.copy(truncated); + return await this.writeFilePromise(p, truncated); + } + truncateSync(p, len = 0) { + const resolvedP = this.resolveFilename(`open '${p}'`, p); + const index = this.entries.get(resolvedP); + if (typeof index === `undefined`) + throw EINVAL(`open '${p}'`); + const source = this.getFileSource(index); + const truncated = Buffer.alloc(len, 0); + source.copy(truncated); + return this.writeFileSync(p, truncated); + } + async ftruncatePromise(fd, len) { + return this.truncatePromise(this.fdToPath(fd, `ftruncate`), len); + } + ftruncateSync(fd, len) { + return this.truncateSync(this.fdToPath(fd, `ftruncateSync`), len); + } + watch(p, a, b) { + let persistent; + switch (typeof a) { + case `function`: + case `string`: + case `undefined`: + { + persistent = true; + } + break; + default: + { + ({ persistent = true } = a); + } + break; + } + if (!persistent) + return { on: () => { + }, close: () => { + } }; + const interval = setInterval(() => { + }, 24 * 60 * 60 * 1e3); + return { on: () => { + }, close: () => { + clearInterval(interval); + } }; + } + watchFile(p, a, b) { + const resolvedP = ppath.resolve(PortablePath.root, p); + return watchFile(this, resolvedP, a, b); + } + unwatchFile(p, cb) { + const resolvedP = ppath.resolve(PortablePath.root, p); + return unwatchFile(this, resolvedP, cb); + } +} + +class ProxiedFS extends FakeFS { + getExtractHint(hints) { + return this.baseFs.getExtractHint(hints); + } + resolve(path) { + return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path))); + } + getRealPath() { + return this.mapFromBase(this.baseFs.getRealPath()); + } + async openPromise(p, flags, mode) { + return this.baseFs.openPromise(this.mapToBase(p), flags, mode); + } + openSync(p, flags, mode) { + return this.baseFs.openSync(this.mapToBase(p), flags, mode); + } + async opendirPromise(p, opts) { + return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(p), opts), { path: p }); + } + opendirSync(p, opts) { + return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), { path: p }); + } + async readPromise(fd, buffer, offset, length, position) { + return await this.baseFs.readPromise(fd, buffer, offset, length, position); + } + readSync(fd, buffer, offset, length, position) { + return this.baseFs.readSync(fd, buffer, offset, length, position); + } + async writePromise(fd, buffer, offset, length, position) { + if (typeof buffer === `string`) { + return await this.baseFs.writePromise(fd, buffer, offset); + } else { + return await this.baseFs.writePromise(fd, buffer, offset, length, position); + } + } + writeSync(fd, buffer, offset, length, position) { + if (typeof buffer === `string`) { + return this.baseFs.writeSync(fd, buffer, offset); + } else { + return this.baseFs.writeSync(fd, buffer, offset, length, position); + } + } + async closePromise(fd) { + return this.baseFs.closePromise(fd); + } + closeSync(fd) { + this.baseFs.closeSync(fd); + } + createReadStream(p, opts) { + return this.baseFs.createReadStream(p !== null ? this.mapToBase(p) : p, opts); + } + createWriteStream(p, opts) { + return this.baseFs.createWriteStream(p !== null ? this.mapToBase(p) : p, opts); + } + async realpathPromise(p) { + return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(p))); + } + realpathSync(p) { + return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(p))); + } + async existsPromise(p) { + return this.baseFs.existsPromise(this.mapToBase(p)); + } + existsSync(p) { + return this.baseFs.existsSync(this.mapToBase(p)); + } + accessSync(p, mode) { + return this.baseFs.accessSync(this.mapToBase(p), mode); + } + async accessPromise(p, mode) { + return this.baseFs.accessPromise(this.mapToBase(p), mode); + } + async statPromise(p, opts) { + return this.baseFs.statPromise(this.mapToBase(p), opts); + } + statSync(p, opts) { + return this.baseFs.statSync(this.mapToBase(p), opts); + } + async fstatPromise(fd, opts) { + return this.baseFs.fstatPromise(fd, opts); + } + fstatSync(fd, opts) { + return this.baseFs.fstatSync(fd, opts); + } + lstatPromise(p, opts) { + return this.baseFs.lstatPromise(this.mapToBase(p), opts); + } + lstatSync(p, opts) { + return this.baseFs.lstatSync(this.mapToBase(p), opts); + } + async fchmodPromise(fd, mask) { + return this.baseFs.fchmodPromise(fd, mask); + } + fchmodSync(fd, mask) { + return this.baseFs.fchmodSync(fd, mask); + } + async chmodPromise(p, mask) { + return this.baseFs.chmodPromise(this.mapToBase(p), mask); + } + chmodSync(p, mask) { + return this.baseFs.chmodSync(this.mapToBase(p), mask); + } + async fchownPromise(fd, uid, gid) { + return this.baseFs.fchownPromise(fd, uid, gid); + } + fchownSync(fd, uid, gid) { + return this.baseFs.fchownSync(fd, uid, gid); + } + async chownPromise(p, uid, gid) { + return this.baseFs.chownPromise(this.mapToBase(p), uid, gid); + } + chownSync(p, uid, gid) { + return this.baseFs.chownSync(this.mapToBase(p), uid, gid); + } + async renamePromise(oldP, newP) { + return this.baseFs.renamePromise(this.mapToBase(oldP), this.mapToBase(newP)); + } + renameSync(oldP, newP) { + return this.baseFs.renameSync(this.mapToBase(oldP), this.mapToBase(newP)); + } + async copyFilePromise(sourceP, destP, flags = 0) { + return this.baseFs.copyFilePromise(this.mapToBase(sourceP), this.mapToBase(destP), flags); + } + copyFileSync(sourceP, destP, flags = 0) { + return this.baseFs.copyFileSync(this.mapToBase(sourceP), this.mapToBase(destP), flags); + } + async appendFilePromise(p, content, opts) { + return this.baseFs.appendFilePromise(this.fsMapToBase(p), content, opts); + } + appendFileSync(p, content, opts) { + return this.baseFs.appendFileSync(this.fsMapToBase(p), content, opts); + } + async writeFilePromise(p, content, opts) { + return this.baseFs.writeFilePromise(this.fsMapToBase(p), content, opts); + } + writeFileSync(p, content, opts) { + return this.baseFs.writeFileSync(this.fsMapToBase(p), content, opts); + } + async unlinkPromise(p) { + return this.baseFs.unlinkPromise(this.mapToBase(p)); + } + unlinkSync(p) { + return this.baseFs.unlinkSync(this.mapToBase(p)); + } + async utimesPromise(p, atime, mtime) { + return this.baseFs.utimesPromise(this.mapToBase(p), atime, mtime); + } + utimesSync(p, atime, mtime) { + return this.baseFs.utimesSync(this.mapToBase(p), atime, mtime); + } + async mkdirPromise(p, opts) { + return this.baseFs.mkdirPromise(this.mapToBase(p), opts); + } + mkdirSync(p, opts) { + return this.baseFs.mkdirSync(this.mapToBase(p), opts); + } + async rmdirPromise(p, opts) { + return this.baseFs.rmdirPromise(this.mapToBase(p), opts); + } + rmdirSync(p, opts) { + return this.baseFs.rmdirSync(this.mapToBase(p), opts); + } + async linkPromise(existingP, newP) { + return this.baseFs.linkPromise(this.mapToBase(existingP), this.mapToBase(newP)); + } + linkSync(existingP, newP) { + return this.baseFs.linkSync(this.mapToBase(existingP), this.mapToBase(newP)); + } + async symlinkPromise(target, p, type) { + const mappedP = this.mapToBase(p); + if (this.pathUtils.isAbsolute(target)) + return this.baseFs.symlinkPromise(this.mapToBase(target), mappedP, type); + const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); + const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); + return this.baseFs.symlinkPromise(mappedTarget, mappedP, type); + } + symlinkSync(target, p, type) { + const mappedP = this.mapToBase(p); + if (this.pathUtils.isAbsolute(target)) + return this.baseFs.symlinkSync(this.mapToBase(target), mappedP, type); + const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); + const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); + return this.baseFs.symlinkSync(mappedTarget, mappedP, type); + } + async readFilePromise(p, encoding) { + if (encoding === `utf8`) { + return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); + } else { + return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); + } + } + readFileSync(p, encoding) { + if (encoding === `utf8`) { + return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); + } else { + return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); + } + } + async readdirPromise(p, opts) { + return this.baseFs.readdirPromise(this.mapToBase(p), opts); + } + readdirSync(p, opts) { + return this.baseFs.readdirSync(this.mapToBase(p), opts); + } + async readlinkPromise(p) { + return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(p))); + } + readlinkSync(p) { + return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(p))); + } + async truncatePromise(p, len) { + return this.baseFs.truncatePromise(this.mapToBase(p), len); + } + truncateSync(p, len) { + return this.baseFs.truncateSync(this.mapToBase(p), len); + } + async ftruncatePromise(fd, len) { + return this.baseFs.ftruncatePromise(fd, len); + } + ftruncateSync(fd, len) { + return this.baseFs.ftruncateSync(fd, len); + } + watch(p, a, b) { + return this.baseFs.watch( + this.mapToBase(p), + a, + b + ); + } + watchFile(p, a, b) { + return this.baseFs.watchFile( + this.mapToBase(p), + a, + b + ); + } + unwatchFile(p, cb) { + return this.baseFs.unwatchFile(this.mapToBase(p), cb); + } + fsMapToBase(p) { + if (typeof p === `number`) { + return p; + } else { + return this.mapToBase(p); + } + } +} + +class PosixFS extends ProxiedFS { + constructor(baseFs) { + super(npath); + this.baseFs = baseFs; + } + mapFromBase(path) { + return npath.fromPortablePath(path); + } + mapToBase(path) { + return npath.toPortablePath(path); + } +} + +const NUMBER_REGEXP = /^[0-9]+$/; +const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; +const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; +class VirtualFS extends ProxiedFS { + constructor({ baseFs = new NodeFS() } = {}) { + super(ppath); + this.baseFs = baseFs; + } + static makeVirtualPath(base, component, to) { + if (ppath.basename(base) !== `__virtual__`) + throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); + if (!ppath.basename(component).match(VALID_COMPONENT)) + throw new Error(`Assertion failed: Virtual components must be ended by an hexadecimal hash`); + const target = ppath.relative(ppath.dirname(base), to); + const segments = target.split(`/`); + let depth = 0; + while (depth < segments.length && segments[depth] === `..`) + depth += 1; + const finalSegments = segments.slice(depth); + const fullVirtualPath = ppath.join(base, component, String(depth), ...finalSegments); + return fullVirtualPath; + } + static resolveVirtual(p) { + const match = p.match(VIRTUAL_REGEXP); + if (!match || !match[3] && match[5]) + return p; + const target = ppath.dirname(match[1]); + if (!match[3] || !match[4]) + return target; + const isnum = NUMBER_REGEXP.test(match[4]); + if (!isnum) + return p; + const depth = Number(match[4]); + const backstep = `../`.repeat(depth); + const subpath = match[5] || `.`; + return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); + } + getExtractHint(hints) { + return this.baseFs.getExtractHint(hints); + } + getRealPath() { + return this.baseFs.getRealPath(); + } + realpathSync(p) { + const match = p.match(VIRTUAL_REGEXP); + if (!match) + return this.baseFs.realpathSync(p); + if (!match[5]) + return p; + const realpath = this.baseFs.realpathSync(this.mapToBase(p)); + return VirtualFS.makeVirtualPath(match[1], match[3], realpath); + } + async realpathPromise(p) { + const match = p.match(VIRTUAL_REGEXP); + if (!match) + return await this.baseFs.realpathPromise(p); + if (!match[5]) + return p; + const realpath = await this.baseFs.realpathPromise(this.mapToBase(p)); + return VirtualFS.makeVirtualPath(match[1], match[3], realpath); + } + mapToBase(p) { + if (p === ``) + return p; + if (this.pathUtils.isAbsolute(p)) + return VirtualFS.resolveVirtual(p); + const resolvedRoot = VirtualFS.resolveVirtual(this.baseFs.resolve(PortablePath.dot)); + const resolvedP = VirtualFS.resolveVirtual(this.baseFs.resolve(p)); + return ppath.relative(resolvedRoot, resolvedP) || PortablePath.dot; + } + mapFromBase(p) { + return p; + } +} + +const ZIP_MASK = 4278190080; +const ZIP_MAGIC = 704643072; +const getArchivePart = (path, extension) => { + let idx = path.indexOf(extension); + if (idx <= 0) + return null; + let nextCharIdx = idx; + while (idx >= 0) { + nextCharIdx = idx + extension.length; + if (path[nextCharIdx] === ppath.sep) + break; + if (path[idx - 1] === ppath.sep) + return null; + idx = path.indexOf(extension, nextCharIdx); + } + if (path.length > nextCharIdx && path[nextCharIdx] !== ppath.sep) + return null; + return path.slice(0, nextCharIdx); +}; +class ZipOpenFS extends BasePortableFakeFS { + constructor({ libzip, baseFs = new NodeFS(), filter = null, maxOpenFiles = Infinity, readOnlyArchives = false, useCache = true, maxAge = 5e3, fileExtensions = null }) { + super(); + this.fdMap = /* @__PURE__ */ new Map(); + this.nextFd = 3; + this.isZip = /* @__PURE__ */ new Set(); + this.notZip = /* @__PURE__ */ new Set(); + this.realPaths = /* @__PURE__ */ new Map(); + this.limitOpenFilesTimeout = null; + this.libzipFactory = typeof libzip !== `function` ? () => libzip : libzip; + this.baseFs = baseFs; + this.zipInstances = useCache ? /* @__PURE__ */ new Map() : null; + this.filter = filter; + this.maxOpenFiles = maxOpenFiles; + this.readOnlyArchives = readOnlyArchives; + this.maxAge = maxAge; + this.fileExtensions = fileExtensions; + } + static async openPromise(fn, opts) { + const zipOpenFs = new ZipOpenFS(opts); + try { + return await fn(zipOpenFs); + } finally { + zipOpenFs.saveAndClose(); + } + } + get libzip() { + if (typeof this.libzipInstance === `undefined`) + this.libzipInstance = this.libzipFactory(); + return this.libzipInstance; + } + getExtractHint(hints) { + return this.baseFs.getExtractHint(hints); + } + getRealPath() { + return this.baseFs.getRealPath(); + } + saveAndClose() { + unwatchAllFiles(this); + if (this.zipInstances) { + for (const [path, { zipFs }] of this.zipInstances.entries()) { + zipFs.saveAndClose(); + this.zipInstances.delete(path); + } + } + } + discardAndClose() { + unwatchAllFiles(this); + if (this.zipInstances) { + for (const [path, { zipFs }] of this.zipInstances.entries()) { + zipFs.discardAndClose(); + this.zipInstances.delete(path); + } + } + } + resolve(p) { + return this.baseFs.resolve(p); + } + remapFd(zipFs, fd) { + const remappedFd = this.nextFd++ | ZIP_MAGIC; + this.fdMap.set(remappedFd, [zipFs, fd]); + return remappedFd; + } + async openPromise(p, flags, mode) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.openPromise(p, flags, mode); + }, async (zipFs, { subPath }) => { + return this.remapFd(zipFs, await zipFs.openPromise(subPath, flags, mode)); + }); + } + openSync(p, flags, mode) { + return this.makeCallSync(p, () => { + return this.baseFs.openSync(p, flags, mode); + }, (zipFs, { subPath }) => { + return this.remapFd(zipFs, zipFs.openSync(subPath, flags, mode)); + }); + } + async opendirPromise(p, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.opendirPromise(p, opts); + }, async (zipFs, { subPath }) => { + return await zipFs.opendirPromise(subPath, opts); + }, { + requireSubpath: false + }); + } + opendirSync(p, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.opendirSync(p, opts); + }, (zipFs, { subPath }) => { + return zipFs.opendirSync(subPath, opts); + }, { + requireSubpath: false + }); + } + async readPromise(fd, buffer, offset, length, position) { + if ((fd & ZIP_MASK) !== ZIP_MAGIC) + return await this.baseFs.readPromise(fd, buffer, offset, length, position); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`read`); + const [zipFs, realFd] = entry; + return await zipFs.readPromise(realFd, buffer, offset, length, position); + } + readSync(fd, buffer, offset, length, position) { + if ((fd & ZIP_MASK) !== ZIP_MAGIC) + return this.baseFs.readSync(fd, buffer, offset, length, position); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`readSync`); + const [zipFs, realFd] = entry; + return zipFs.readSync(realFd, buffer, offset, length, position); + } + async writePromise(fd, buffer, offset, length, position) { + if ((fd & ZIP_MASK) !== ZIP_MAGIC) { + if (typeof buffer === `string`) { + return await this.baseFs.writePromise(fd, buffer, offset); + } else { + return await this.baseFs.writePromise(fd, buffer, offset, length, position); + } + } + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`write`); + const [zipFs, realFd] = entry; + if (typeof buffer === `string`) { + return await zipFs.writePromise(realFd, buffer, offset); + } else { + return await zipFs.writePromise(realFd, buffer, offset, length, position); + } + } + writeSync(fd, buffer, offset, length, position) { + if ((fd & ZIP_MASK) !== ZIP_MAGIC) { + if (typeof buffer === `string`) { + return this.baseFs.writeSync(fd, buffer, offset); + } else { + return this.baseFs.writeSync(fd, buffer, offset, length, position); + } + } + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`writeSync`); + const [zipFs, realFd] = entry; + if (typeof buffer === `string`) { + return zipFs.writeSync(realFd, buffer, offset); + } else { + return zipFs.writeSync(realFd, buffer, offset, length, position); + } + } + async closePromise(fd) { + if ((fd & ZIP_MASK) !== ZIP_MAGIC) + return await this.baseFs.closePromise(fd); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`close`); + this.fdMap.delete(fd); + const [zipFs, realFd] = entry; + return await zipFs.closePromise(realFd); + } + closeSync(fd) { + if ((fd & ZIP_MASK) !== ZIP_MAGIC) + return this.baseFs.closeSync(fd); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`closeSync`); + this.fdMap.delete(fd); + const [zipFs, realFd] = entry; + return zipFs.closeSync(realFd); + } + createReadStream(p, opts) { + if (p === null) + return this.baseFs.createReadStream(p, opts); + return this.makeCallSync(p, () => { + return this.baseFs.createReadStream(p, opts); + }, (zipFs, { archivePath, subPath }) => { + const stream = zipFs.createReadStream(subPath, opts); + stream.path = npath.fromPortablePath(this.pathUtils.join(archivePath, subPath)); + return stream; + }); + } + createWriteStream(p, opts) { + if (p === null) + return this.baseFs.createWriteStream(p, opts); + return this.makeCallSync(p, () => { + return this.baseFs.createWriteStream(p, opts); + }, (zipFs, { subPath }) => { + return zipFs.createWriteStream(subPath, opts); + }); + } + async realpathPromise(p) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.realpathPromise(p); + }, async (zipFs, { archivePath, subPath }) => { + let realArchivePath = this.realPaths.get(archivePath); + if (typeof realArchivePath === `undefined`) { + realArchivePath = await this.baseFs.realpathPromise(archivePath); + this.realPaths.set(archivePath, realArchivePath); + } + return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, await zipFs.realpathPromise(subPath))); + }); + } + realpathSync(p) { + return this.makeCallSync(p, () => { + return this.baseFs.realpathSync(p); + }, (zipFs, { archivePath, subPath }) => { + let realArchivePath = this.realPaths.get(archivePath); + if (typeof realArchivePath === `undefined`) { + realArchivePath = this.baseFs.realpathSync(archivePath); + this.realPaths.set(archivePath, realArchivePath); + } + return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, zipFs.realpathSync(subPath))); + }); + } + async existsPromise(p) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.existsPromise(p); + }, async (zipFs, { subPath }) => { + return await zipFs.existsPromise(subPath); + }); + } + existsSync(p) { + return this.makeCallSync(p, () => { + return this.baseFs.existsSync(p); + }, (zipFs, { subPath }) => { + return zipFs.existsSync(subPath); + }); + } + async accessPromise(p, mode) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.accessPromise(p, mode); + }, async (zipFs, { subPath }) => { + return await zipFs.accessPromise(subPath, mode); + }); + } + accessSync(p, mode) { + return this.makeCallSync(p, () => { + return this.baseFs.accessSync(p, mode); + }, (zipFs, { subPath }) => { + return zipFs.accessSync(subPath, mode); + }); + } + async statPromise(p, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.statPromise(p, opts); + }, async (zipFs, { subPath }) => { + return await zipFs.statPromise(subPath, opts); + }); + } + statSync(p, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.statSync(p, opts); + }, (zipFs, { subPath }) => { + return zipFs.statSync(subPath, opts); + }); + } + async fstatPromise(fd, opts) { + if ((fd & ZIP_MASK) !== ZIP_MAGIC) + return this.baseFs.fstatPromise(fd, opts); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`fstat`); + const [zipFs, realFd] = entry; + return zipFs.fstatPromise(realFd, opts); + } + fstatSync(fd, opts) { + if ((fd & ZIP_MASK) !== ZIP_MAGIC) + return this.baseFs.fstatSync(fd, opts); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`fstatSync`); + const [zipFs, realFd] = entry; + return zipFs.fstatSync(realFd, opts); + } + async lstatPromise(p, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.lstatPromise(p, opts); + }, async (zipFs, { subPath }) => { + return await zipFs.lstatPromise(subPath, opts); + }); + } + lstatSync(p, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.lstatSync(p, opts); + }, (zipFs, { subPath }) => { + return zipFs.lstatSync(subPath, opts); + }); + } + async fchmodPromise(fd, mask) { + if ((fd & ZIP_MASK) !== ZIP_MAGIC) + return this.baseFs.fchmodPromise(fd, mask); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`fchmod`); + const [zipFs, realFd] = entry; + return zipFs.fchmodPromise(realFd, mask); + } + fchmodSync(fd, mask) { + if ((fd & ZIP_MASK) !== ZIP_MAGIC) + return this.baseFs.fchmodSync(fd, mask); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`fchmodSync`); + const [zipFs, realFd] = entry; + return zipFs.fchmodSync(realFd, mask); + } + async chmodPromise(p, mask) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.chmodPromise(p, mask); + }, async (zipFs, { subPath }) => { + return await zipFs.chmodPromise(subPath, mask); + }); + } + chmodSync(p, mask) { + return this.makeCallSync(p, () => { + return this.baseFs.chmodSync(p, mask); + }, (zipFs, { subPath }) => { + return zipFs.chmodSync(subPath, mask); + }); + } + async fchownPromise(fd, uid, gid) { + if ((fd & ZIP_MASK) !== ZIP_MAGIC) + return this.baseFs.fchownPromise(fd, uid, gid); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`fchown`); + const [zipFs, realFd] = entry; + return zipFs.fchownPromise(realFd, uid, gid); + } + fchownSync(fd, uid, gid) { + if ((fd & ZIP_MASK) !== ZIP_MAGIC) + return this.baseFs.fchownSync(fd, uid, gid); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`fchownSync`); + const [zipFs, realFd] = entry; + return zipFs.fchownSync(realFd, uid, gid); + } + async chownPromise(p, uid, gid) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.chownPromise(p, uid, gid); + }, async (zipFs, { subPath }) => { + return await zipFs.chownPromise(subPath, uid, gid); + }); + } + chownSync(p, uid, gid) { + return this.makeCallSync(p, () => { + return this.baseFs.chownSync(p, uid, gid); + }, (zipFs, { subPath }) => { + return zipFs.chownSync(subPath, uid, gid); + }); + } + async renamePromise(oldP, newP) { + return await this.makeCallPromise(oldP, async () => { + return await this.makeCallPromise(newP, async () => { + return await this.baseFs.renamePromise(oldP, newP); + }, async () => { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); + }); + }, async (zipFsO, { subPath: subPathO }) => { + return await this.makeCallPromise(newP, async () => { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); + }, async (zipFsN, { subPath: subPathN }) => { + if (zipFsO !== zipFsN) { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); + } else { + return await zipFsO.renamePromise(subPathO, subPathN); + } + }); + }); + } + renameSync(oldP, newP) { + return this.makeCallSync(oldP, () => { + return this.makeCallSync(newP, () => { + return this.baseFs.renameSync(oldP, newP); + }, () => { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); + }); + }, (zipFsO, { subPath: subPathO }) => { + return this.makeCallSync(newP, () => { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); + }, (zipFsN, { subPath: subPathN }) => { + if (zipFsO !== zipFsN) { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); + } else { + return zipFsO.renameSync(subPathO, subPathN); + } + }); + }); + } + async copyFilePromise(sourceP, destP, flags = 0) { + const fallback = async (sourceFs, sourceP2, destFs, destP2) => { + if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) + throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); + if (flags & fs.constants.COPYFILE_EXCL && await this.existsPromise(sourceP2)) + throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); + let content; + try { + content = await sourceFs.readFilePromise(sourceP2); + } catch (error) { + throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); + } + await destFs.writeFilePromise(destP2, content); + }; + return await this.makeCallPromise(sourceP, async () => { + return await this.makeCallPromise(destP, async () => { + return await this.baseFs.copyFilePromise(sourceP, destP, flags); + }, async (zipFsD, { subPath: subPathD }) => { + return await fallback(this.baseFs, sourceP, zipFsD, subPathD); + }); + }, async (zipFsS, { subPath: subPathS }) => { + return await this.makeCallPromise(destP, async () => { + return await fallback(zipFsS, subPathS, this.baseFs, destP); + }, async (zipFsD, { subPath: subPathD }) => { + if (zipFsS !== zipFsD) { + return await fallback(zipFsS, subPathS, zipFsD, subPathD); + } else { + return await zipFsS.copyFilePromise(subPathS, subPathD, flags); + } + }); + }); + } + copyFileSync(sourceP, destP, flags = 0) { + const fallback = (sourceFs, sourceP2, destFs, destP2) => { + if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) + throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); + if (flags & fs.constants.COPYFILE_EXCL && this.existsSync(sourceP2)) + throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); + let content; + try { + content = sourceFs.readFileSync(sourceP2); + } catch (error) { + throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); + } + destFs.writeFileSync(destP2, content); + }; + return this.makeCallSync(sourceP, () => { + return this.makeCallSync(destP, () => { + return this.baseFs.copyFileSync(sourceP, destP, flags); + }, (zipFsD, { subPath: subPathD }) => { + return fallback(this.baseFs, sourceP, zipFsD, subPathD); + }); + }, (zipFsS, { subPath: subPathS }) => { + return this.makeCallSync(destP, () => { + return fallback(zipFsS, subPathS, this.baseFs, destP); + }, (zipFsD, { subPath: subPathD }) => { + if (zipFsS !== zipFsD) { + return fallback(zipFsS, subPathS, zipFsD, subPathD); + } else { + return zipFsS.copyFileSync(subPathS, subPathD, flags); + } + }); + }); + } + async appendFilePromise(p, content, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.appendFilePromise(p, content, opts); + }, async (zipFs, { subPath }) => { + return await zipFs.appendFilePromise(subPath, content, opts); + }); + } + appendFileSync(p, content, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.appendFileSync(p, content, opts); + }, (zipFs, { subPath }) => { + return zipFs.appendFileSync(subPath, content, opts); + }); + } + async writeFilePromise(p, content, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.writeFilePromise(p, content, opts); + }, async (zipFs, { subPath }) => { + return await zipFs.writeFilePromise(subPath, content, opts); + }); + } + writeFileSync(p, content, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.writeFileSync(p, content, opts); + }, (zipFs, { subPath }) => { + return zipFs.writeFileSync(subPath, content, opts); + }); + } + async unlinkPromise(p) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.unlinkPromise(p); + }, async (zipFs, { subPath }) => { + return await zipFs.unlinkPromise(subPath); + }); + } + unlinkSync(p) { + return this.makeCallSync(p, () => { + return this.baseFs.unlinkSync(p); + }, (zipFs, { subPath }) => { + return zipFs.unlinkSync(subPath); + }); + } + async utimesPromise(p, atime, mtime) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.utimesPromise(p, atime, mtime); + }, async (zipFs, { subPath }) => { + return await zipFs.utimesPromise(subPath, atime, mtime); + }); + } + utimesSync(p, atime, mtime) { + return this.makeCallSync(p, () => { + return this.baseFs.utimesSync(p, atime, mtime); + }, (zipFs, { subPath }) => { + return zipFs.utimesSync(subPath, atime, mtime); + }); + } + async mkdirPromise(p, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.mkdirPromise(p, opts); + }, async (zipFs, { subPath }) => { + return await zipFs.mkdirPromise(subPath, opts); + }); + } + mkdirSync(p, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.mkdirSync(p, opts); + }, (zipFs, { subPath }) => { + return zipFs.mkdirSync(subPath, opts); + }); + } + async rmdirPromise(p, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.rmdirPromise(p, opts); + }, async (zipFs, { subPath }) => { + return await zipFs.rmdirPromise(subPath, opts); + }); + } + rmdirSync(p, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.rmdirSync(p, opts); + }, (zipFs, { subPath }) => { + return zipFs.rmdirSync(subPath, opts); + }); + } + async linkPromise(existingP, newP) { + return await this.makeCallPromise(newP, async () => { + return await this.baseFs.linkPromise(existingP, newP); + }, async (zipFs, { subPath }) => { + return await zipFs.linkPromise(existingP, subPath); + }); + } + linkSync(existingP, newP) { + return this.makeCallSync(newP, () => { + return this.baseFs.linkSync(existingP, newP); + }, (zipFs, { subPath }) => { + return zipFs.linkSync(existingP, subPath); + }); + } + async symlinkPromise(target, p, type) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.symlinkPromise(target, p, type); + }, async (zipFs, { subPath }) => { + return await zipFs.symlinkPromise(target, subPath); + }); + } + symlinkSync(target, p, type) { + return this.makeCallSync(p, () => { + return this.baseFs.symlinkSync(target, p, type); + }, (zipFs, { subPath }) => { + return zipFs.symlinkSync(target, subPath); + }); + } + async readFilePromise(p, encoding) { + return this.makeCallPromise(p, async () => { + switch (encoding) { + case `utf8`: + return await this.baseFs.readFilePromise(p, encoding); + default: + return await this.baseFs.readFilePromise(p, encoding); + } + }, async (zipFs, { subPath }) => { + return await zipFs.readFilePromise(subPath, encoding); + }); + } + readFileSync(p, encoding) { + return this.makeCallSync(p, () => { + switch (encoding) { + case `utf8`: + return this.baseFs.readFileSync(p, encoding); + default: + return this.baseFs.readFileSync(p, encoding); + } + }, (zipFs, { subPath }) => { + return zipFs.readFileSync(subPath, encoding); + }); + } + async readdirPromise(p, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.readdirPromise(p, opts); + }, async (zipFs, { subPath }) => { + return await zipFs.readdirPromise(subPath, opts); + }, { + requireSubpath: false + }); + } + readdirSync(p, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.readdirSync(p, opts); + }, (zipFs, { subPath }) => { + return zipFs.readdirSync(subPath, opts); + }, { + requireSubpath: false + }); + } + async readlinkPromise(p) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.readlinkPromise(p); + }, async (zipFs, { subPath }) => { + return await zipFs.readlinkPromise(subPath); + }); + } + readlinkSync(p) { + return this.makeCallSync(p, () => { + return this.baseFs.readlinkSync(p); + }, (zipFs, { subPath }) => { + return zipFs.readlinkSync(subPath); + }); + } + async truncatePromise(p, len) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.truncatePromise(p, len); + }, async (zipFs, { subPath }) => { + return await zipFs.truncatePromise(subPath, len); + }); + } + truncateSync(p, len) { + return this.makeCallSync(p, () => { + return this.baseFs.truncateSync(p, len); + }, (zipFs, { subPath }) => { + return zipFs.truncateSync(subPath, len); + }); + } + async ftruncatePromise(fd, len) { + if ((fd & ZIP_MASK) !== ZIP_MAGIC) + return this.baseFs.ftruncatePromise(fd, len); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`ftruncate`); + const [zipFs, realFd] = entry; + return zipFs.ftruncatePromise(realFd, len); + } + ftruncateSync(fd, len) { + if ((fd & ZIP_MASK) !== ZIP_MAGIC) + return this.baseFs.ftruncateSync(fd, len); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`ftruncateSync`); + const [zipFs, realFd] = entry; + return zipFs.ftruncateSync(realFd, len); + } + watch(p, a, b) { + return this.makeCallSync(p, () => { + return this.baseFs.watch( + p, + a, + b + ); + }, (zipFs, { subPath }) => { + return zipFs.watch( + subPath, + a, + b + ); + }); + } + watchFile(p, a, b) { + return this.makeCallSync(p, () => { + return this.baseFs.watchFile( + p, + a, + b + ); + }, () => { + return watchFile(this, p, a, b); + }); + } + unwatchFile(p, cb) { + return this.makeCallSync(p, () => { + return this.baseFs.unwatchFile(p, cb); + }, () => { + return unwatchFile(this, p, cb); + }); + } + async makeCallPromise(p, discard, accept, { requireSubpath = true } = {}) { + if (typeof p !== `string`) + return await discard(); + const normalizedP = this.resolve(p); + const zipInfo = this.findZip(normalizedP); + if (!zipInfo) + return await discard(); + if (requireSubpath && zipInfo.subPath === `/`) + return await discard(); + return await this.getZipPromise(zipInfo.archivePath, async (zipFs) => await accept(zipFs, zipInfo)); + } + makeCallSync(p, discard, accept, { requireSubpath = true } = {}) { + if (typeof p !== `string`) + return discard(); + const normalizedP = this.resolve(p); + const zipInfo = this.findZip(normalizedP); + if (!zipInfo) + return discard(); + if (requireSubpath && zipInfo.subPath === `/`) + return discard(); + return this.getZipSync(zipInfo.archivePath, (zipFs) => accept(zipFs, zipInfo)); + } + findZip(p) { + if (this.filter && !this.filter.test(p)) + return null; + let filePath = ``; + while (true) { + const pathPartWithArchive = p.substring(filePath.length); + let archivePart; + if (!this.fileExtensions) { + archivePart = getArchivePart(pathPartWithArchive, `.zip`); + } else { + for (const ext of this.fileExtensions) { + archivePart = getArchivePart(pathPartWithArchive, ext); + if (archivePart) { + break; + } + } + } + if (!archivePart) + return null; + filePath = this.pathUtils.join(filePath, archivePart); + if (this.isZip.has(filePath) === false) { + if (this.notZip.has(filePath)) + continue; + try { + if (!this.baseFs.lstatSync(filePath).isFile()) { + this.notZip.add(filePath); + continue; + } + } catch { + return null; + } + this.isZip.add(filePath); + } + return { + archivePath: filePath, + subPath: this.pathUtils.join(PortablePath.root, p.substring(filePath.length)) + }; + } + } + limitOpenFiles(max) { + if (this.zipInstances === null) + return; + const now = Date.now(); + let nextExpiresAt = now + this.maxAge; + let closeCount = max === null ? 0 : this.zipInstances.size - max; + for (const [path, { zipFs, expiresAt, refCount }] of this.zipInstances.entries()) { + if (refCount !== 0 || zipFs.hasOpenFileHandles()) { + continue; + } else if (now >= expiresAt) { + zipFs.saveAndClose(); + this.zipInstances.delete(path); + closeCount -= 1; + continue; + } else if (max === null || closeCount <= 0) { + nextExpiresAt = expiresAt; + break; + } + zipFs.saveAndClose(); + this.zipInstances.delete(path); + closeCount -= 1; + } + if (this.limitOpenFilesTimeout === null && (max === null && this.zipInstances.size > 0 || max !== null)) { + this.limitOpenFilesTimeout = setTimeout(() => { + this.limitOpenFilesTimeout = null; + this.limitOpenFiles(null); + }, nextExpiresAt - now).unref(); + } + } + async getZipPromise(p, accept) { + const getZipOptions = async () => ({ + baseFs: this.baseFs, + libzip: this.libzip, + readOnly: this.readOnlyArchives, + stats: await this.baseFs.statPromise(p) + }); + if (this.zipInstances) { + let cachedZipFs = this.zipInstances.get(p); + if (!cachedZipFs) { + const zipOptions = await getZipOptions(); + cachedZipFs = this.zipInstances.get(p); + if (!cachedZipFs) { + cachedZipFs = { + zipFs: new ZipFS(p, zipOptions), + expiresAt: 0, + refCount: 0 + }; + } + } + this.zipInstances.delete(p); + this.limitOpenFiles(this.maxOpenFiles - 1); + this.zipInstances.set(p, cachedZipFs); + cachedZipFs.expiresAt = Date.now() + this.maxAge; + cachedZipFs.refCount += 1; + try { + return await accept(cachedZipFs.zipFs); + } finally { + cachedZipFs.refCount -= 1; + } + } else { + const zipFs = new ZipFS(p, await getZipOptions()); + try { + return await accept(zipFs); + } finally { + zipFs.saveAndClose(); + } + } + } + getZipSync(p, accept) { + const getZipOptions = () => ({ + baseFs: this.baseFs, + libzip: this.libzip, + readOnly: this.readOnlyArchives, + stats: this.baseFs.statSync(p) + }); + if (this.zipInstances) { + let cachedZipFs = this.zipInstances.get(p); + if (!cachedZipFs) { + cachedZipFs = { + zipFs: new ZipFS(p, getZipOptions()), + expiresAt: 0, + refCount: 0 + }; + } + this.zipInstances.delete(p); + this.limitOpenFiles(this.maxOpenFiles - 1); + this.zipInstances.set(p, cachedZipFs); + cachedZipFs.expiresAt = Date.now() + this.maxAge; + return accept(cachedZipFs.zipFs); + } else { + const zipFs = new ZipFS(p, getZipOptions()); + try { + return accept(zipFs); + } finally { + zipFs.saveAndClose(); + } + } + } +} + +class NodePathFS extends ProxiedFS { + constructor(baseFs) { + super(npath); + this.baseFs = baseFs; + } + mapFromBase(path) { + return path; + } + mapToBase(path) { + if (typeof path === `string`) + return path; + if (path instanceof url.URL) + return url.fileURLToPath(path); + if (Buffer.isBuffer(path)) { + const str = path.toString(); + if (Buffer.byteLength(str) !== path.byteLength) + throw new Error(`Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942`); + return str; + } + throw new Error(`Unsupported path type: ${nodeUtils.inspect(path)}`); + } +} + +var _a, _b, _c, _d; +const kBaseFs = Symbol(`kBaseFs`); +const kFd = Symbol(`kFd`); +const kClosePromise = Symbol(`kClosePromise`); +const kCloseResolve = Symbol(`kCloseResolve`); +const kCloseReject = Symbol(`kCloseReject`); +const kRefs = Symbol(`kRefs`); +const kRef = Symbol(`kRef`); +const kUnref = Symbol(`kUnref`); +class FileHandle { + constructor(fd, baseFs) { + this[_a] = 1; + this[_b] = void 0; + this[_c] = void 0; + this[_d] = void 0; + this[kBaseFs] = baseFs; + this[kFd] = fd; + } + get fd() { + return this[kFd]; + } + async appendFile(data, options) { + var _a2; + try { + this[kRef](this.appendFile); + const encoding = (_a2 = typeof options === `string` ? options : options == null ? void 0 : options.encoding) != null ? _a2 : void 0; + return await this[kBaseFs].appendFilePromise(this.fd, data, encoding ? { encoding } : void 0); + } finally { + this[kUnref](); + } + } + async chown(uid, gid) { + try { + this[kRef](this.chown); + return await this[kBaseFs].fchownPromise(this.fd, uid, gid); + } finally { + this[kUnref](); + } + } + async chmod(mode) { + try { + this[kRef](this.chmod); + return await this[kBaseFs].fchmodPromise(this.fd, mode); + } finally { + this[kUnref](); + } + } + createReadStream(options) { + return this[kBaseFs].createReadStream(null, { ...options, fd: this.fd }); + } + createWriteStream(options) { + return this[kBaseFs].createWriteStream(null, { ...options, fd: this.fd }); + } + datasync() { + throw new Error(`Method not implemented.`); + } + sync() { + throw new Error(`Method not implemented.`); + } + async read(bufferOrOptions, offset, length, position) { + var _a2, _b2, _c2; + try { + this[kRef](this.read); + let buffer; + if (!Buffer.isBuffer(bufferOrOptions)) { + bufferOrOptions != null ? bufferOrOptions : bufferOrOptions = {}; + buffer = (_a2 = bufferOrOptions.buffer) != null ? _a2 : Buffer.alloc(16384); + offset = bufferOrOptions.offset || 0; + length = (_b2 = bufferOrOptions.length) != null ? _b2 : buffer.byteLength; + position = (_c2 = bufferOrOptions.position) != null ? _c2 : null; + } else { + buffer = bufferOrOptions; + } + offset != null ? offset : offset = 0; + length != null ? length : length = 0; + if (length === 0) { + return { + bytesRead: length, + buffer + }; + } + const bytesRead = await this[kBaseFs].readPromise(this.fd, buffer, offset, length, position); + return { + bytesRead, + buffer + }; + } finally { + this[kUnref](); + } + } + async readFile(options) { + var _a2; + try { + this[kRef](this.readFile); + const encoding = (_a2 = typeof options === `string` ? options : options == null ? void 0 : options.encoding) != null ? _a2 : void 0; + return await this[kBaseFs].readFilePromise(this.fd, encoding); + } finally { + this[kUnref](); + } + } + readLines(options) { + return readline.createInterface({ + input: this.createReadStream(options), + crlfDelay: Infinity + }); + } + async stat(opts) { + try { + this[kRef](this.stat); + return await this[kBaseFs].fstatPromise(this.fd, opts); + } finally { + this[kUnref](); + } + } + async truncate(len) { + try { + this[kRef](this.truncate); + return await this[kBaseFs].ftruncatePromise(this.fd, len); + } finally { + this[kUnref](); + } + } + utimes(atime, mtime) { + throw new Error(`Method not implemented.`); + } + async writeFile(data, options) { + var _a2; + try { + this[kRef](this.writeFile); + const encoding = (_a2 = typeof options === `string` ? options : options == null ? void 0 : options.encoding) != null ? _a2 : void 0; + await this[kBaseFs].writeFilePromise(this.fd, data, encoding); + } finally { + this[kUnref](); + } + } + async write(...args) { + try { + this[kRef](this.write); + if (ArrayBuffer.isView(args[0])) { + const [buffer, offset, length, position] = args; + const bytesWritten = await this[kBaseFs].writePromise(this.fd, buffer, offset != null ? offset : void 0, length != null ? length : void 0, position != null ? position : void 0); + return { bytesWritten, buffer }; + } else { + const [data, position, encoding] = args; + const bytesWritten = await this[kBaseFs].writePromise(this.fd, data, position, encoding); + return { bytesWritten, buffer: data }; + } + } finally { + this[kUnref](); + } + } + async writev(buffers, position) { + try { + this[kRef](this.writev); + let bytesWritten = 0; + if (typeof position !== `undefined`) { + for (const buffer of buffers) { + const writeResult = await this.write(buffer, void 0, void 0, position); + bytesWritten += writeResult.bytesWritten; + position += writeResult.bytesWritten; + } + } else { + for (const buffer of buffers) { + const writeResult = await this.write(buffer); + bytesWritten += writeResult.bytesWritten; + } + } + return { + buffers, + bytesWritten + }; + } finally { + this[kUnref](); + } + } + readv(buffers, position) { + throw new Error(`Method not implemented.`); + } + close() { + if (this[kFd] === -1) + return Promise.resolve(); + if (this[kClosePromise]) + return this[kClosePromise]; + this[kRefs]--; + if (this[kRefs] === 0) { + const fd = this[kFd]; + this[kFd] = -1; + this[kClosePromise] = this[kBaseFs].closePromise(fd).finally(() => { + this[kClosePromise] = void 0; + }); + } else { + this[kClosePromise] = new Promise((resolve, reject) => { + this[kCloseResolve] = resolve; + this[kCloseReject] = reject; + }).finally(() => { + this[kClosePromise] = void 0; + this[kCloseReject] = void 0; + this[kCloseResolve] = void 0; + }); + } + return this[kClosePromise]; + } + [(_a = kRefs, _b = kClosePromise, _c = kCloseResolve, _d = kCloseReject, kRef)](caller) { + if (this[kFd] === -1) { + const err = new Error(`file closed`); + err.code = `EBADF`; + err.syscall = caller.name; + throw err; + } + this[kRefs]++; + } + [kUnref]() { + this[kRefs]--; + if (this[kRefs] === 0) { + const fd = this[kFd]; + this[kFd] = -1; + this[kBaseFs].closePromise(fd).then(this[kCloseResolve], this[kCloseReject]); + } + } +} + +const SYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ + `accessSync`, + `appendFileSync`, + `createReadStream`, + `createWriteStream`, + `chmodSync`, + `fchmodSync`, + `chownSync`, + `fchownSync`, + `closeSync`, + `copyFileSync`, + `linkSync`, + `lstatSync`, + `fstatSync`, + `lutimesSync`, + `mkdirSync`, + `openSync`, + `opendirSync`, + `readlinkSync`, + `readFileSync`, + `readdirSync`, + `readlinkSync`, + `realpathSync`, + `renameSync`, + `rmdirSync`, + `statSync`, + `symlinkSync`, + `truncateSync`, + `ftruncateSync`, + `unlinkSync`, + `unwatchFile`, + `utimesSync`, + `watch`, + `watchFile`, + `writeFileSync`, + `writeSync` +]); +const ASYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ + `accessPromise`, + `appendFilePromise`, + `fchmodPromise`, + `chmodPromise`, + `fchownPromise`, + `chownPromise`, + `closePromise`, + `copyFilePromise`, + `linkPromise`, + `fstatPromise`, + `lstatPromise`, + `lutimesPromise`, + `mkdirPromise`, + `openPromise`, + `opendirPromise`, + `readdirPromise`, + `realpathPromise`, + `readFilePromise`, + `readdirPromise`, + `readlinkPromise`, + `renamePromise`, + `rmdirPromise`, + `statPromise`, + `symlinkPromise`, + `truncatePromise`, + `ftruncatePromise`, + `unlinkPromise`, + `utimesPromise`, + `writeFilePromise`, + `writeSync` +]); +function patchFs(patchedFs, fakeFs) { + fakeFs = new NodePathFS(fakeFs); + const setupFn = (target, name, replacement) => { + const orig = target[name]; + target[name] = replacement; + if (typeof (orig == null ? void 0 : orig[nodeUtils.promisify.custom]) !== `undefined`) { + replacement[nodeUtils.promisify.custom] = orig[nodeUtils.promisify.custom]; + } + }; + { + setupFn(patchedFs, `exists`, (p, ...args) => { + const hasCallback = typeof args[args.length - 1] === `function`; + const callback = hasCallback ? args.pop() : () => { + }; + process.nextTick(() => { + fakeFs.existsPromise(p).then((exists) => { + callback(exists); + }, () => { + callback(false); + }); + }); + }); + setupFn(patchedFs, `read`, (...args) => { + let [fd, buffer, offset, length, position, callback] = args; + if (args.length <= 3) { + let options = {}; + if (args.length < 3) { + callback = args[1]; + } else { + options = args[1]; + callback = args[2]; + } + ({ + buffer = Buffer.alloc(16384), + offset = 0, + length = buffer.byteLength, + position + } = options); + } + if (offset == null) + offset = 0; + length |= 0; + if (length === 0) { + process.nextTick(() => { + callback(null, 0, buffer); + }); + return; + } + if (position == null) + position = -1; + process.nextTick(() => { + fakeFs.readPromise(fd, buffer, offset, length, position).then((bytesRead) => { + callback(null, bytesRead, buffer); + }, (error) => { + callback(error, 0, buffer); + }); + }); + }); + for (const fnName of ASYNC_IMPLEMENTATIONS) { + const origName = fnName.replace(/Promise$/, ``); + if (typeof patchedFs[origName] === `undefined`) + continue; + const fakeImpl = fakeFs[fnName]; + if (typeof fakeImpl === `undefined`) + continue; + const wrapper = (...args) => { + const hasCallback = typeof args[args.length - 1] === `function`; + const callback = hasCallback ? args.pop() : () => { + }; + process.nextTick(() => { + fakeImpl.apply(fakeFs, args).then((result) => { + callback(null, result); + }, (error) => { + callback(error); + }); + }); + }; + setupFn(patchedFs, origName, wrapper); + } + patchedFs.realpath.native = patchedFs.realpath; + } + { + setupFn(patchedFs, `existsSync`, (p) => { + try { + return fakeFs.existsSync(p); + } catch (error) { + return false; + } + }); + setupFn(patchedFs, `readSync`, (...args) => { + let [fd, buffer, offset, length, position] = args; + if (args.length <= 3) { + const options = args[2] || {}; + ({ offset = 0, length = buffer.byteLength, position } = options); + } + if (offset == null) + offset = 0; + length |= 0; + if (length === 0) + return 0; + if (position == null) + position = -1; + return fakeFs.readSync(fd, buffer, offset, length, position); + }); + for (const fnName of SYNC_IMPLEMENTATIONS) { + const origName = fnName; + if (typeof patchedFs[origName] === `undefined`) + continue; + const fakeImpl = fakeFs[fnName]; + if (typeof fakeImpl === `undefined`) + continue; + setupFn(patchedFs, origName, fakeImpl.bind(fakeFs)); + } + patchedFs.realpathSync.native = patchedFs.realpathSync; + } + { + const origEmitWarning = process.emitWarning; + process.emitWarning = () => { + }; + let patchedFsPromises; + try { + patchedFsPromises = patchedFs.promises; + } finally { + process.emitWarning = origEmitWarning; + } + if (typeof patchedFsPromises !== `undefined`) { + for (const fnName of ASYNC_IMPLEMENTATIONS) { + const origName = fnName.replace(/Promise$/, ``); + if (typeof patchedFsPromises[origName] === `undefined`) + continue; + const fakeImpl = fakeFs[fnName]; + if (typeof fakeImpl === `undefined`) + continue; + if (fnName === `open`) + continue; + setupFn(patchedFsPromises, origName, (pathLike, ...args) => { + if (pathLike instanceof FileHandle) { + return pathLike[origName].apply(pathLike, args); + } else { + return fakeImpl.call(fakeFs, pathLike, ...args); + } + }); + } + setupFn(patchedFsPromises, `open`, async (...args) => { + const fd = await fakeFs.openPromise(...args); + return new FileHandle(fd, fakeFs); + }); + } + } + { + patchedFs.read[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { + const res = fakeFs.readPromise(fd, buffer, ...args); + return { bytesRead: await res, buffer }; + }; + patchedFs.write[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { + const res = fakeFs.writePromise(fd, buffer, ...args); + return { bytesWritten: await res, buffer }; + }; + } +} + +var libzipSync = {exports: {}}; + +(function (module, exports) { +var frozenFs = Object.assign({}, fs__default.default); +var createModule = function() { + var _scriptDir = void 0; + if (typeof __filename !== "undefined") + _scriptDir = _scriptDir || __filename; + return function(createModule2) { + createModule2 = createModule2 || {}; + var Module = typeof createModule2 !== "undefined" ? createModule2 : {}; + var readyPromiseResolve, readyPromiseReject; + Module["ready"] = new Promise(function(resolve, reject) { + readyPromiseResolve = resolve; + readyPromiseReject = reject; + }); + var moduleOverrides = {}; + var key; + for (key in Module) { + if (Module.hasOwnProperty(key)) { + moduleOverrides[key] = Module[key]; + } + } + var scriptDirectory = ""; + function locateFile(path) { + if (Module["locateFile"]) { + return Module["locateFile"](path, scriptDirectory); + } + return scriptDirectory + path; + } + var read_, readBinary; + var nodeFS; + var nodePath; + { + { + scriptDirectory = __dirname + "/"; + } + read_ = function shell_read(filename, binary) { + var ret = tryParseAsDataURI(filename); + if (ret) { + return binary ? ret : ret.toString(); + } + if (!nodeFS) + nodeFS = frozenFs; + if (!nodePath) + nodePath = path__default.default; + filename = nodePath["normalize"](filename); + return nodeFS["readFileSync"](filename, binary ? null : "utf8"); + }; + readBinary = function readBinary2(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret); + } + assert(ret.buffer); + return ret; + }; + if (process["argv"].length > 1) { + process["argv"][1].replace(/\\/g, "/"); + } + process["argv"].slice(2); + Module["inspect"] = function() { + return "[Emscripten Module object]"; + }; + } + var out = Module["print"] || console.log.bind(console); + var err = Module["printErr"] || console.warn.bind(console); + for (key in moduleOverrides) { + if (moduleOverrides.hasOwnProperty(key)) { + Module[key] = moduleOverrides[key]; + } + } + moduleOverrides = null; + if (Module["arguments"]) + ; + if (Module["thisProgram"]) + ; + if (Module["quit"]) + ; + var STACK_ALIGN = 16; + function alignMemory(size, factor) { + if (!factor) + factor = STACK_ALIGN; + return Math.ceil(size / factor) * factor; + } + var wasmBinary; + if (Module["wasmBinary"]) + wasmBinary = Module["wasmBinary"]; + Module["noExitRuntime"] || true; + if (typeof WebAssembly !== "object") { + abort("no native wasm support detected"); + } + function getValue(ptr, type, noSafe) { + type = type || "i8"; + if (type.charAt(type.length - 1) === "*") + type = "i32"; + switch (type) { + case "i1": + return HEAP8[ptr >> 0]; + case "i8": + return HEAP8[ptr >> 0]; + case "i16": + return HEAP16[ptr >> 1]; + case "i32": + return HEAP32[ptr >> 2]; + case "i64": + return HEAP32[ptr >> 2]; + case "float": + return HEAPF32[ptr >> 2]; + case "double": + return HEAPF64[ptr >> 3]; + default: + abort("invalid type for getValue: " + type); + } + return null; + } + var wasmMemory; + var ABORT = false; + function assert(condition, text) { + if (!condition) { + abort("Assertion failed: " + text); + } + } + function getCFunc(ident) { + var func = Module["_" + ident]; + assert( + func, + "Cannot call unknown function " + ident + ", make sure it is exported" + ); + return func; + } + function ccall(ident, returnType, argTypes, args, opts) { + var toC = { + string: function(str) { + var ret2 = 0; + if (str !== null && str !== void 0 && str !== 0) { + var len = (str.length << 2) + 1; + ret2 = stackAlloc(len); + stringToUTF8(str, ret2, len); + } + return ret2; + }, + array: function(arr) { + var ret2 = stackAlloc(arr.length); + writeArrayToMemory(arr, ret2); + return ret2; + } + }; + function convertReturnValue(ret2) { + if (returnType === "string") + return UTF8ToString(ret2); + if (returnType === "boolean") + return Boolean(ret2); + return ret2; + } + var func = getCFunc(ident); + var cArgs = []; + var stack = 0; + if (args) { + for (var i = 0; i < args.length; i++) { + var converter = toC[argTypes[i]]; + if (converter) { + if (stack === 0) + stack = stackSave(); + cArgs[i] = converter(args[i]); + } else { + cArgs[i] = args[i]; + } + } + } + var ret = func.apply(null, cArgs); + ret = convertReturnValue(ret); + if (stack !== 0) + stackRestore(stack); + return ret; + } + function cwrap(ident, returnType, argTypes, opts) { + argTypes = argTypes || []; + var numericArgs = argTypes.every(function(type) { + return type === "number"; + }); + var numericRet = returnType !== "string"; + if (numericRet && numericArgs && !opts) { + return getCFunc(ident); + } + return function() { + return ccall(ident, returnType, argTypes, arguments); + }; + } + var UTF8Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf8") : void 0; + function UTF8ArrayToString(heap, idx, maxBytesToRead) { + var endIdx = idx + maxBytesToRead; + var endPtr = idx; + while (heap[endPtr] && !(endPtr >= endIdx)) + ++endPtr; + if (endPtr - idx > 16 && heap.subarray && UTF8Decoder) { + return UTF8Decoder.decode(heap.subarray(idx, endPtr)); + } else { + var str = ""; + while (idx < endPtr) { + var u0 = heap[idx++]; + if (!(u0 & 128)) { + str += String.fromCharCode(u0); + continue; + } + var u1 = heap[idx++] & 63; + if ((u0 & 224) == 192) { + str += String.fromCharCode((u0 & 31) << 6 | u1); + continue; + } + var u2 = heap[idx++] & 63; + if ((u0 & 240) == 224) { + u0 = (u0 & 15) << 12 | u1 << 6 | u2; + } else { + u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63; + } + if (u0 < 65536) { + str += String.fromCharCode(u0); + } else { + var ch = u0 - 65536; + str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023); + } + } + } + return str; + } + function UTF8ToString(ptr, maxBytesToRead) { + return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : ""; + } + function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { + if (!(maxBytesToWrite > 0)) + return 0; + var startIdx = outIdx; + var endIdx = outIdx + maxBytesToWrite - 1; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) { + var u1 = str.charCodeAt(++i); + u = 65536 + ((u & 1023) << 10) | u1 & 1023; + } + if (u <= 127) { + if (outIdx >= endIdx) + break; + heap[outIdx++] = u; + } else if (u <= 2047) { + if (outIdx + 1 >= endIdx) + break; + heap[outIdx++] = 192 | u >> 6; + heap[outIdx++] = 128 | u & 63; + } else if (u <= 65535) { + if (outIdx + 2 >= endIdx) + break; + heap[outIdx++] = 224 | u >> 12; + heap[outIdx++] = 128 | u >> 6 & 63; + heap[outIdx++] = 128 | u & 63; + } else { + if (outIdx + 3 >= endIdx) + break; + heap[outIdx++] = 240 | u >> 18; + heap[outIdx++] = 128 | u >> 12 & 63; + heap[outIdx++] = 128 | u >> 6 & 63; + heap[outIdx++] = 128 | u & 63; + } + } + heap[outIdx] = 0; + return outIdx - startIdx; + } + function stringToUTF8(str, outPtr, maxBytesToWrite) { + return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); + } + function lengthBytesUTF8(str) { + var len = 0; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) + u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; + if (u <= 127) + ++len; + else if (u <= 2047) + len += 2; + else if (u <= 65535) + len += 3; + else + len += 4; + } + return len; + } + function allocateUTF8(str) { + var size = lengthBytesUTF8(str) + 1; + var ret = _malloc(size); + if (ret) + stringToUTF8Array(str, HEAP8, ret, size); + return ret; + } + function writeArrayToMemory(array, buffer2) { + HEAP8.set(array, buffer2); + } + function alignUp(x, multiple) { + if (x % multiple > 0) { + x += multiple - x % multiple; + } + return x; + } + var buffer, HEAP8, HEAPU8, HEAP16, HEAP32, HEAPF32, HEAPF64; + function updateGlobalBufferAndViews(buf) { + buffer = buf; + Module["HEAP8"] = HEAP8 = new Int8Array(buf); + Module["HEAP16"] = HEAP16 = new Int16Array(buf); + Module["HEAP32"] = HEAP32 = new Int32Array(buf); + Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); + Module["HEAPU16"] = new Uint16Array(buf); + Module["HEAPU32"] = new Uint32Array(buf); + Module["HEAPF32"] = HEAPF32 = new Float32Array(buf); + Module["HEAPF64"] = HEAPF64 = new Float64Array(buf); + } + Module["INITIAL_MEMORY"] || 16777216; + var wasmTable; + var __ATPRERUN__ = []; + var __ATINIT__ = []; + var __ATPOSTRUN__ = []; + function preRun() { + if (Module["preRun"]) { + if (typeof Module["preRun"] == "function") + Module["preRun"] = [Module["preRun"]]; + while (Module["preRun"].length) { + addOnPreRun(Module["preRun"].shift()); + } + } + callRuntimeCallbacks(__ATPRERUN__); + } + function initRuntime() { + if (!Module["noFSInit"] && !FS.init.initialized) + FS.init(); + callRuntimeCallbacks(__ATINIT__); + } + function postRun() { + if (Module["postRun"]) { + if (typeof Module["postRun"] == "function") + Module["postRun"] = [Module["postRun"]]; + while (Module["postRun"].length) { + addOnPostRun(Module["postRun"].shift()); + } + } + callRuntimeCallbacks(__ATPOSTRUN__); + } + function addOnPreRun(cb) { + __ATPRERUN__.unshift(cb); + } + function addOnInit(cb) { + __ATINIT__.unshift(cb); + } + function addOnPostRun(cb) { + __ATPOSTRUN__.unshift(cb); + } + var runDependencies = 0; + var dependenciesFulfilled = null; + function addRunDependency(id) { + runDependencies++; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies); + } + } + function removeRunDependency(id) { + runDependencies--; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies); + } + if (runDependencies == 0) { + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback(); + } + } + } + Module["preloadedImages"] = {}; + Module["preloadedAudios"] = {}; + function abort(what) { + if (Module["onAbort"]) { + Module["onAbort"](what); + } + what += ""; + err(what); + ABORT = true; + what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; + var e = new WebAssembly.RuntimeError(what); + readyPromiseReject(e); + throw e; + } + var dataURIPrefix = "data:application/octet-stream;base64,"; + function isDataURI(filename) { + return filename.startsWith(dataURIPrefix); + } + var wasmBinaryFile = "data:application/octet-stream;base64,AGFzbQEAAAABlAInYAF/AX9gA39/fwF/YAF/AGACf38Bf2ACf38AYAV/f39/fwF/YAR/f39/AX9gA39/fwBgBH9+f38Bf2AAAX9gBX9/f35/AX5gA39+fwF/YAF/AX5gAn9+AX9gBH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AiAAKAI8KAK8LXRyOwG4LSAAKAI8IgEgACgCECABKAK8LWo2ArwtCyAAIAAoAixBAWo2AiwMAQsLIAAoAjwgACgCPEGUAWogACgCOEEBaxC5ASAAKAI8IAAoAjxBiBNqIAAoAjRBAWsQuQEgAEFAayQAIAQoAiwgBCgCLEGUAWogBCgCLEGIE2oQuwELCyAEKAIsEL4BIAQoAiAEQCAEKAIsEL0BCyAEQTBqJAAL1AEBAX8jAEEgayICJAAgAiAANgIYIAIgATcDECACIAIoAhhFOgAPAkAgAigCGEUEQCACIAIpAxCnEBgiADYCGCAARQRAIAJBADYCHAwCCwsgAkEYEBgiADYCCCAARQRAIAItAA9BAXEEQCACKAIYEBULIAJBADYCHAwBCyACKAIIQQE6AAAgAigCCCACKAIYNgIEIAIoAgggAikDEDcDCCACKAIIQgA3AxAgAigCCCACLQAPQQFxOgABIAIgAigCCDYCHAsgAigCHCEAIAJBIGokACAAC3gBAX8jAEEQayIBJAAgASAANgIIIAEgASgCCEIEEB42AgQCQCABKAIERQRAIAFBADYCDAwBCyABIAEoAgQtAAAgASgCBC0AASABKAIELQACIAEoAgQtAANBCHRqQQh0akEIdGo2AgwLIAEoAgwhACABQRBqJAAgAAuHAwEBfyMAQTBrIgMkACADIAA2AiQgAyABNgIgIAMgAjcDGAJAIAMoAiQtAChBAXEEQCADQn83AygMAQsCQAJAIAMoAiQoAiBFDQAgAykDGEL///////////8AVg0AIAMpAxhQDQEgAygCIA0BCyADKAIkQQxqQRJBABAUIANCfzcDKAwBCyADKAIkLQA1QQFxBEAgA0J/NwMoDAELAn8jAEEQayIAIAMoAiQ2AgwgACgCDC0ANEEBcQsEQCADQgA3AygMAQsgAykDGFAEQCADQgA3AygMAQsgA0IANwMQA0AgAykDECADKQMYVARAIAMgAygCJCADKAIgIAMpAxCnaiADKQMYIAMpAxB9QQEQICICNwMIIAJCAFMEQCADKAIkQQE6ADUgAykDEFAEQCADQn83AygMBAsgAyADKQMQNwMoDAMLIAMpAwhQBEAgAyg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CfzcDCAwBCyABIAEoAgRBAEIAQQ0QIDcDCAsgASkDCCECIAFBEGokACACC6UCAQJ/IwBBIGsiAyQAIAMgADYCGCADIAE2AhQgAyACNwMIIAMoAhgoAgAhASADKAIUIQQgAykDCCECIwBBIGsiACQAIAAgATYCFCAAIAQ2AhAgACACNwMIAkACQCAAKAIUKAIkQQFGBEAgACkDCEL///////////8AWA0BCyAAKAIUQQxqQRJBABAUIABCfzcDGAwBCyAAIAAoAhQgACgCECAAKQMIQQsQIDcDGAsgACkDGCECIABBIGokACADIAI3AwACQCACQgBTBEAgAygCGEEIaiADKAIYKAIAEBcgA0F/NgIcDAELIAMpAwAgAykDCFIEQCADKAIYQQhqQQZBGxAUIANBfzYCHAwBCyADQQA2AhwLIAMoAhwhACADQSBqJAAgAAsxAQF/IwBBEGsiASQAIAEgADYCDCABKAIMBEAgASgCDBBSIAEoAgwQFQsgAUEQaiQACy8BAX8jAEEQayIBJAAgASAANgIMIAEoAgwoAggQFSABKAIMQQA2AgggAUEQaiQAC80BAQF/IwBBEGsiAiQAIAIgADYCCCACIAE2AgQCQCACKAIILQAoQQFxBEAgAkF/NgIMDAELIAIoAgRFBEAgAigCCEEMakESQQAQFCACQX82AgwMAQsgAigCBBA7IAIoAggoAgAEQCACKAIIKAIAIAIoAgQQOUEASARAIAIoAghBDGogAigCCCgCABAXIAJBfzYCDAwCCwsgAigCCCACKAIEQjhBAxAgQgBTBEAgAkF/NgIMDAELIAJBADYCDAsgAigCDCEAIAJBEGokACAAC98EAQF/IwBBIGsiAiAANgIYIAIgATYCFAJAIAIoAhhFBEAgAkEBNgIcDAELIAIgAigCGCgCADYCDAJAIAIoAhgoAggEQCACIAIoAhgoAgg2AhAMAQsgAkEBNgIQIAJBADYCCANAAkAgAigCCCACKAIYLwEETw0AAkAgAigCDCACKAIIai0AAEEfSwRAIAIoAgwgAigCCGotAABBgAFJDQELIAIoAgwgAigCCGotAABBDUYNACACKAIMIAIoAghqLQAAQQpGDQAgAigCDCACKA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YEQCADKAKYAUEBRg0BCyADKAKUAUEBRgRAIAMoApgBQQJGDQELIAMoApQBQQJHDQEgAygCmAFBAkcNAQsgAygCpAEiACAALwEMQYAQcjsBDAwBCyADKAKkASIAIAAvAQxB/+8DcTsBDCADKAKUAUECRgRAIANB9eABIAMoAqQBKAIwIAMoAqgBQQhqEI4BNgKQASADKAKQAUUEQCADQX82AqwBDAMLCwJAIAMoAqABQYACcQ0AIAMoApgBQQJHDQAgA0H1xgEgAygCpAEoAjggAygCqAFBCGoQjgE2AkggAygCSEUEQCADKAKQARAjIANBfzYCrAEMAwsgAygCSCADKAKQATYCACADIAMoAkg2ApABCwsCQCADKAKkAS8BUkUEQCADKAKkASIAIAAvAQxB/v8DcTsBDAwBCyADKAKkASIAIAAvAQxBAXI7AQwLIAMgAygCpAEgAygCoAEQZUEBcToAhgEgAyADKAKgAUGACnFBgApHBH8gAy0AhgEFQQELQQFxOgCHASADAn9BASADKAKkAS8BUkGBAkYNABpBASADKAKkAS8BUkGCAkYNABogAygCpAEvAVJBgwJGC0EBcToAhQEgAy0AhwFBAXEEQCADIANBIGpCHBApNgIcIAMoAhxFBEAgAygCqAFBCGpBDkEAEBQgAygCkAEQIyADQX82AqwBDAILAkAgAygCoAFBgAJxBEACQCADKAKgAUGACHENACADKAKkASkDIEL/////D1YNACADKAKkASkDKEL/////D1gNAgsgAygCHCADKAKkASkDKBAtIAMoAhwgAygCpAEpAyAQLQwBCwJAAkAgAygCoAFBgAhxDQAgAygCpAEpAyBC/////w9WDQAgAygCpAEpAyhC/////w9WDQAgAygCpAEpA0hC/////w9YDQELIAMoAqQBKQMoQv////8PWgRAIAMoAhwgAygCpAEpAygQLQsgAygCpAEpAyBC/////w9aBEAgAygCHCADKAKkASkDIBAtCyADKAKkASkDSEL/////D1oEQCADKAIcIAMoAqQBKQNIEC0LCwsCfyMAQRBrIgAgAygCHDYCDCAAKAIMLQAAQQFxRQsEQCADKAKoAUEIakEUQQAQFCADKAIcEBYgAygCkAEQIyADQX82AqwBDAILIANBAQJ/IwBBEGsiACADKAIcNgIMAn4gACgCDC0AAEEBcQRAIAAoAgwpAxAMAQtCAAunQf//A3ELIANBIGpBgAYQVTYCjAEgAygCHBAWIAMoAowBIAMoApABNgIAIAMgAygCjAE2ApABCyADLQCFAUEBcQRAIAMgA0EVakIHECk2AhAgAygCEEUEQCADKAKoAUEIakEOQQAQFCADKAKQARAjIANBfzYCrAEMAgsgAygCEEECEB8gAygCEEG9EkECEEEgAygCECADKAKkAS8BUkH/AXEQlgEgAygCECADKAKkASgCEEH//wNxEB8CfyMAQRBrIgAgAygCEDYCDCAAKAIMLQAAQQFxRQsEQCADKAKoAUEIakEUQQAQFCADKAIQEBYgAygCkAEQIyADQX82AqwBDAILIANBgbICQQcgA0EVakGABhBVNgIMIAMoAhAQFiADKAIMIAMoApABNgIAIAMgAygCDDYCkAELIAMgA0HQAGpCLhApIgA2AkwgAEUEQCADKAKoAUEIakEOQQAQFCADKAKQARAjIANBfzYCrAEMAQsgAygCTEHxEkH2EiADKAKgAUGAAnEbQQQQQSADKAKgAUGAAnFFBEAgAygCTCADLQCGAUEBcQR/QS0FIAMoAqQBLwEIC0H//wNxEB8LIAMoAkwgAy0AhgFBAXEEf0EtBSADKAKkAS8BCgtB//8DcRAfIAMoAkwgAygCpAEvAQwQHwJAIAMtAIUBQQFxBEAgAygCTEHjABAfDAELIAMoAkwgAygCpAEoAhBB//8DcRAfCyADKAKkASgCFCADQZ4BaiADQZwBahCNASADKAJMIAMvAZ4BEB8gAygCTCADLwGcARAfAkACQCADLQCFAUEBcUUNACADKAKkASkDKEIUWg0AIAMoAkxBABAhDAELIAMoAkwgAygCpAEoAhgQIQsCQAJAIAMoAqABQYACcUGAAkcNACADKAKkASkDIEL/////D1QEQCADKAKkASkDKEL/////D1QNAQsgAygCTEF/ECEgAygCTEF/ECEMAQsCQCADKAKkASkDIEL/////D1QEQCADKAJMIAMoAqQBKQMgpxAhDAELIAMoAkxBfxAhCwJAIAMoAqQBK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AgQpAyhRDQELAkACQCAAKAIELwEMQQhxRQ0AIAAoAgQoAhgNACAAKAIEKQMgQgBSDQAgACgCBCkDKFANAQsgAEF/NgIMDAILCyAAQQA2AgwLIAAoAgwhASAAQRBqJAAgAQsEQCADKAJ8QRVBABAUIAMQUiADQn83A4gBDAMFIAMoAoABKAIAIAMpA3CnQQR0aigCACgCNCADKAI0EJUBIQAgAygCgAEoAgAgAykDcKdBBHRqKAIAIAA2AjQgAygCgAEoAgAgAykDcKdBBHRqKAIAQQE6AAQgA0EANgI0IAMQUiADIAMpA3BCAXw3A3AMAgsACwsgAwJ+IAMpA2AgAykDaH1C////////////AFQEQCADKQNgIAMpA2h9DAELQv///////////wALNwOIAQsgAykDiAEhBCADQZABaiQAIAQL1AQBAX8jAEEgayIDJAAgAyAANgIYIAMgATYCFCADIAI2AhAgAygCECEBIwBBEGsiACQAIAAgATYCCCAAQdgAEBg2AgQCQCAAKAIERQRAIAAoAghBDkEAEBQgAEEANgIMDAELIAAoAgghAiMAQRBrIgEkACABIAI2AgggAUEYEBgiAjYCBAJAIAJFBEAgASgCCEEOQQAQFCABQQA2AgwMAQsgASgCBEEANgIAIAEoAgRCADcDCCABKAIEQQA2AhAgASABKAIENgIMCyABKAIMIQIgAUEQaiQAIAAoAgQgAjYCUCACRQRAIAAoAgQQFSAAQQA2AgwMAQsgACgCBEEANgIAIAAoAgRBADYCBCMAQRBrIgEgACgCBEEIajYCDCABKAIMQQA2AgAgASgCDEEANgIEIAEoAgxBADYCCCAAKAIEQQA2AhggACgCBEEANgIUIAAoAgRBADYCHCAAKAIEQQA2AiQgACgCBEEANgIgIAAoAgRBADoAKCAAKAIEQgA3AzggACgCBEIANwMwIAAoAgRBADYCQCAAKAIEQQA2AkggACgCBEEANgJEIAAoAgRBADYCTCAAKAIEQQA2AlQgACAAKAIENgIMCyAAKAIMIQEgAEEQaiQAIAMgASIANgIMAkAgAEUEQCADQQA2AhwMAQsgAygCDCADKAIYNgIAIAMoAgwgAygCFDY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wDQAJAIAMoAgwgAygCHCgC0ChKDQACQCADKAIMIAMoAhwoAtAoTg0AIAMoAhggAygCHCADKAIMQQJ0akHgFmooAgBBAnRqLwEAIAMoAhggAygCHEHcFmogAygCDEECdGooAgBBAnRqLwEATgRAIAMoAhggAygCHCADKAIMQQJ0akHgFmooAgBBAnRqLwEAIAMoAhggAygCHEHcFmogAygCDEECdGooAgBBAnRqLwEARw0BIAMoAhwgAygCDEECdGpB4BZqKAIAIAMoAhxB2Chqai0AACADKAIcQdwWaiADKAIMQQJ0aigCACADKAIcQdgoamotAABKDQELIAMgAygCDEEBajYCDAsgAygCGCADKAIQQQJ0ai8BACADKAIYIAMoAhxB3BZqIAMoAgxBAnRqKAIAQQJ0ai8BAEgNAAJAIAMoAhggAygCEEECdGovAQAgAygCGCADKAIcQdwWaiADKAIMQQJ0aigCAEECdGovAQBHDQAgAygCECADKAIcQdgoamotAAAgAygCHEHcFmogAygCDEECdGooAgAgAygCHEHYKGpqLQAASg0ADAELIAMoAhxB3BZqIAMoAhRBAnRqIAMoAhxB3BZqIAMoAgxBAnRqKAIANgIAIAMgAygCDDYCFCADIAMoAgxBAXQ2AgwMAQsLIAMoAhxB3BZqIAMoAhRBAnRqIAMoAhA2AgAL1xMBA38jAEEwayICJAAgAiAANgIsIAIgATYCKCACIAIoAigoAgA2AiQgAiACKAIoKAIIKAIANgIgIAIgAigCKCgCCCgCDDYCHCACQX82AhAgAigCLEEANgLQKCACKAIsQb0ENgLUKCACQQA2AhgDQCACKAIYIAIoAhxIBEACQCACKAIkIAIoAhhBAnRqLwEABEAgAiACKAIYIgE2AhAgAigCLEHcFmohAyACKAIsIgQoAtAoQQFqIQAgBCAANgLQKCAAQQJ0IANqIAE2AgAgAigCGCACKAIsQdgoampBADoAAAwBCyACKAIkIAIoAhhBAnRqQQA7AQILIAIgAigCGEEBajYCGAwBCwsDQCACKAIsKALQKEECSARAAkAgAigCEEECSARAIAIgAigCEEEBaiIANgIQDAELQQAhAAsgAigCLEHcFmohAyACKAIsIgQoAtAoQQFqIQEgBCABNgLQKCABQQJ0IANqIAA2AgAgAiAANgIMIAIoAiQgAigCDEECdGpBATsBACACKAIMIAIoAixB2ChqakEAOgAAIAIoAiwiACAAKAKoLUEBazYCqC0gAigCIARAIAIoAiwiACAAKAKsLSACKAIgIAIoAgxBAnRqLwECazYCrC0LDAELCyACKAIoIAIoAhA2AgQgAiACKAIsKALQKEECbTYCGANAIAIoAhhBAU4EQCACKAIsIAIoAiQgAigCGBB5IAIgAigCGEEBazYCGAwBCwsgAiACKAIcNgIMA0AgAiACKAIsKALgFjYCGCACKAIsQdwWaiEBIAIoAiwiAygC0CghACADIABBAWs2AtAoIAIoAiwgAEECdCABaigCADYC4BYgAigCLCACKAIkQQEQeSACIAIoAiwoAuAWNgIUIAIoAhghASACKAIsQdwWaiEDIAIoAiwiBCgC1ChBAWshACAEIAA2AtQoIABBAnQgA2ogATYCACACKAIUIQEgAigCLEHcFmohAyACKAIsIgQoAtQoQQFrIQAgBCAANgLUKCAAQQJ0IANqIAE2AgAgAigCJCACKAIMQQJ0aiACKAIkIAIoAhhBAnRqLwEAIAIoAiQgAigCFEECdGovAQBqOwEAIAIoAgwgAigCLEHYKGpqAn8gAigCGCACKAIsQdgoamotAAAgAigCFCACKAIsQdgoamotAABOBEAgAigCGCACKAIsQdgoamotAAAMAQsgAigCFCACKAIsQdgoamotAAALQQFqOgAAIAIoAiQgAigCFEECdGogAigCDCIAOwECIAIoAiQgAigCGEECdGogADsBAiACIAIoAgwiAEEBajYCDCACKAIsIAA2AuAWIAIoAiwgAigCJEEBEHkgAigCLCgC0ChBAk4NAAsgAigCLCgC4BYhASACKAIsQdwWaiEDIAIoAiwiBCgC1ChBAWshACAEIAA2AtQoIABBAnQgA2ogATYCACACKAIoIQEjAEFAaiIAIAIoAiw2AjwgACABNgI4IAAgACgCOCgCADYCNCAAIAAoAjgoAgQ2AjAgACAAKAI4KAIIKAIANgIsIAAgACgCOCgCCCgCBDYCKCAAIAAo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ADKAIANgIcCyADKAIcIQAgA0EgaiQAIAALtAIBAX8jAEEwayIDJAAgAyAANgIoIAMgATcDICADIAI2AhwCQCADKQMgUARAIANBAToALwwBCyADIAMoAigpAxAgAykDIHw3AwgCQCADKQMIIAMpAyBaBEAgAykDCEL/////AFgNAQsgAygCHEEOQQAQFCADQQA6AC8MAQsgAyADKAIoKAIAIAMpAwinQQR0EE4iADYCBCAARQRAIAMoAhxBDkEAEBQgA0EAOgAvDAELIAMoAiggAygCBDYCACADIAMoAigpAwg3AxADQCADKQMQIAMpAwhaRQRAIAMoAigoAgAgAykDEKdBBHRqELUBIAMgAykDEEIBfDcDEAwBCwsgAygCKCADKQMIIgE3AxAgAygCKCABNwMIIANBAToALwsgAy0AL0EBcSEAIANBMGokACAAC8wBAQF/IwBBIGsiAiQAIAIgADcDECACIAE2AgwgAkEwEBgiATYCCAJAIAFFBEAgAigCDEEOQQAQFCACQQA2AhwMAQsgAigCCEEANgIAIAIoAghCADcDECACKAIIQgA3AwggAigCCEIANwMgIAIoAghCADcDGCACKAIIQQA2AiggAigCCEEAOgAsIAIoAgggAikDECACKAIMEI8BQQFxRQRAIAIoAggQJSACQQA2AhwMAQsgAiACKAIINgIcCyACKAIcIQEgAkEgaiQAIAEL1gIBAX8jAEEgayIDJAAgAyAANgIYIAMgATYCFCADIAI2AhAgAyADQQxqQgQQKTYCCAJAIAMoAghFBEAgA0F/NgIcDAELA0AgAygCFARAIAMoAhQoAgQgAygCEHFBgAZxBEAgAygCCEIAECwaIAMoAgggAygCFC8BCBAfIAMoAgggAygCFC8BChAfAn8jAEEQayIAIAMoAgg2AgwgACgCDC0AAEEBcUULBEAgAygCGEEIakEUQQAQFCADKAIIEBYgA0F/NgIcDAQLIAMoAhggA0EMakIEEDZBAEgEQCADKAIIEBYgA0F/NgIcDAQLIAMoAhQvAQoEQCADKAIYIAMoAhQoAgwgAygCFC8BCq0QNkEASARAIAMoAggQFiADQX82AhwMBQsLCyADIAMoAhQoAgA2AhQMAQs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CyABIAEoAqgBQjggAUFAayABKAKQARBCIgU2AqQBIAVFBEAgAUEANgKsAQwCCyABQQE6ABcLIAEoAqQBQgQQHigAAEHQlpkwRwRAIAEoApABQRVBABAUIAEtABdBAXEEQCABKAKkARAWCyABQQA2AqwBDAELIAEgASgCpAEQMTcDMAJAIAEoApQBQQRxRQ0AIAEpAzAgASkDOHxCDHwgASkDmAEgASkDGHxRDQAgASgCkAFBFUEAEBQgAS0AF0EBcQRAIAEoAqQBEBYLIAFBADYCrAEMAQsgASgCpAFCBBAeGiABIAEoAqQBECo2AgwgASABKAKkARAqNgIEIAEoAhBB//8DRgRAIAEgASgCDDYCEAsgASgCCEH//wNGBEAgASABKAIENgIICwJAIAEoApQBQQRxRQ0AIAEoAgggASgCBEYEQCABKAIQIAEoAgxGDQELIAEoApABQRVBABAUIAEtABdBAXEEQCABKAKkARAWCyABQQA2AqwBDAELAkAgASgCEEUEQCABKAIIRQ0BCyABKAKQAUEBQQAQFCABLQAXQQFxBEAgASgCpAEQFgsgAUEANgKsAQwBCyABIAEoAqQBEDE3AyggASABKAKkARAxNwMgIAEpAyggASkDIFIEQCABKAKQAUEBQQAQFCABLQAXQQFxBEAgASgCpAEQFgsgAUEANgKsAQwBCyABIAEoAqQBEDE3AzAgASABKAKkARAxNwOAAQJ/IwBBEGsiBSABKAKkATYCDCAFKAIMLQAAQQFxRQsEQCABKAKQAUEUQQAQFCABLQAXQQFxBEAgASgCpAEQFgsgAUEANgKsAQwBCyABLQAXQQFxBEAgASgCpAEQFgsCQCABKQOAAUL///////////8AWARAIAEpA4ABIAEpA4ABIAEpAzB8WA0BCyABKAKQAUEEQRYQFCABQQA2AqwBDAELIAEpA4ABIAEpAzB8IAEpA5gBIAEpAzh8VgRAIAEoApABQRVBABAUIAFBADYCrAEMAQsCQCABKAKUAUEEcUUNACABKQOAASABKQMwfCABKQOYASABKQM4fFENACABKAKQAUEVQQAQFCABQQA2AqwBDAELIAEpAyggASkDMEIugFYEQCABKAKQAUEVQ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oLQAAIAIoAiwtAABHDQAgAiACKAIoIgBBAWo2AiggAC0AASACKAIsLQABRwRADAELIAIgAigCLEECajYCLCACIAIoAihBAWo2AigDQCACIAIoAiwiAEEBajYCLCAALQABIQEgAiACKAIoIgBBAWo2AigCf0EAIAAtAAEgAUcNABogAiACKAIsIgBBAWo2AiwgAC0AASEBIAIgAigCKCIAQQFqNgIoQQAgAC0AASABRw0AGiACIAIoAiwiAEEBajYCLCAALQABIQEgAiACKAIoIgBBAWo2AihBACAALQABIAFHDQAaIAIgAigCLCIAQQFqNgIsIAAtAAEhASACIAIoAigiAEEBajYCKEEAIAAtAAEgAUcNABogAiACKAIsIgBBAWo2AiwgAC0AASEBIAIgAigCKCIAQQFqNgIoQQAgAC0AASABRw0AGiACIAIoAiwiAEEBajYCLCAALQABIQEgAiACKAIoIgBBAWo2AihBACAALQABIAFHDQAaIAIgAigCLCIAQQFqNgIsIAAtAAEhASACIAIoAigiAEEBajYCKEEAIAAtAAEgAUcNABogAiACKAIsIgBBAWo2AiwgAC0AASEBIAIgAigCKCIAQQFqNgIoQQAgAC0AASABRw0AGiACKAIsIAIoAgxJC0EBcQ0ACyACQYICIAIoAgwgAigCLGtrNgIkIAIgAigCDEGCAms2AiwgAigCJCACKAIgSgRAIAIoAjggAigCNDYCcCACIAIoAiQ2AiAgAigCJCACKAIcTg0CIAIgAigCLCACKAIgQQFrai0AADoACyACIAIoAiwgAigCIGotAAA6AAoLCyACIAIoAhQgAigCNCACKAIQcUEBdGovAQAiATYCNEEAIQAgASACKAIYSwR/IAIgAigCMEEBayIANgIwIABBAEcFQQALQQFxDQELCwJAIAIoAiAgAigCOCgCdE0EQCACIAIoAiA2AjwMAQsgAiACKAI4KAJ0NgI8CyACKAI8C5IQAQF/IwBBMGsiAiQAIAIgADYCKCACIAE2AiQgAgJ/IAIoAigoAiwgAigCKCgCDEEFa0kEQCACKAIoKAIsDAELIAIoAigoAgxBBWsLNgIgIAJBADYCECACIAIoAigoAgAoAgQ2AgwDQAJAIAJB//8DNgIcIAIgAigCKCgCvC1BKmpBA3U2AhQgAigCKCgCACgCECACKAIUSQ0AIAIgAigCKCgCACgCECACKAIUazYCFCACIAIoAigoAmwgAigCKCgCXGs2AhggAigCHCACKAIYIAIoAigoAgAoAgRqSwRAIAIgAigCGCACKAIoKAIAKAIEajYCHAsgAigCHCACKAIUSwRAIAIgAigCFDYCHAsCQCACKAIcIAIoAiBPDQACQCACKAIcRQRAIAIoAiRBBEcNAQsgAigCJEUNACACKAIcIAIoAhggAigCKCgCACgCBGpGDQELDAELQQAhACACIAIoAiRBBEYEfyACKAIcIAIoAhggAigCKCgCACgCBGpGBUEAC0EBcTYCECACKAIoQQBBACACKAIQEF0gAigCKCgCCCACKAIoKAIUQQRraiACKAIcOgAAIAIoAigoAgggAigCKCgCFEEDa2ogAigCHEEIdjoAACACKAIoKAIIIAIoAigoAhRBAmtqIAIoAhxBf3M6AAAgAigCKCgCCCACKAIoKAIUQQFraiACKAIcQX9zQQh2OgAAIAIoAigoAgAQHCACKAIYBEAgAigCGCACKAIcSwRAIAIgAigCHDYCGAsgAigCKCgCACgCDCACKAIoKAI4IAIoAigoAlxqIAIoAhgQGRogAigCKCgCACIAIAIoAhggACgCDGo2AgwgAigCKCgCACIAIAAoAhAgAigCGGs2AhAgAigCKCgCACIAIAIoAhggACgCFGo2AhQgAigCKCIAIAIoAhggACgCXGo2AlwgAiACKAIcIAIoAhhrNgIcCyACKAIcBEAgAigCKCgCACACKAIoKAIAKAIMIAIoAhwQdhogAigCKCgCACIAIAIoAhwgACgCDGo2AgwgAigCKCgCACIAIAAoAhAgAigCHGs2AhAgAigCKCgCACIAIAIoAhwgACgCFGo2AhQLIAIoAhBFDQELCyACIAIoAgwgAigCKCgCACgCBGs2AgwgAigCDARAAkAgAigCDCACKAIoKAIsTwRAIAIoAihBAjYCsC0gAigCKCgCOCACKAIoKAIAKAIAIAIoAigoAixrIAIoAigoAiwQGRogAigCKCACKAIoKAIsNgJsDAELIAIoAgwg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CgCbCACKAIoKAJcazYCGAJAIAIoAhggAigCIEkEQCACKAIYRQRAIAIoAiRBBEcNAgsgAigCJEUNASACKAIoKAIAKAIEDQEgAigCGCACKAIUSw0BCyACAn8gAigCGCACKAIUSwRAIAIoAhQMAQsgAigCGAs2AhwgAgJ/QQAgAigCJEEERw0AGkEAIAIoAigoAgAoAgQNABogAigCHCACKAIYRgtBAXE2AhAgAigCKCACKAIoKAI4IAIoAigoAlxqIAIoAhwgAigCEBBdIAIoAigiACACKAIcIAAoAlxqNgJcIAIoAigoAgAQHAsgAkECQQAgAigCEBs2AiwLIAIoAiwhACACQTBqJAAgAAuyAgEBfyMAQRBrIgEkACABIAA2AggCQCABKAIIEHgEQCABQX42AgwMAQsgASABKAIIKAIcKAIENgIEIAEoAggoAhwoAggEQCABKAIIKAIoIAEoAggoAhwoAgggASgCCCgCJBEEAAsgASgCCCgCHCgCRARAIAEoAggoAiggASgCCCgCHCgCRCABKAIIKAIkEQQACyABKAIIKAIcKAJABEAgASgCCCgCKCABKAIIKAIcKAJAIAEoAggoAiQRBAALIAEoAggoAhwoAjgEQCABKAIIKAIoIAEoAggoAhwoAjggASgCCCgCJBEEAAsgASgCCCgCKCABKAIIKAIcIAEoAggoAiQRBAAgASgCCEEANgIcIAFBfUEAIAEoAgRB8QBGGzYCDAsgASgCDCEAIAFBEGokACAAC+sXAQJ/IwBB8ABrIgMgADYCbCADIAE2AmggAyACNgJkIANBfzYCXCADIAMoAmgvAQI2AlQgA0EANgJQIANBBzYCTCADQQQ2AkggAygCVEUEQCADQYoBNgJMIANBAzYCSAsgA0EANgJgA0AgAygCYCADKAJkSkUEQCADIAMoAlQ2AlggAyADKAJoIAMoAmBBAWpBAnRqLwECNgJUIAMgAygCUEEBaiIANgJQAkACQCADKAJMIABMDQAgAygCWCADKAJURw0ADAELAkAgAygCUCADKAJISARAA0AgAyADKAJsQfwUaiADKAJYQQJ0ai8BAjYCRAJAIAMoAmwoArwtQRAgAygCRGtKBEAgAyADKAJs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ADYCqAEgASgCqAEQOAJAAkAgASgCqAEoAgBBAE4EQCABKAKoASgCAEGAFCgCAEgNAQsgASABKAKoASgCADYCECABQSBqQY8SIAFBEGoQbyABQQA2AqQBIAEgAUEgajYCoAEMAQsgASABKAKoASgCAEECdEGAE2ooAgA2AqQBAkACQAJAAkAgASgCqAEoAgBBAnRBkBRqKAIAQQFrDgIAAQILIAEoAqgBKAIEIQJBkJkBKAIAIQRBACEAAkACQANAIAIgAEGgiAFqLQAARwRAQdcAIQMgAEEBaiIAQdcARw0BDAILCyAAIgMNAEGAiQEhAgwBC0GAiQEhAANAIAAtAAAhBSAAQQFqIgIhACAFDQAgAiEAIANBAWsiAw0ACwsgBCgCFBogASACNgKgAQwCCyMAQRBrIgAgASgCqAEoAgQ2AgwgAUEAIAAoAgxrQQJ0QajZAGooAgA2AqABDAELIAFBADYCoAELCwJAIAEoAqABRQRAIAEgASgCpAE2AqwBDAELIAEgASgCoAEQLgJ/IAEoAqQBBEAgASgCpAEQLkECagwBC0EAC2pBAWoQGCIANgIcIABFBEAgAUG4EygCADYCrAEMAQsgASgCHCEAAn8gASgCpAEEQCABKAKkAQwBC0H6EgshA0HfEkH6EiABKAKkARshAiABIAEoAqABNgIIIAEgAjYCBCABIAM2AgAgAEG+CiABEG8gASgCqAEgASgCHDYCCCABIAEoAhw2AqwBCyABKAKsASEAIAFBsAFqJAAgAAsIAEEBQTgQfwszAQF/IAAoAhQiAyABIAIgACgCECADayIBIAEgAksbIgEQGRogACAAKAIUIAFqNgIUIAILjwUCBn4BfyABIAEoAgBBD2pBcHEiAUEQajYCACAAAnwgASkDACEDIAEpAwghBiMAQSBrIggkAAJAIAZC////////////AIMiBEKAgICAgIDAgDx9IARCgICAgICAwP/DAH1UBEAgBkIEhiADQjyIhCEEIANC//////////8PgyIDQoGAgICAgICACFoEQCAEQoGAgICAgICAwAB8IQIMAgsgBEKAgICAgICAgEB9IQIgA0KAgICAgICAgAiFQgBSDQEgAiAEQgGDfCECDAELIANQIARCgICAgICAwP//AFQgBEKAgICAgIDA//8AURtFBEAgBkIEhiADQjyIhEL/////////A4NCgICAgICAgPz/AIQhAgwBC0KAgICAgICA+P8AIQIgBEL///////+//8MAVg0AQgAhAiAEQjCIpyIAQZH3AEkNACADIQIgBkL///////8/g0KAgICAgIDAAIQiBSEHAkAgAEGB9wBrIgFBwABxBEAgAiABQUBqrYYhB0IAIQIMAQsgAUUNACAHIAGtIgSGIAJBwAAgAWutiIQhByACIASGIQILIAggAjcDECAIIAc3AxgCQEGB+AAgAGsiAEHAAHEEQCAFIABBQGqtiCEDQgAhBQwBCyAARQ0AIAVBwAAgAGuthiADIACtIgKIhCEDIAUgAoghBQsgCCADNwMAIAggBTcDCCAIKQMIQgSGIAgpAwAiA0I8iIQhAiAIKQMQIAgpAxiEQgBSrSADQv//////////D4OEIgNCgYCAgICAgIAIWgRAIAJCAXwhAgwBCyADQoCAgICAgICACIVCAFINACACQgGDIAJ8IQILIAhBIGokACACIAZCgICAgICAgICAf4OEvws5AwALrRcDEn8CfgF8IwBBsARrIgkkACAJQQA2AiwCQCABvSIYQn9XBEBBASESQa4IIRMgAZoiAb0hGAwBCyAEQYAQcQRAQQEhEkGxCCETDAELQbQIQa8IIARBAXEiEhshEyASRSEXCwJAIBhCgICAgICAgPj/AINCgICAgICAgPj/AFEEQCAAQSAgAiASQQNqIg0gBEH//3txECYgACATIBIQIiAAQeQLQbUSIAVBIHEiAxtBjw1BuRIgAxsgASABYhtBAxAiDAELIAlBEGohEAJAAn8CQCABIAlBLGoQqQEiASABoCIBRAAAAAAAAAAAYgRAIAkgCSgCLCIGQQFrNgIsIAVBIHIiFEHhAEcNAQwDCyAFQSByIhRB4QBGDQIgCSgCLCELQQYgAyADQQBIGwwBCyAJIAZBHWsiCzYCLCABRAAAAAAAALBBoiEBQQYgAyADQQBIGwshCiAJQTBqIAlB0AJqIAtBAEgbIg4hBwNAIAcCfyABRAAAAAAAAPBBYyABRAAAAAAAAAAAZnEEQCABqwwBC0EACy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RFDQELIAEoAihBADYCYAJAIAEoAigoAnRBA0kNACABKAIoKAJsRQ0AIAEgASgCKCgCOCABKAIoKAJsakEBazYCGCABIAEoAhgtAAA2AhwgASgCHCECIAEgASgCGCIDQQFqNgIYAkAgAy0AASACRw0AIAEoAhwhAiABIAEoAhgiA0EBajYCGCADLQABIAJHDQAgASgCHCECIAEgASgCGCIDQQFqNgIYIAMtAAEgAkcNACABIAEoAigoAjggASgCKCgCbGpBggJqNgIUA0AgASgCHCECIAEgASgCGCIDQQFqNgIYAn9BACADLQABIAJHDQAaIAEoAhwhAiABIAEoAhgiA0EBajYCGEEAIAMtAAEgAkcNABogASgCHCECIAEgASgCGCIDQQFqNgIYQQAgAy0AASACRw0AGiABKAIcIQIgASABKAIYIgNBAWo2AhhBACADLQABIAJHDQAaIAEoAhwhAiABIAEoAhgiA0EBajYCGEEAIAMtAAEgAkcNABogASgCHCECIAEgASgCGCIDQQFqNgIYQQAgAy0AASACRw0AGiABKAIcIQIgASABKAIYIgNBAWo2AhhBACADLQABIAJHDQAaIAEoAhwhAiABIAEoAhgiA0EBajYCGEEAIAMtAAEgAkcNABogASgCGCABKAIUSQtBAXENAAsgASgCKEGCAiABKAIUIAEoAhhrazYCYCABKAIoKAJgIAEoAigoAnRLBEAgASgCKCABKAIoKAJ0NgJgCwsLAkAgASgCKCgCYEEDTwRAIAEgASgCKCgCYEEDazoAEyABQQE7ARAgASgCKCICKAKkLSACKAKgLUEBdGogAS8BEDsBACABLQATIQMgASgCKCICKAKYLSEEIAIgAigCoC0iAkEBajYCoC0gAiAEaiADOgAAIAEgAS8BEEEBazsBECABKAIoIAEtABNB0N0Aai0AAEECdGpBmAlqIgIgAi8BAEEBajsBACABKAIoQYgTagJ/IAEvARBBgAJJBEAgAS8BEC0A0FkMAQsgAS8BEEEHdkGAAmotANBZC0ECdGoiAiACLwEAQQFqOwEAIAEgASgCKCgCoC0gASgCKCgCnC1BAWtGNgIgIAEoAigiAiACKAJ0IAEoAigoAmBrNgJ0IAEoAigiAiABKAIoKAJgIAIoAmxqNgJsIAEoAihBADYCYAwBCyABIAEoAigiAigCOCACKAJsai0AADoADyABKAIoIgIoAqQtIAIoAqAtQQF0akEAOwEAIAEtAA8hAyABKAIoIgIoApgtIQQgAiACKAKgLSICQQFqNgKgLSACIARqIAM6AAAgASgCKCABLQAPQQJ0aiICIAIvAZQBQQFqOwGUASABIAEoAigoAqAtIAEoAigoApwtQQFrRjYCICABKAIoIgIgAigCdEEBazYCdCABKAIoIgIgAigCbEEBajYCbAsgASgCIARAIAEoAigCfyABKAIoKAJcQQBOBEAgASgCKCgCOCABKAIoKAJcagwBC0EACyABKAIoKAJsIAEoAigoAlxrQQAQKCABKAIoIAEoAigoAmw2AlwgASgCKCgCABAcIAEoAigoAgAoAhBFBEAgAUEANgIsDAQLCwwBCwsgASgCKEEANgK0LSABKAIkQQRGBEAgASgCKAJ/IAEoAigoAlxBAE4EQCABKAIoKAI4IAEoAigoAlxqDAELQQALIAEoAigoAmwgASgCKCgCXGtBARAoIAEoAiggASgCKCgCbDYCXCABKAIoKAIAEBwgASgCKCgCACgCEEUEQCABQQI2AiwMAgsgAUEDNgIsDAELIAEoAigoAqAtBEAgASgCKAJ/IAEoAigoAlxBAE4EQCABKAIoKAI4IAEoAigoAlxqDAELQQALIAEoAigoAmwgASgCKCgCXGtBABAoIAEoAiggASgCKCgCbDYCXCABKAIoKAIAEBwgASgCKCgCACgCEEUEQCABQQA2AiwMAgsLIAFBATYCLAsgASgCLCECIAFBMGokACACDAELIAAoAiwgACgCNCAAKAIsKAKEAUEMbEGA7wBqKAIIEQMACwsLNgIEAkAgACgCBEECRwRAIAAoAgRBA0cNAQsgACgCLEGaBTYCBAsCQCAAKAIEBEAgACgCBEECRw0BCyAAKAI4KAIQRQRAIAAoAixBfzYCKAsgAEEANgI8DAILIAAoAgRBAUYEQAJAIAAoAjRBAUYEQCAAKAIsIQIjAEEgayIBJAAgASACNgIcIAFBAzYCGAJAIAEoAhwoArwtQRAgAS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CDCAAKAJYIAAoAkA2AhAgACgCWCAAKAJMNgIAIAAoAlggACgCRDYCBCAAKAJQIAAoAjw2AjwgACgCUCAAKAI4NgJAIAAoAjAhAiMAQeAAayIBIAAoAlg2AlwgASACNgJYIAEgASgCXCgCHDYCVCABIAEoAlwoAgA2AlAgASABKAJQIAEoAlwoAgRBBWtqNgJMIAEgASgCXCgCDDYCSCABIAEoAkggASgCWCABKAJcKAIQa2s2AkQgASABKAJIIAEoAlwoAhBBgQJrajYCQCABIAEoAlQoAiw2AjwgASABKAJUKAIwNgI4IAEgASgCVCgCNDYCNCABIAEoAlQoAjg2AjAgASABKAJUKAI8NgIsIAEgASgCVCgCQDYCKCABIAEoAlQoAlA2AiQgASABKAJUKAJUNgIgIAFBASABKAJUKAJYdEEBazYCHCABQQEgASgCVCgCXHRBAWs2AhgDQCABKAIoQQ9JBEAgASABKAJQIgJBAWo2AlAgASABKAIsIAItAAAgASgCKHRqNgIsIAEgASgCKEEIajYCKCABIAEoAlAiAkEBajYCUCABIAEoAiwgAi0AACABKAIodGo2AiwgASABKAIoQQhqNgIoCyABIAEoAiQgASgCLCABKAIccUECdGooAQA2ARACQAJAA0AgASABLQARNgIMIAEgASgCLCABKAIMdjYCLCABIAEoAiggASgCDGs2AiggASABLQAQNgIMIAEoAgxFBEAgAS8BEiECIAEgASgCSCIDQQFqNgJIIAMgAjoAAAwCCyABKAIMQRBxBEAgASABLwESNgIIIAEgASgCDEEPcTYCDCABKAIMBEAgASgCKCABKAIMSQRAIAEgASgCUCICQQFqNgJQIAEgASgCLCACLQAAIAEoAih0ajYCLCABIAEoAihBCGo2AigLIAEgASgCCCABKAIsQQEgASgCDHRBAWtxajYCCCABIAEoAiwgASgCDHY2AiwgASABKAIoIAEoAgxrNgIoCyABKAIoQQ9JBEAgASABKAJQIgJBAWo2AlAgASABKAIsIAItAAAgASgCKHRqNgIsIAEgASgCKEEIajYCKCABIAEoAlAiAkEBajYCUCABIAEoAiwgAi0AACABKAIodGo2AiwgASABKAIoQQhqNgIoCyABIAEoAiAgASgCLCABKAIYcUECdGooAQA2ARACQANAIAEgAS0AETYCDCABIAEoAiwgASgCDHY2AiwgASABKAIoIAEoAgxrNgIoIAEgAS0AEDYCDCABKAIMQRBxBEAgASABLwESNgIEIAEgASgCDEEPcTYCDCABKAIoIAEoAgxJBEAgASABKAJQIgJBAWo2AlAgASABKAIsIAItAAAgASgCKHRqNgIsIAEgASgCKEEIajYCKCABKAIoIAEoAgxJBEAgASABKAJQIgJBAWo2AlAgASABKAIsIAItAAAgASgCKHRqNgIsIAEgASgCKEEIajYCKAsLIAEgASgCBCABKAIsQQEgASgCDHRBAWtxajYCBCABIAEoAiwgASgCDHY2AiwgASABKAIoIAEoAgxrNgIoIAEgASgCSCABKAJEazYCDAJAIAEoAgQgASgCDEsEQCABIAEoAgQgASgCDGs2AgwgASgCDCABKAI4SwRAIAEoAlQoAsQ3BEAgASgCXEHdDDYCGCABKAJUQdH+ADYCBAwKCwsgASABKAIwNgIAAkAgASgCNEUEQCABIAEoAgAgASgCPCABKAIMa2o2AgAgASgCDCABKAIISQRAIAEgASgCCCABKAIMazYCCANAIAEgASgCACICQQFqNgIAIAItAAAhAiABIAEoAkgiA0EBajYCSCADIAI6AAAgASABKAIMQQFrIgI2AgwgAg0ACyABIAEoAkggASgCBGs2AgALDAELAkAgASgCNCABKAIMSQRAIAEgASgCACABKAI8IAEoAjRqIAEoAgxrajYCACABIAEoAgwgASgCNGs2AgwgASgCDCABKAIISQRAIAEgASgCCCABKAIMazYCCANAIAEgASgCACICQQFqNgIAIAItAAAhAiABIAEoAkgiA0EBajYCSCADIAI6AAAgASABKAIMQQFrIgI2AgwgAg0ACyABIAEoAjA2AgAgASgCNCABKAIISQRAIAEgASgCNDYCDCABIAEoAgggASgCDGs2AggDQCABIAEoAgAiAkEBajYCACACLQAAIQIgASABKAJIIgNBAWo2AkggAyACOgAAIAEgASgCDEEBayICNgIMIAINAAsgASABKAJIIAEoAgRrNgIACwsMAQsgASABKAIAIAEoAjQgASgCDGtqNgIAIAEoAgwgASgCCEkEQCABIAEoAgggASgCDGs2AggDQCABIAEoAgAiAkEBajYCACACLQAAIQIgASABKAJIIgNBAWo2AkggAyACOgAAIAEgASgCDEEBayICNgIMIAINAAsgASABKAJIIAEoAgRrNgIACwsLA0AgASgCCEECSwRAIAEgASgCACICQQFqNgIAIAItAAAhAiABIAEoAkgiA0EBajYCSCADIAI6AAAgASABKAIAIgJBAWo2AgAgAi0AACECIAEgASgCSCIDQQFqNgJIIAMgAjoAACABIAEoAgAiAkEBajYCACACLQAAIQIgASABKAJIIgNBAWo2AkggAyACOgAAIAEgASgCCEEDazYCCAwBCwsMAQsgASABKAJIIAEoAgRrNgIAA0AgASABKAIAIgJBAWo2AgAgAi0AACECIAEgASgCSCIDQQFqNgJIIAMgAjoAACABIAEoAgAiAkEBajYCACACLQAAIQIgASABKAJIIgNBAWo2AkggAyACOgAAIAEgASgCACICQQFqNgIAIAItAAAhAiABIAEoAkgiA0EBajYCSCADIAI6AAAgASABKAIIQQNrNgIIIAEoAghBAksNAAsLIAEoAggEQCABIAEoAgAiAkEBajYCACACLQAAIQIgASABKAJIIgNBAWo2AkggAyACOgAAIAEoAghBAUsEQCABIAEoAgAiAkEBajYCACACLQAAIQIgASABKAJIIgNBAWo2AkggAyACOgAACwsMAgsgASgCDEHAAHFFBEAgASABKAIgIAEvARIgASgCLEEBIAEoAgx0QQFrcWpBAnRqKAEANgEQDAELCyABKAJcQYUPNgIYIAEoAlRB0f4ANgIEDAQLDAILIAEoAgxBwABxRQRAIAEgASgCJCABLwESIAEoAixBASABKAIMdEEBa3FqQQJ0aigBADYBEAwBCwsgASgCDEEgcQRAIAEoAlRBv/4ANgIEDAILIAEoAlxB6Q42AhggASgCVEHR/gA2AgQMAQsgASgCUCABKAJMSQR/IAEoAkggASgCQEkFQQALQQFxDQELCyABIAEoAihBA3Y2AgggASABKAJQIAEoAghrNgJQIAEgASgCKCABKAIIQQN0azYCKCABIAEoAixBAS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ASABMAEwATABMAFAAUABQAFAAVABUAFQAVABAATQDKAAAAAQACAAMABAAFAAcACQANABEAGQAhADEAQQBhAIEAwQABAYEBAQIBAwEEAQYBCAEMARABGAEgATABQAFgAAAAABAAEAAQABAAEQARABIAEgATABMAFAAUABUAFQAWABYAFwAXABgAGAAZABkAGgAaABsAGwAcABwAHQAdAEAAQAAQABEAEgAAAAgABwAJAAYACgAFAAsABAAMAAMADQACAA4AAQAPAEGw8gALwRFgBwAAAAhQAAAIEAAUCHMAEgcfAAAIcAAACDAAAAnAABAHCgAACGAAAAggAAAJoAAACAAAAAiAAAAIQAAACeAAEAcGAAAIWAAACBgAAAmQABMHOwAACHgAAAg4AAAJ0AARBxEAAAhoAAAIKAAACbAAAAgIAAAIiAAACEgAAAnwABAHBAAACFQAAAgUABUI4wATBysAAAh0AAAINAAACcgAEQcNAAAIZAAACCQAAAmoAAAIBAAACIQAAAhEAAAJ6AAQBwgAAAhcAAAIHAAACZgAFAdTAAAIfAAACDwAAAnYABIHFwAACGwAAAgsAAAJuAAACAwAAAiMAAAITAAACfgAEAcDAAAIUgAACBIAFQijABMHIwAACHIAAAgyAAAJxAARBwsAAAhiAAAIIgAACaQAAAgCAAAIggAACEIAAAnkABAHBwAACFoAAAgaAAAJlAAUB0MAAAh6AAAIOgAACdQAEgcTAAAIagAACCoAAAm0AAAICgAACIoAAAhKAAAJ9AAQBwUAAAhWAAAIFgBACAAAEwczAAAIdgAACDYAAAnMABEHDwAACGYAAAgmAAAJrAAACAYAAAiGAAAIRgAACewAEAcJAAAIXgAACB4AAAmcABQHYwAACH4AAAg+AAAJ3AASBxsAAAhuAAAILgAACbwAAAgOAAAIjgAACE4AAAn8AGAHAAAACFEAAAgRABUIgwASBx8AAAhxAAAIMQAACcIAEAcKAAAIYQAACCEAAAmiAAAIAQAACIEAAAhBAAAJ4gAQBwYAAAhZAAAIGQAACZIAEwc7AAAIeQAACDkAAAnSABEHEQAACGkAAAgpAAAJsgAACAkAAAiJAAAISQAACf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inaryFile = locateFile(wasmBinaryFile); + } + function getBinary(file) { + try { + if (file == wasmBinaryFile && wasmBinary) { + return new Uint8Array(wasmBinary); + } + var binary = tryParseAsDataURI(file); + if (binary) { + return binary; + } + if (readBinary) { + return readBinary(file); + } else { + throw "sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"; + } + } catch (err2) { + abort(err2); + } + } + function instantiateSync(file, info) { + var instance; + var module2; + var binary; + try { + binary = getBinary(file); + module2 = new WebAssembly.Module(binary); + instance = new WebAssembly.Instance(module2, info); + } catch (e) { + var str = e.toString(); + err("failed to compile wasm module: " + str); + if (str.includes("imported Memory") || str.includes("memory import")) { + err( + "Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)." + ); + } + throw e; + } + return [instance, module2]; + } + function createWasm() { + var info = { a: asmLibraryArg }; + function receiveInstance(instance, module2) { + var exports3 = instance.exports; + Module["asm"] = exports3; + wasmMemory = Module["asm"]["u"]; + updateGlobalBufferAndViews(wasmMemory.buffer); + wasmTable = Module["asm"]["pa"]; + addOnInit(Module["asm"]["v"]); + removeRunDependency(); + } + addRunDependency(); + if (Module["instantiateWasm"]) { + try { + var exports2 = Module["instantiateWasm"](info, receiveInstance); + return exports2; + } catch (e) { + err("Module.instantiateWasm callback failed with error: " + e); + return false; + } + } + var result = instantiateSync(wasmBinaryFile, info); + receiveInstance(result[0]); + return Module["asm"]; + } + var tempDouble; + var tempI64; + function callRuntimeCallbacks(callbacks) { + while (callbacks.length > 0) { + var callback = callbacks.shift(); + if (typeof callback == "function") { + callback(Module); + continue; + } + var func = callback.func; + if (typeof func === "number") { + if (callback.arg === void 0) { + wasmTable.get(func)(); + } else { + wasmTable.get(func)(callback.arg); + } + } else { + func(callback.arg === void 0 ? null : callback.arg); + } + } + } + function _gmtime_r(time, tmPtr) { + var date = new Date(HEAP32[time >> 2] * 1e3); + HEAP32[tmPtr >> 2] = date.getUTCSeconds(); + HEAP32[tmPtr + 4 >> 2] = date.getUTCMinutes(); + HEAP32[tmPtr + 8 >> 2] = date.getUTCHours(); + HEAP32[tmPtr + 12 >> 2] = date.getUTCDate(); + HEAP32[tmPtr + 16 >> 2] = date.getUTCMonth(); + HEAP32[tmPtr + 20 >> 2] = date.getUTCFullYear() - 1900; + HEAP32[tmPtr + 24 >> 2] = date.getUTCDay(); + HEAP32[tmPtr + 36 >> 2] = 0; + HEAP32[tmPtr + 32 >> 2] = 0; + var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); + var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; + HEAP32[tmPtr + 28 >> 2] = yday; + if (!_gmtime_r.GMTString) + _gmtime_r.GMTString = allocateUTF8("GMT"); + HEAP32[tmPtr + 40 >> 2] = _gmtime_r.GMTString; + return tmPtr; + } + function ___gmtime_r(a0, a1) { + return _gmtime_r(a0, a1); + } + var PATH = { + splitPath: function(filename) { + var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; + return splitPathRe.exec(filename).slice(1); + }, + normalizeArray: function(parts, allowAboveRoot) { + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === ".") { + parts.splice(i, 1); + } else if (last === "..") { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + if (allowAboveRoot) { + for (; up; up--) { + parts.unshift(".."); + } + } + return parts; + }, + normalize: function(path) { + var isAbsolute = path.charAt(0) === "/", trailingSlash = path.substr(-1) === "/"; + path = PATH.normalizeArray( + path.split("/").filter(function(p) { + return !!p; + }), + !isAbsolute + ).join("/"); + if (!path && !isAbsolute) { + path = "."; + } + if (path && trailingSlash) { + path += "/"; + } + return (isAbsolute ? "/" : "") + path; + }, + dirname: function(path) { + var result = PATH.splitPath(path), root = result[0], dir = result[1]; + if (!root && !dir) { + return "."; + } + if (dir) { + dir = dir.substr(0, dir.length - 1); + } + return root + dir; + }, + basename: function(path) { + if (path === "/") + return "/"; + path = PATH.normalize(path); + path = path.replace(/\/$/, ""); + var lastSlash = path.lastIndexOf("/"); + if (lastSlash === -1) + return path; + return path.substr(lastSlash + 1); + }, + extname: function(path) { + return PATH.splitPath(path)[3]; + }, + join: function() { + var paths = Array.prototype.slice.call(arguments, 0); + return PATH.normalize(paths.join("/")); + }, + join2: function(l, r) { + return PATH.normalize(l + "/" + r); + } + }; + function getRandomDevice() { + { + try { + var crypto_module = require("crypto"); + return function() { + return crypto_module["randomBytes"](1)[0]; + }; + } catch (e) { + } + } + return function() { + abort("randomDevice"); + }; + } + var PATH_FS = { + resolve: function() { + var resolvedPath = "", resolvedAbsolute = false; + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = i >= 0 ? arguments[i] : FS.cwd(); + if (typeof path !== "string") { + throw new TypeError("Arguments to path.resolve must be strings"); + } else if (!path) { + return ""; + } + resolvedPath = path + "/" + resolvedPath; + resolvedAbsolute = path.charAt(0) === "/"; + } + resolvedPath = PATH.normalizeArray( + resolvedPath.split("/").filter(function(p) { + return !!p; + }), + !resolvedAbsolute + ).join("/"); + return (resolvedAbsolute ? "/" : "") + resolvedPath || "."; + }, + relative: function(from, to) { + from = PATH_FS.resolve(from).substr(1); + to = PATH_FS.resolve(to).substr(1); + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== "") + break; + } + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== "") + break; + } + if (start > end) + return []; + return arr.slice(start, end - start + 1); + } + var fromParts = trim(from.split("/")); + var toParts = trim(to.split("/")); + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push(".."); + } + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + return outputParts.join("/"); + } + }; + var TTY = { + ttys: [], + init: function() { + }, + shutdown: function() { + }, + register: function(dev, ops) { + TTY.ttys[dev] = { input: [], output: [], ops }; + FS.registerDevice(dev, TTY.stream_ops); + }, + stream_ops: { + open: function(stream) { + var tty = TTY.ttys[stream.node.rdev]; + if (!tty) { + throw new FS.ErrnoError(43); + } + stream.tty = tty; + stream.seekable = false; + }, + close: function(stream) { + stream.tty.ops.flush(stream.tty); + }, + flush: function(stream) { + stream.tty.ops.flush(stream.tty); + }, + read: function(stream, buffer2, offset, length, pos) { + if (!stream.tty || !stream.tty.ops.get_char) { + throw new FS.ErrnoError(60); + } + var bytesRead = 0; + for (var i = 0; i < length; i++) { + var result; + try { + result = stream.tty.ops.get_char(stream.tty); + } catch (e) { + throw new FS.ErrnoError(29); + } + if (result === void 0 && bytesRead === 0) { + throw new FS.ErrnoError(6); + } + if (result === null || result === void 0) + break; + bytesRead++; + buffer2[offset + i] = result; + } + if (bytesRead) { + stream.node.timestamp = Date.now(); + } + return bytesRead; + }, + write: function(stream, buffer2, offset, length, pos) { + if (!stream.tty || !stream.tty.ops.put_char) { + throw new FS.ErrnoError(60); + } + try { + for (var i = 0; i < length; i++) { + stream.tty.ops.put_char(stream.tty, buffer2[offset + i]); + } + } catch (e) { + throw new FS.ErrnoError(29); + } + if (length) { + stream.node.timestamp = Date.now(); + } + return i; + } + }, + default_tty_ops: { + get_char: function(tty) { + if (!tty.input.length) { + var result = null; + { + var BUFSIZE = 256; + var buf = Buffer.alloc ? Buffer.alloc(BUFSIZE) : new Buffer(BUFSIZE); + var bytesRead = 0; + try { + bytesRead = nodeFS.readSync( + process.stdin.fd, + buf, + 0, + BUFSIZE, + null + ); + } catch (e) { + if (e.toString().includes("EOF")) + bytesRead = 0; + else + throw e; + } + if (bytesRead > 0) { + result = buf.slice(0, bytesRead).toString("utf-8"); + } else { + result = null; + } + } + if (!result) { + return null; + } + tty.input = intArrayFromString(result, true); + } + return tty.input.shift(); + }, + put_char: function(tty, val) { + if (val === null || val === 10) { + out(UTF8ArrayToString(tty.output, 0)); + tty.output = []; + } else { + if (val != 0) + tty.output.push(val); + } + }, + flush: function(tty) { + if (tty.output && tty.output.length > 0) { + out(UTF8ArrayToString(tty.output, 0)); + tty.output = []; + } + } + }, + default_tty1_ops: { + put_char: function(tty, val) { + if (val === null || val === 10) { + err(UTF8ArrayToString(tty.output, 0)); + tty.output = []; + } else { + if (val != 0) + tty.output.push(val); + } + }, + flush: function(tty) { + if (tty.output && tty.output.length > 0) { + err(UTF8ArrayToString(tty.output, 0)); + tty.output = []; + } + } + } + }; + function mmapAlloc(size) { + var alignedSize = alignMemory(size, 65536); + var ptr = _malloc(alignedSize); + while (size < alignedSize) + HEAP8[ptr + size++] = 0; + return ptr; + } + var MEMFS = { + ops_table: null, + mount: function(mount) { + return MEMFS.createNode(null, "/", 16384 | 511, 0); + }, + createNode: function(parent, name, mode, dev) { + if (FS.isBlkdev(mode) || FS.isFIFO(mode)) { + throw new FS.ErrnoError(63); + } + if (!MEMFS.ops_table) { + MEMFS.ops_table = { + dir: { + node: { + getattr: MEMFS.node_ops.getattr, + setattr: MEMFS.node_ops.setattr, + lookup: MEMFS.node_ops.lookup, + mknod: MEMFS.node_ops.mknod, + rename: MEMFS.node_ops.rename, + unlink: MEMFS.node_ops.unlink, + rmdir: MEMFS.node_ops.rmdir, + readdir: MEMFS.node_ops.readdir, + symlink: MEMFS.node_ops.symlink + }, + stream: { llseek: MEMFS.stream_ops.llseek } + }, + file: { + node: { + getattr: MEMFS.node_ops.getattr, + setattr: MEMFS.node_ops.setattr + }, + stream: { + llseek: MEMFS.stream_ops.llseek, + read: MEMFS.stream_ops.read, + write: MEMFS.stream_ops.write, + allocate: MEMFS.stream_ops.allocate, + mmap: MEMFS.stream_ops.mmap, + msync: MEMFS.stream_ops.msync + } + }, + link: { + node: { + getattr: MEMFS.node_ops.getattr, + setattr: MEMFS.node_ops.setattr, + readlink: MEMFS.node_ops.readlink + }, + stream: {} + }, + chrdev: { + node: { + getattr: MEMFS.node_ops.getattr, + setattr: MEMFS.node_ops.setattr + }, + stream: FS.chrdev_stream_ops + } + }; + } + var node = FS.createNode(parent, name, mode, dev); + if (FS.isDir(node.mode)) { + node.node_ops = MEMFS.ops_table.dir.node; + node.stream_ops = MEMFS.ops_table.dir.stream; + node.contents = {}; + } else if (FS.isFile(node.mode)) { + node.node_ops = MEMFS.ops_table.file.node; + node.stream_ops = MEMFS.ops_table.file.stream; + node.usedBytes = 0; + node.contents = null; + } else if (FS.isLink(node.mode)) { + node.node_ops = MEMFS.ops_table.link.node; + node.stream_ops = MEMFS.ops_table.link.stream; + } else if (FS.isChrdev(node.mode)) { + node.node_ops = MEMFS.ops_table.chrdev.node; + node.stream_ops = MEMFS.ops_table.chrdev.stream; + } + node.timestamp = Date.now(); + if (parent) { + parent.contents[name] = node; + parent.timestamp = node.timestamp; + } + return node; + }, + getFileDataAsTypedArray: function(node) { + if (!node.contents) + return new Uint8Array(0); + if (node.contents.subarray) + return node.contents.subarray(0, node.usedBytes); + return new Uint8Array(node.contents); + }, + expandFileStorage: function(node, newCapacity) { + var prevCapacity = node.contents ? node.contents.length : 0; + if (prevCapacity >= newCapacity) + return; + var CAPACITY_DOUBLING_MAX = 1024 * 1024; + newCapacity = Math.max( + newCapacity, + prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2 : 1.125) >>> 0 + ); + if (prevCapacity != 0) + newCapacity = Math.max(newCapacity, 256); + var oldContents = node.contents; + node.contents = new Uint8Array(newCapacity); + if (node.usedBytes > 0) + node.contents.set(oldContents.subarray(0, node.usedBytes), 0); + }, + resizeFileStorage: function(node, newSize) { + if (node.usedBytes == newSize) + return; + if (newSize == 0) { + node.contents = null; + node.usedBytes = 0; + } else { + var oldContents = node.contents; + node.contents = new Uint8Array(newSize); + if (oldContents) { + node.contents.set( + oldContents.subarray(0, Math.min(newSize, node.usedBytes)) + ); + } + node.usedBytes = newSize; + } + }, + node_ops: { + getattr: function(node) { + var attr = {}; + attr.dev = FS.isChrdev(node.mode) ? node.id : 1; + attr.ino = node.id; + attr.mode = node.mode; + attr.nlink = 1; + attr.uid = 0; + attr.gid = 0; + attr.rdev = node.rdev; + if (FS.isDir(node.mode)) { + attr.size = 4096; + } else if (FS.isFile(node.mode)) { + attr.size = node.usedBytes; + } else if (FS.isLink(node.mode)) { + attr.size = node.link.length; + } else { + attr.size = 0; + } + attr.atime = new Date(node.timestamp); + attr.mtime = new Date(node.timestamp); + attr.ctime = new Date(node.timestamp); + attr.blksize = 4096; + attr.blocks = Math.ceil(attr.size / attr.blksize); + return attr; + }, + setattr: function(node, attr) { + if (attr.mode !== void 0) { + node.mode = attr.mode; + } + if (attr.timestamp !== void 0) { + node.timestamp = attr.timestamp; + } + if (attr.size !== void 0) { + MEMFS.resizeFileStorage(node, attr.size); + } + }, + lookup: function(parent, name) { + throw FS.genericErrors[44]; + }, + mknod: function(parent, name, mode, dev) { + return MEMFS.createNode(parent, name, mode, dev); + }, + rename: function(old_node, new_dir, new_name) { + if (FS.isDir(old_node.mode)) { + var new_node; + try { + new_node = FS.lookupNode(new_dir, new_name); + } catch (e) { + } + if (new_node) { + for (var i in new_node.contents) { + throw new FS.ErrnoError(55); + } + } + } + delete old_node.parent.contents[old_node.name]; + old_node.parent.timestamp = Date.now(); + old_node.name = new_name; + new_dir.contents[new_name] = old_node; + new_dir.timestamp = old_node.parent.timestamp; + old_node.parent = new_dir; + }, + unlink: function(parent, name) { + delete parent.contents[name]; + parent.timestamp = Date.now(); + }, + rmdir: function(parent, name) { + var node = FS.lookupNode(parent, name); + for (var i in node.contents) { + throw new FS.ErrnoError(55); + } + delete parent.contents[name]; + parent.timestamp = Date.now(); + }, + readdir: function(node) { + var entries = [".", ".."]; + for (var key2 in node.contents) { + if (!node.contents.hasOwnProperty(key2)) { + continue; + } + entries.push(key2); + } + return entries; + }, + symlink: function(parent, newname, oldpath) { + var node = MEMFS.createNode(parent, newname, 511 | 40960, 0); + node.link = oldpath; + return node; + }, + readlink: function(node) { + if (!FS.isLink(node.mode)) { + throw new FS.ErrnoError(28); + } + return node.link; + } + }, + stream_ops: { + read: function(stream, buffer2, offset, length, position) { + var contents = stream.node.contents; + if (position >= stream.node.usedBytes) + return 0; + var size = Math.min(stream.node.usedBytes - position, length); + if (size > 8 && contents.subarray) { + buffer2.set(contents.subarray(position, position + size), offset); + } else { + for (var i = 0; i < size; i++) + buffer2[offset + i] = contents[position + i]; + } + return size; + }, + write: function(stream, buffer2, offset, length, position, canOwn) { + if (buffer2.buffer === HEAP8.buffer) { + canOwn = false; + } + if (!length) + return 0; + var node = stream.node; + node.timestamp = Date.now(); + if (buffer2.subarray && (!node.contents || node.contents.subarray)) { + if (canOwn) { + node.contents = buffer2.subarray(offset, offset + length); + node.usedBytes = length; + return length; + } else if (node.usedBytes === 0 && position === 0) { + node.contents = buffer2.slice(offset, offset + length); + node.usedBytes = length; + return length; + } else if (position + length <= node.usedBytes) { + node.contents.set( + buffer2.subarray(offset, offset + length), + position + ); + return length; + } + } + MEMFS.expandFileStorage(node, position + length); + if (node.contents.subarray && buffer2.subarray) { + node.contents.set( + buffer2.subarray(offset, offset + length), + position + ); + } else { + for (var i = 0; i < length; i++) { + node.contents[position + i] = buffer2[offset + i]; + } + } + node.usedBytes = Math.max(node.usedBytes, position + length); + return length; + }, + llseek: function(stream, offset, whence) { + var position = offset; + if (whence === 1) { + position += stream.position; + } else if (whence === 2) { + if (FS.isFile(stream.node.mode)) { + position += stream.node.usedBytes; + } + } + if (position < 0) { + throw new FS.ErrnoError(28); + } + return position; + }, + allocate: function(stream, offset, length) { + MEMFS.expandFileStorage(stream.node, offset + length); + stream.node.usedBytes = Math.max( + stream.node.usedBytes, + offset + length + ); + }, + mmap: function(stream, address, length, position, prot, flags) { + if (address !== 0) { + throw new FS.ErrnoError(28); + } + if (!FS.isFile(stream.node.mode)) { + throw new FS.ErrnoError(43); + } + var ptr; + var allocated; + var contents = stream.node.contents; + if (!(flags & 2) && contents.buffer === buffer) { + allocated = false; + ptr = contents.byteOffset; + } else { + if (position > 0 || position + length < contents.length) { + if (contents.subarray) { + contents = contents.subarray(position, position + length); + } else { + contents = Array.prototype.slice.call( + contents, + position, + position + length + ); + } + } + allocated = true; + ptr = mmapAlloc(length); + if (!ptr) { + throw new FS.ErrnoError(48); + } + HEAP8.set(contents, ptr); + } + return { ptr, allocated }; + }, + msync: function(stream, buffer2, offset, length, mmapFlags) { + if (!FS.isFile(stream.node.mode)) { + throw new FS.ErrnoError(43); + } + if (mmapFlags & 2) { + return 0; + } + MEMFS.stream_ops.write( + stream, + buffer2, + 0, + length, + offset, + false + ); + return 0; + } + } + }; + var ERRNO_CODES = { + EPERM: 63, + ENOENT: 44, + ESRCH: 71, + EINTR: 27, + EIO: 29, + ENXIO: 60, + E2BIG: 1, + ENOEXEC: 45, + EBADF: 8, + ECHILD: 12, + EAGAIN: 6, + EWOULDBLOCK: 6, + ENOMEM: 48, + EACCES: 2, + EFAULT: 21, + ENOTBLK: 105, + EBUSY: 10, + EEXIST: 20, + EXDEV: 75, + ENODEV: 43, + ENOTDIR: 54, + EISDIR: 31, + EINVAL: 28, + ENFILE: 41, + EMFILE: 33, + ENOTTY: 59, + ETXTBSY: 74, + EFBIG: 22, + ENOSPC: 51, + ESPIPE: 70, + EROFS: 69, + EMLINK: 34, + EPIPE: 64, + EDOM: 18, + ERANGE: 68, + ENOMSG: 49, + EIDRM: 24, + ECHRNG: 106, + EL2NSYNC: 156, + EL3HLT: 107, + EL3RST: 108, + ELNRNG: 109, + EUNATCH: 110, + ENOCSI: 111, + EL2HLT: 112, + EDEADLK: 16, + ENOLCK: 46, + EBADE: 113, + EBADR: 114, + EXFULL: 115, + ENOANO: 104, + EBADRQC: 103, + EBADSLT: 102, + EDEADLOCK: 16, + EBFONT: 101, + ENOSTR: 100, + ENODATA: 116, + ETIME: 117, + ENOSR: 118, + ENONET: 119, + ENOPKG: 120, + EREMOTE: 121, + ENOLINK: 47, + EADV: 122, + ESRMNT: 123, + ECOMM: 124, + EPROTO: 65, + EMULTIHOP: 36, + EDOTDOT: 125, + EBADMSG: 9, + ENOTUNIQ: 126, + EBADFD: 127, + EREMCHG: 128, + ELIBACC: 129, + ELIBBAD: 130, + ELIBSCN: 131, + ELIBMAX: 132, + ELIBEXEC: 133, + ENOSYS: 52, + ENOTEMPTY: 55, + ENAMETOOLONG: 37, + ELOOP: 32, + EOPNOTSUPP: 138, + EPFNOSUPPORT: 139, + ECONNRESET: 15, + ENOBUFS: 42, + EAFNOSUPPORT: 5, + EPROTOTYPE: 67, + ENOTSOCK: 57, + ENOPROTOOPT: 50, + ESHUTDOWN: 140, + ECONNREFUSED: 14, + EADDRINUSE: 3, + ECONNABORTED: 13, + ENETUNREACH: 40, + ENETDOWN: 38, + ETIMEDOUT: 73, + EHOSTDOWN: 142, + EHOSTUNREACH: 23, + EINPROGRESS: 26, + EALREADY: 7, + EDESTADDRREQ: 17, + EMSGSIZE: 35, + EPROTONOSUPPORT: 66, + ESOCKTNOSUPPORT: 137, + EADDRNOTAVAIL: 4, + ENETRESET: 39, + EISCONN: 30, + ENOTCONN: 53, + ETOOMANYREFS: 141, + EUSERS: 136, + EDQUOT: 19, + ESTALE: 72, + ENOTSUP: 138, + ENOMEDIUM: 148, + EILSEQ: 25, + EOVERFLOW: 61, + ECANCELED: 11, + ENOTRECOVERABLE: 56, + EOWNERDEAD: 62, + ESTRPIPE: 135 + }; + var NODEFS = { + isWindows: false, + staticInit: function() { + NODEFS.isWindows = !!process.platform.match(/^win/); + var flags = { fs: fs.constants }; + if (flags["fs"]) { + flags = flags["fs"]; + } + NODEFS.flagsForNodeMap = { + 1024: flags["O_APPEND"], + 64: flags["O_CREAT"], + 128: flags["O_EXCL"], + 256: flags["O_NOCTTY"], + 0: flags["O_RDONLY"], + 2: flags["O_RDWR"], + 4096: flags["O_SYNC"], + 512: flags["O_TRUNC"], + 1: flags["O_WRONLY"] + }; + }, + bufferFrom: function(arrayBuffer) { + return Buffer["alloc"] ? Buffer.from(arrayBuffer) : new Buffer(arrayBuffer); + }, + convertNodeCode: function(e) { + var code = e.code; + return ERRNO_CODES[code]; + }, + mount: function(mount) { + return NODEFS.createNode(null, "/", NODEFS.getMode(mount.opts.root), 0); + }, + createNode: function(parent, name, mode, dev) { + if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) { + throw new FS.ErrnoError(28); + } + var node = FS.createNode(parent, name, mode); + node.node_ops = NODEFS.node_ops; + node.stream_ops = NODEFS.stream_ops; + return node; + }, + getMode: function(path) { + var stat; + try { + stat = fs.lstatSync(path); + if (NODEFS.isWindows) { + stat.mode = stat.mode | (stat.mode & 292) >> 2; + } + } catch (e) { + if (!e.code) + throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + return stat.mode; + }, + realPath: function(node) { + var parts = []; + while (node.parent !== node) { + parts.push(node.name); + node = node.parent; + } + parts.push(node.mount.opts.root); + parts.reverse(); + return PATH.join.apply(null, parts); + }, + flagsForNode: function(flags) { + flags &= ~2097152; + flags &= ~2048; + flags &= ~32768; + flags &= ~524288; + var newFlags = 0; + for (var k in NODEFS.flagsForNodeMap) { + if (flags & k) { + newFlags |= NODEFS.flagsForNodeMap[k]; + flags ^= k; + } + } + if (!flags) { + return newFlags; + } else { + throw new FS.ErrnoError(28); + } + }, + node_ops: { + getattr: function(node) { + var path = NODEFS.realPath(node); + var stat; + try { + stat = fs.lstatSync(path); + } catch (e) { + if (!e.code) + throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + if (NODEFS.isWindows && !stat.blksize) { + stat.blksize = 4096; + } + if (NODEFS.isWindows && !stat.blocks) { + stat.blocks = (stat.size + stat.blksize - 1) / stat.blksize | 0; + } + return { + dev: stat.dev, + ino: stat.ino, + mode: stat.mode, + nlink: stat.nlink, + uid: stat.uid, + gid: stat.gid, + rdev: stat.rdev, + size: stat.size, + atime: stat.atime, + mtime: stat.mtime, + ctime: stat.ctime, + blksize: stat.blksize, + blocks: stat.blocks + }; + }, + setattr: function(node, attr) { + var path = NODEFS.realPath(node); + try { + if (attr.mode !== void 0) { + fs.chmodSync(path, attr.mode); + node.mode = attr.mode; + } + if (attr.timestamp !== void 0) { + var date = new Date(attr.timestamp); + fs.utimesSync(path, date, date); + } + if (attr.size !== void 0) { + fs.truncateSync(path, attr.size); + } + } catch (e) { + if (!e.code) + throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + lookup: function(parent, name) { + var path = PATH.join2(NODEFS.realPath(parent), name); + var mode = NODEFS.getMode(path); + return NODEFS.createNode(parent, name, mode); + }, + mknod: function(parent, name, mode, dev) { + var node = NODEFS.createNode(parent, name, mode, dev); + var path = NODEFS.realPath(node); + try { + if (FS.isDir(node.mode)) { + fs.mkdirSync(path, node.mode); + } else { + fs.writeFileSync(path, "", { mode: node.mode }); + } + } catch (e) { + if (!e.code) + throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + return node; + }, + rename: function(oldNode, newDir, newName) { + var oldPath = NODEFS.realPath(oldNode); + var newPath = PATH.join2(NODEFS.realPath(newDir), newName); + try { + fs.renameSync(oldPath, newPath); + } catch (e) { + if (!e.code) + throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + oldNode.name = newName; + }, + unlink: function(parent, name) { + var path = PATH.join2(NODEFS.realPath(parent), name); + try { + fs.unlinkSync(path); + } catch (e) { + if (!e.code) + throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + rmdir: function(parent, name) { + var path = PATH.join2(NODEFS.realPath(parent), name); + try { + fs.rmdirSync(path); + } catch (e) { + if (!e.code) + throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + readdir: function(node) { + var path = NODEFS.realPath(node); + try { + return fs.readdirSync(path); + } catch (e) { + if (!e.code) + throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + symlink: function(parent, newName, oldPath) { + var newPath = PATH.join2(NODEFS.realPath(parent), newName); + try { + fs.symlinkSync(oldPath, newPath); + } catch (e) { + if (!e.code) + throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + readlink: function(node) { + var path = NODEFS.realPath(node); + try { + path = fs.readlinkSync(path); + path = NODEJS_PATH.relative( + NODEJS_PATH.resolve(node.mount.opts.root), + path + ); + return path; + } catch (e) { + if (!e.code) + throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + } + }, + stream_ops: { + open: function(stream) { + var path = NODEFS.realPath(stream.node); + try { + if (FS.isFile(stream.node.mode)) { + stream.nfd = fs.openSync(path, NODEFS.flagsForNode(stream.flags)); + } + } catch (e) { + if (!e.code) + throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + close: function(stream) { + try { + if (FS.isFile(stream.node.mode) && stream.nfd) { + fs.closeSync(stream.nfd); + } + } catch (e) { + if (!e.code) + throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + read: function(stream, buffer2, offset, length, position) { + if (length === 0) + return 0; + try { + return fs.readSync( + stream.nfd, + NODEFS.bufferFrom(buffer2.buffer), + offset, + length, + position + ); + } catch (e) { + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + write: function(stream, buffer2, offset, length, position) { + try { + return fs.writeSync( + stream.nfd, + NODEFS.bufferFrom(buffer2.buffer), + offset, + length, + position + ); + } catch (e) { + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + llseek: function(stream, offset, whence) { + var position = offset; + if (whence === 1) { + position += stream.position; + } else if (whence === 2) { + if (FS.isFile(stream.node.mode)) { + try { + var stat = fs.fstatSync(stream.nfd); + position += stat.size; + } catch (e) { + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + } + } + if (position < 0) { + throw new FS.ErrnoError(28); + } + return position; + }, + mmap: function(stream, address, length, position, prot, flags) { + if (address !== 0) { + throw new FS.ErrnoError(28); + } + if (!FS.isFile(stream.node.mode)) { + throw new FS.ErrnoError(43); + } + var ptr = mmapAlloc(length); + NODEFS.stream_ops.read(stream, HEAP8, ptr, length, position); + return { ptr, allocated: true }; + }, + msync: function(stream, buffer2, offset, length, mmapFlags) { + if (!FS.isFile(stream.node.mode)) { + throw new FS.ErrnoError(43); + } + if (mmapFlags & 2) { + return 0; + } + NODEFS.stream_ops.write( + stream, + buffer2, + 0, + length, + offset, + false + ); + return 0; + } + } + }; + var NODERAWFS = { + lookupPath: function(path) { + return { path, node: { mode: NODEFS.getMode(path) } }; + }, + createStandardStreams: function() { + FS.streams[0] = { + fd: 0, + nfd: 0, + position: 0, + path: "", + flags: 0, + tty: true, + seekable: false + }; + for (var i = 1; i < 3; i++) { + FS.streams[i] = { + fd: i, + nfd: i, + position: 0, + path: "", + flags: 577, + tty: true, + seekable: false + }; + } + }, + cwd: function() { + return process.cwd(); + }, + chdir: function() { + process.chdir.apply(void 0, arguments); + }, + mknod: function(path, mode) { + if (FS.isDir(path)) { + fs.mkdirSync(path, mode); + } else { + fs.writeFileSync(path, "", { mode }); + } + }, + mkdir: function() { + fs.mkdirSync.apply(void 0, arguments); + }, + symlink: function() { + fs.symlinkSync.apply(void 0, arguments); + }, + rename: function() { + fs.renameSync.apply(void 0, arguments); + }, + rmdir: function() { + fs.rmdirSync.apply(void 0, arguments); + }, + readdir: function() { + fs.readdirSync.apply(void 0, arguments); + }, + unlink: function() { + fs.unlinkSync.apply(void 0, arguments); + }, + readlink: function() { + return fs.readlinkSync.apply(void 0, arguments); + }, + stat: function() { + return fs.statSync.apply(void 0, arguments); + }, + lstat: function() { + return fs.lstatSync.apply(void 0, arguments); + }, + chmod: function() { + fs.chmodSync.apply(void 0, arguments); + }, + fchmod: function() { + fs.fchmodSync.apply(void 0, arguments); + }, + chown: function() { + fs.chownSync.apply(void 0, arguments); + }, + fchown: function() { + fs.fchownSync.apply(void 0, arguments); + }, + truncate: function() { + fs.truncateSync.apply(void 0, arguments); + }, + ftruncate: function(fd, len) { + if (len < 0) { + throw new FS.ErrnoError(28); + } + fs.ftruncateSync.apply(void 0, arguments); + }, + utime: function() { + fs.utimesSync.apply(void 0, arguments); + }, + open: function(path, flags, mode, suggestFD) { + if (typeof flags === "string") { + flags = VFS.modeStringToFlags(flags); + } + var nfd = fs.openSync(path, NODEFS.flagsForNode(flags), mode); + var fd = suggestFD != null ? suggestFD : FS.nextfd(nfd); + var stream = { + fd, + nfd, + position: 0, + path, + flags, + seekable: true + }; + FS.streams[fd] = stream; + return stream; + }, + close: function(stream) { + if (!stream.stream_ops) { + fs.closeSync(stream.nfd); + } + FS.closeStream(stream.fd); + }, + llseek: function(stream, offset, whence) { + if (stream.stream_ops) { + return VFS.llseek(stream, offset, whence); + } + var position = offset; + if (whence === 1) { + position += stream.position; + } else if (whence === 2) { + position += fs.fstatSync(stream.nfd).size; + } else if (whence !== 0) { + throw new FS.ErrnoError(ERRNO_CODES.EINVAL); + } + if (position < 0) { + throw new FS.ErrnoError(ERRNO_CODES.EINVAL); + } + stream.position = position; + return position; + }, + read: function(stream, buffer2, offset, length, position) { + if (stream.stream_ops) { + return VFS.read(stream, buffer2, offset, length, position); + } + var seeking = typeof position !== "undefined"; + if (!seeking && stream.seekable) + position = stream.position; + var bytesRead = fs.readSync( + stream.nfd, + NODEFS.bufferFrom(buffer2.buffer), + offset, + length, + position + ); + if (!seeking) + stream.position += bytesRead; + return bytesRead; + }, + write: function(stream, buffer2, offset, length, position) { + if (stream.stream_ops) { + return VFS.write(stream, buffer2, offset, length, position); + } + if (stream.flags & +"1024") { + FS.llseek(stream, 0, +"2"); + } + var seeking = typeof position !== "undefined"; + if (!seeking && stream.seekable) + position = stream.position; + var bytesWritten = fs.writeSync( + stream.nfd, + NODEFS.bufferFrom(buffer2.buffer), + offset, + length, + position + ); + if (!seeking) + stream.position += bytesWritten; + return bytesWritten; + }, + allocate: function() { + throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP); + }, + mmap: function(stream, address, length, position, prot, flags) { + if (stream.stream_ops) { + return VFS.mmap(stream, address, length, position, prot, flags); + } + if (address !== 0) { + throw new FS.ErrnoError(28); + } + var ptr = mmapAlloc(length); + FS.read(stream, HEAP8, ptr, length, position); + return { ptr, allocated: true }; + }, + msync: function(stream, buffer2, offset, length, mmapFlags) { + if (stream.stream_ops) { + return VFS.msync(stream, buffer2, offset, length, mmapFlags); + } + if (mmapFlags & 2) { + return 0; + } + FS.write(stream, buffer2, 0, length, offset); + return 0; + }, + munmap: function() { + return 0; + }, + ioctl: function() { + throw new FS.ErrnoError(ERRNO_CODES.ENOTTY); + } + }; + var FS = { + root: null, + mounts: [], + devices: {}, + streams: [], + nextInode: 1, + nameTable: null, + currentPath: "/", + initialized: false, + ignorePermissions: true, + trackingDelegate: {}, + tracking: { openFlags: { READ: 1, WRITE: 2 } }, + ErrnoError: null, + genericErrors: {}, + filesystems: null, + syncFSRequests: 0, + lookupPath: function(path, opts) { + path = PATH_FS.resolve(FS.cwd(), path); + opts = opts || {}; + if (!path) + return { path: "", node: null }; + var defaults = { follow_mount: true, recurse_count: 0 }; + for (var key2 in defaults) { + if (opts[key2] === void 0) { + opts[key2] = defaults[key2]; + } + } + if (opts.recurse_count > 8) { + throw new FS.ErrnoError(32); + } + var parts = PATH.normalizeArray( + path.split("/").filter(function(p) { + return !!p; + }), + false + ); + var current = FS.root; + var current_path = "/"; + for (var i = 0; i < parts.length; i++) { + var islast = i === parts.length - 1; + if (islast && opts.parent) { + break; + } + current = FS.lookupNode(current, parts[i]); + current_path = PATH.join2(current_path, parts[i]); + if (FS.isMountpoint(current)) { + if (!islast || islast && opts.follow_mount) { + current = current.mounted.root; + } + } + if (!islast || opts.follow) { + var count = 0; + while (FS.isLink(current.mode)) { + var link = FS.readlink(current_path); + current_path = PATH_FS.resolve(PATH.dirname(current_path), link); + var lookup = FS.lookupPath(current_path, { + recurse_count: opts.recurse_count + }); + current = lookup.node; + if (count++ > 40) { + throw new FS.ErrnoError(32); + } + } + } + } + return { path: current_path, node: current }; + }, + getPath: function(node) { + var path; + while (true) { + if (FS.isRoot(node)) { + var mount = node.mount.mountpoint; + if (!path) + return mount; + return mount[mount.length - 1] !== "/" ? mount + "/" + path : mount + path; + } + path = path ? node.name + "/" + path : node.name; + node = node.parent; + } + }, + hashName: function(parentid, name) { + var hash = 0; + for (var i = 0; i < name.length; i++) { + hash = (hash << 5) - hash + name.charCodeAt(i) | 0; + } + return (parentid + hash >>> 0) % FS.nameTable.length; + }, + hashAddNode: function(node) { + var hash = FS.hashName(node.parent.id, node.name); + node.name_next = FS.nameTable[hash]; + FS.nameTable[hash] = node; + }, + hashRemoveNode: function(node) { + var hash = FS.hashName(node.parent.id, node.name); + if (FS.nameTable[hash] === node) { + FS.nameTable[hash] = node.name_next; + } else { + var current = FS.nameTable[hash]; + while (current) { + if (current.name_next === node) { + current.name_next = node.name_next; + break; + } + current = current.name_next; + } + } + }, + lookupNode: function(parent, name) { + var errCode = FS.mayLookup(parent); + if (errCode) { + throw new FS.ErrnoError(errCode, parent); + } + var hash = FS.hashName(parent.id, name); + for (var node = FS.nameTable[hash]; node; node = node.name_next) { + var nodeName = node.name; + if (node.parent.id === parent.id && nodeName === name) { + return node; + } + } + return FS.lookup(parent, name); + }, + createNode: function(parent, name, mode, rdev) { + var node = new FS.FSNode(parent, name, mode, rdev); + FS.hashAddNode(node); + return node; + }, + destroyNode: function(node) { + FS.hashRemoveNode(node); + }, + isRoot: function(node) { + return node === node.parent; + }, + isMountpoint: function(node) { + return !!node.mounted; + }, + isFile: function(mode) { + return (mode & 61440) === 32768; + }, + isDir: function(mode) { + return (mode & 61440) === 16384; + }, + isLink: function(mode) { + return (mode & 61440) === 40960; + }, + isChrdev: function(mode) { + return (mode & 61440) === 8192; + }, + isBlkdev: function(mode) { + return (mode & 61440) === 24576; + }, + isFIFO: function(mode) { + return (mode & 61440) === 4096; + }, + isSocket: function(mode) { + return (mode & 49152) === 49152; + }, + flagModes: { r: 0, "r+": 2, w: 577, "w+": 578, a: 1089, "a+": 1090 }, + modeStringToFlags: function(str) { + var flags = FS.flagModes[str]; + if (typeof flags === "undefined") { + throw new Error("Unknown file open mode: " + str); + } + return flags; + }, + flagsToPermissionString: function(flag) { + var perms = ["r", "w", "rw"][flag & 3]; + if (flag & 512) { + perms += "w"; + } + return perms; + }, + nodePermissions: function(node, perms) { + if (FS.ignorePermissions) { + return 0; + } + if (perms.includes("r") && !(node.mode & 292)) { + return 2; + } else if (perms.includes("w") && !(node.mode & 146)) { + return 2; + } else if (perms.includes("x") && !(node.mode & 73)) { + return 2; + } + return 0; + }, + mayLookup: function(dir) { + var errCode = FS.nodePermissions(dir, "x"); + if (errCode) + return errCode; + if (!dir.node_ops.lookup) + return 2; + return 0; + }, + mayCreate: function(dir, name) { + try { + var node = FS.lookupNode(dir, name); + return 20; + } catch (e) { + } + return FS.nodePermissions(dir, "wx"); + }, + mayDelete: function(dir, name, isdir) { + var node; + try { + node = FS.lookupNode(dir, name); + } catch (e) { + return e.errno; + } + var errCode = FS.nodePermissions(dir, "wx"); + if (errCode) { + return errCode; + } + if (isdir) { + if (!FS.isDir(node.mode)) { + return 54; + } + if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) { + return 10; + } + } else { + if (FS.isDir(node.mode)) { + return 31; + } + } + return 0; + }, + mayOpen: function(node, flags) { + if (!node) { + return 44; + } + if (FS.isLink(node.mode)) { + return 32; + } else if (FS.isDir(node.mode)) { + if (FS.flagsToPermissionString(flags) !== "r" || flags & 512) { + return 31; + } + } + return FS.nodePermissions(node, FS.flagsToPermissionString(flags)); + }, + MAX_OPEN_FDS: 4096, + nextfd: function(fd_start, fd_end) { + fd_start = fd_start || 0; + fd_end = fd_end || FS.MAX_OPEN_FDS; + for (var fd = fd_start; fd <= fd_end; fd++) { + if (!FS.streams[fd]) { + return fd; + } + } + throw new FS.ErrnoError(33); + }, + getStream: function(fd) { + return FS.streams[fd]; + }, + createStream: function(stream, fd_start, fd_end) { + if (!FS.FSStream) { + FS.FSStream = function() { + }; + FS.FSStream.prototype = { + object: { + get: function() { + return this.node; + }, + set: function(val) { + this.node = val; + } + }, + isRead: { + get: function() { + return (this.flags & 2097155) !== 1; + } + }, + isWrite: { + get: function() { + return (this.flags & 2097155) !== 0; + } + }, + isAppend: { + get: function() { + return this.flags & 1024; + } + } + }; + } + var newStream = new FS.FSStream(); + for (var p in stream) { + newStream[p] = stream[p]; + } + stream = newStream; + var fd = FS.nextfd(fd_start, fd_end); + stream.fd = fd; + FS.streams[fd] = stream; + return stream; + }, + closeStream: function(fd) { + FS.streams[fd] = null; + }, + chrdev_stream_ops: { + open: function(stream) { + var device = FS.getDevice(stream.node.rdev); + stream.stream_ops = device.stream_ops; + if (stream.stream_ops.open) { + stream.stream_ops.open(stream); + } + }, + llseek: function() { + throw new FS.ErrnoError(70); + } + }, + major: function(dev) { + return dev >> 8; + }, + minor: function(dev) { + return dev & 255; + }, + makedev: function(ma, mi) { + return ma << 8 | mi; + }, + registerDevice: function(dev, ops) { + FS.devices[dev] = { stream_ops: ops }; + }, + getDevice: function(dev) { + return FS.devices[dev]; + }, + getMounts: function(mount) { + var mounts = []; + var check = [mount]; + while (check.length) { + var m = check.pop(); + mounts.push(m); + check.push.apply(check, m.mounts); + } + return mounts; + }, + syncfs: function(populate, callback) { + if (typeof populate === "function") { + callback = populate; + populate = false; + } + FS.syncFSRequests++; + if (FS.syncFSRequests > 1) { + err( + "warning: " + FS.syncFSRequests + " FS.syncfs operations in flight at once, probably just doing extra work" + ); + } + var mounts = FS.getMounts(FS.root.mount); + var completed = 0; + function doCallback(errCode) { + FS.syncFSRequests--; + return callback(errCode); + } + function done(errCode) { + if (errCode) { + if (!done.errored) { + done.errored = true; + return doCallback(errCode); + } + return; + } + if (++completed >= mounts.length) { + doCallback(null); + } + } + mounts.forEach(function(mount) { + if (!mount.type.syncfs) { + return done(null); + } + mount.type.syncfs(mount, populate, done); + }); + }, + mount: function(type, opts, mountpoint) { + var root = mountpoint === "/"; + var pseudo = !mountpoint; + var node; + if (root && FS.root) { + throw new FS.ErrnoError(10); + } else if (!root && !pseudo) { + var lookup = FS.lookupPath(mountpoint, { follow_mount: false }); + mountpoint = lookup.path; + node = lookup.node; + if (FS.isMountpoint(node)) { + throw new FS.ErrnoError(10); + } + if (!FS.isDir(node.mode)) { + throw new FS.ErrnoError(54); + } + } + var mount = { + type, + opts, + mountpoint, + mounts: [] + }; + var mountRoot = type.mount(mount); + mountRoot.mount = mount; + mount.root = mountRoot; + if (root) { + FS.root = mountRoot; + } else if (node) { + node.mounted = mount; + if (node.mount) { + node.mount.mounts.push(mount); + } + } + return mountRoot; + }, + unmount: function(mountpoint) { + var lookup = FS.lookupPath(mountpoint, { follow_mount: false }); + if (!FS.isMountpoint(lookup.node)) { + throw new FS.ErrnoError(28); + } + var node = lookup.node; + var mount = node.mounted; + var mounts = FS.getMounts(mount); + Object.keys(FS.nameTable).forEach(function(hash) { + var current = FS.nameTable[hash]; + while (current) { + var next = current.name_next; + if (mounts.includes(current.mount)) { + FS.destroyNode(current); + } + current = next; + } + }); + node.mounted = null; + var idx = node.mount.mounts.indexOf(mount); + node.mount.mounts.splice(idx, 1); + }, + lookup: function(parent, name) { + return parent.node_ops.lookup(parent, name); + }, + mknod: function(path, mode, dev) { + var lookup = FS.lookupPath(path, { parent: true }); + var parent = lookup.node; + var name = PATH.basename(path); + if (!name || name === "." || name === "..") { + throw new FS.ErrnoError(28); + } + var errCode = FS.mayCreate(parent, name); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + if (!parent.node_ops.mknod) { + throw new FS.ErrnoError(63); + } + return parent.node_ops.mknod(parent, name, mode, dev); + }, + create: function(path, mode) { + mode = mode !== void 0 ? mode : 438; + mode &= 4095; + mode |= 32768; + return FS.mknod(path, mode, 0); + }, + mkdir: function(path, mode) { + mode = mode !== void 0 ? mode : 511; + mode &= 511 | 512; + mode |= 16384; + return FS.mknod(path, mode, 0); + }, + mkdirTree: function(path, mode) { + var dirs = path.split("/"); + var d = ""; + for (var i = 0; i < dirs.length; ++i) { + if (!dirs[i]) + continue; + d += "/" + dirs[i]; + try { + FS.mkdir(d, mode); + } catch (e) { + if (e.errno != 20) + throw e; + } + } + }, + mkdev: function(path, mode, dev) { + if (typeof dev === "undefined") { + dev = mode; + mode = 438; + } + mode |= 8192; + return FS.mknod(path, mode, dev); + }, + symlink: function(oldpath, newpath) { + if (!PATH_FS.resolve(oldpath)) { + throw new FS.ErrnoError(44); + } + var lookup = FS.lookupPath(newpath, { parent: true }); + var parent = lookup.node; + if (!parent) { + throw new FS.ErrnoError(44); + } + var newname = PATH.basename(newpath); + var errCode = FS.mayCreate(parent, newname); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + if (!parent.node_ops.symlink) { + throw new FS.ErrnoError(63); + } + return parent.node_ops.symlink(parent, newname, oldpath); + }, + rename: function(old_path, new_path) { + var old_dirname = PATH.dirname(old_path); + var new_dirname = PATH.dirname(new_path); + var old_name = PATH.basename(old_path); + var new_name = PATH.basename(new_path); + var lookup, old_dir, new_dir; + lookup = FS.lookupPath(old_path, { parent: true }); + old_dir = lookup.node; + lookup = FS.lookupPath(new_path, { parent: true }); + new_dir = lookup.node; + if (!old_dir || !new_dir) + throw new FS.ErrnoError(44); + if (old_dir.mount !== new_dir.mount) { + throw new FS.ErrnoError(75); + } + var old_node = FS.lookupNode(old_dir, old_name); + var relative = PATH_FS.relative(old_path, new_dirname); + if (relative.charAt(0) !== ".") { + throw new FS.ErrnoError(28); + } + relative = PATH_FS.relative(new_path, old_dirname); + if (relative.charAt(0) !== ".") { + throw new FS.ErrnoError(55); + } + var new_node; + try { + new_node = FS.lookupNode(new_dir, new_name); + } catch (e) { + } + if (old_node === new_node) { + return; + } + var isdir = FS.isDir(old_node.mode); + var errCode = FS.mayDelete(old_dir, old_name, isdir); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + errCode = new_node ? FS.mayDelete(new_dir, new_name, isdir) : FS.mayCreate(new_dir, new_name); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + if (!old_dir.node_ops.rename) { + throw new FS.ErrnoError(63); + } + if (FS.isMountpoint(old_node) || new_node && FS.isMountpoint(new_node)) { + throw new FS.ErrnoError(10); + } + if (new_dir !== old_dir) { + errCode = FS.nodePermissions(old_dir, "w"); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + } + try { + if (FS.trackingDelegate["willMovePath"]) { + FS.trackingDelegate["willMovePath"](old_path, new_path); + } + } catch (e) { + err( + "FS.trackingDelegate['willMovePath']('" + old_path + "', '" + new_path + "') threw an exception: " + e.message + ); + } + FS.hashRemoveNode(old_node); + try { + old_dir.node_ops.rename(old_node, new_dir, new_name); + } catch (e) { + throw e; + } finally { + FS.hashAddNode(old_node); + } + try { + if (FS.trackingDelegate["onMovePath"]) + FS.trackingDelegate["onMovePath"](old_path, new_path); + } catch (e) { + err( + "FS.trackingDelegate['onMovePath']('" + old_path + "', '" + new_path + "') threw an exception: " + e.message + ); + } + }, + rmdir: function(path) { + var lookup = FS.lookupPath(path, { parent: true }); + var parent = lookup.node; + var name = PATH.basename(path); + var node = FS.lookupNode(parent, name); + var errCode = FS.mayDelete(parent, name, true); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + if (!parent.node_ops.rmdir) { + throw new FS.ErrnoError(63); + } + if (FS.isMountpoint(node)) { + throw new FS.ErrnoError(10); + } + try { + if (FS.trackingDelegate["willDeletePath"]) { + FS.trackingDelegate["willDeletePath"](path); + } + } catch (e) { + err( + "FS.trackingDelegate['willDeletePath']('" + path + "') threw an exception: " + e.message + ); + } + parent.node_ops.rmdir(parent, name); + FS.destroyNode(node); + try { + if (FS.trackingDelegate["onDeletePath"]) + FS.trackingDelegate["onDeletePath"](path); + } catch (e) { + err( + "FS.trackingDelegate['onDeletePath']('" + path + "') threw an exception: " + e.message + ); + } + }, + readdir: function(path) { + var lookup = FS.lookupPath(path, { follow: true }); + var node = lookup.node; + if (!node.node_ops.readdir) { + throw new FS.ErrnoError(54); + } + return node.node_ops.readdir(node); + }, + unlink: function(path) { + var lookup = FS.lookupPath(path, { parent: true }); + var parent = lookup.node; + var name = PATH.basename(path); + var node = FS.lookupNode(parent, name); + var errCode = FS.mayDelete(parent, name, false); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + if (!parent.node_ops.unlink) { + throw new FS.ErrnoError(63); + } + if (FS.isMountpoint(node)) { + throw new FS.ErrnoError(10); + } + try { + if (FS.trackingDelegate["willDeletePath"]) { + FS.trackingDelegate["willDeletePath"](path); + } + } catch (e) { + err( + "FS.trackingDelegate['willDeletePath']('" + path + "') threw an exception: " + e.message + ); + } + parent.node_ops.unlink(parent, name); + FS.destroyNode(node); + try { + if (FS.trackingDelegate["onDeletePath"]) + FS.trackingDelegate["onDeletePath"](path); + } catch (e) { + err( + "FS.trackingDelegate['onDeletePath']('" + path + "') threw an exception: " + e.message + ); + } + }, + readlink: function(path) { + var lookup = FS.lookupPath(path); + var link = lookup.node; + if (!link) { + throw new FS.ErrnoError(44); + } + if (!link.node_ops.readlink) { + throw new FS.ErrnoError(28); + } + return PATH_FS.resolve( + FS.getPath(link.parent), + link.node_ops.readlink(link) + ); + }, + stat: function(path, dontFollow) { + var lookup = FS.lookupPath(path, { follow: !dontFollow }); + var node = lookup.node; + if (!node) { + throw new FS.ErrnoError(44); + } + if (!node.node_ops.getattr) { + throw new FS.ErrnoError(63); + } + return node.node_ops.getattr(node); + }, + lstat: function(path) { + return FS.stat(path, true); + }, + chmod: function(path, mode, dontFollow) { + var node; + if (typeof path === "string") { + var lookup = FS.lookupPath(path, { follow: !dontFollow }); + node = lookup.node; + } else { + node = path; + } + if (!node.node_ops.setattr) { + throw new FS.ErrnoError(63); + } + node.node_ops.setattr(node, { + mode: mode & 4095 | node.mode & ~4095, + timestamp: Date.now() + }); + }, + lchmod: function(path, mode) { + FS.chmod(path, mode, true); + }, + fchmod: function(fd, mode) { + var stream = FS.getStream(fd); + if (!stream) { + throw new FS.ErrnoError(8); + } + FS.chmod(stream.node, mode); + }, + chown: function(path, uid, gid, dontFollow) { + var node; + if (typeof path === "string") { + var lookup = FS.lookupPath(path, { follow: !dontFollow }); + node = lookup.node; + } else { + node = path; + } + if (!node.node_ops.setattr) { + throw new FS.ErrnoError(63); + } + node.node_ops.setattr(node, { timestamp: Date.now() }); + }, + lchown: function(path, uid, gid) { + FS.chown(path, uid, gid, true); + }, + fchown: function(fd, uid, gid) { + var stream = FS.getStream(fd); + if (!stream) { + throw new FS.ErrnoError(8); + } + FS.chown(stream.node, uid, gid); + }, + truncate: function(path, len) { + if (len < 0) { + throw new FS.ErrnoError(28); + } + var node; + if (typeof path === "string") { + var lookup = FS.lookupPath(path, { follow: true }); + node = lookup.node; + } else { + node = path; + } + if (!node.node_ops.setattr) { + throw new FS.ErrnoError(63); + } + if (FS.isDir(node.mode)) { + throw new FS.ErrnoError(31); + } + if (!FS.isFile(node.mode)) { + throw new FS.ErrnoError(28); + } + var errCode = FS.nodePermissions(node, "w"); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + node.node_ops.setattr(node, { size: len, timestamp: Date.now() }); + }, + ftruncate: function(fd, len) { + var stream = FS.getStream(fd); + if (!stream) { + throw new FS.ErrnoError(8); + } + if ((stream.flags & 2097155) === 0) { + throw new FS.ErrnoError(28); + } + FS.truncate(stream.node, len); + }, + utime: function(path, atime, mtime) { + var lookup = FS.lookupPath(path, { follow: true }); + var node = lookup.node; + node.node_ops.setattr(node, { timestamp: Math.max(atime, mtime) }); + }, + open: function(path, flags, mode, fd_start, fd_end) { + if (path === "") { + throw new FS.ErrnoError(44); + } + flags = typeof flags === "string" ? FS.modeStringToFlags(flags) : flags; + mode = typeof mode === "undefined" ? 438 : mode; + if (flags & 64) { + mode = mode & 4095 | 32768; + } else { + mode = 0; + } + var node; + if (typeof path === "object") { + node = path; + } else { + path = PATH.normalize(path); + try { + var lookup = FS.lookupPath(path, { follow: !(flags & 131072) }); + node = lookup.node; + } catch (e) { + } + } + var created = false; + if (flags & 64) { + if (node) { + if (flags & 128) { + throw new FS.ErrnoError(20); + } + } else { + node = FS.mknod(path, mode, 0); + created = true; + } + } + if (!node) { + throw new FS.ErrnoError(44); + } + if (FS.isChrdev(node.mode)) { + flags &= ~512; + } + if (flags & 65536 && !FS.isDir(node.mode)) { + throw new FS.ErrnoError(54); + } + if (!created) { + var errCode = FS.mayOpen(node, flags); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + } + if (flags & 512) { + FS.truncate(node, 0); + } + flags &= ~(128 | 512 | 131072); + var stream = FS.createStream( + { + node, + path: FS.getPath(node), + flags, + seekable: true, + position: 0, + stream_ops: node.stream_ops, + ungotten: [], + error: false + }, + fd_start, + fd_end + ); + if (stream.stream_ops.open) { + stream.stream_ops.open(stream); + } + if (Module["logReadFiles"] && !(flags & 1)) { + if (!FS.readFiles) + FS.readFiles = {}; + if (!(path in FS.readFiles)) { + FS.readFiles[path] = 1; + err("FS.trackingDelegate error on read file: " + path); + } + } + try { + if (FS.trackingDelegate["onOpenFile"]) { + var trackingFlags = 0; + if ((flags & 2097155) !== 1) { + trackingFlags |= FS.tracking.openFlags.READ; + } + if ((flags & 2097155) !== 0) { + trackingFlags |= FS.tracking.openFlags.WRITE; + } + FS.trackingDelegate["onOpenFile"](path, trackingFlags); + } + } catch (e) { + err( + "FS.trackingDelegate['onOpenFile']('" + path + "', flags) threw an exception: " + e.message + ); + } + return stream; + }, + close: function(stream) { + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if (stream.getdents) + stream.getdents = null; + try { + if (stream.stream_ops.close) { + stream.stream_ops.close(stream); + } + } catch (e) { + throw e; + } finally { + FS.closeStream(stream.fd); + } + stream.fd = null; + }, + isClosed: function(stream) { + return stream.fd === null; + }, + llseek: function(stream, offset, whence) { + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if (!stream.seekable || !stream.stream_ops.llseek) { + throw new FS.ErrnoError(70); + } + if (whence != 0 && whence != 1 && whence != 2) { + throw new FS.ErrnoError(28); + } + stream.position = stream.stream_ops.llseek(stream, offset, whence); + stream.ungotten = []; + return stream.position; + }, + read: function(stream, buffer2, offset, length, position) { + if (length < 0 || position < 0) { + throw new FS.ErrnoError(28); + } + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if ((stream.flags & 2097155) === 1) { + throw new FS.ErrnoError(8); + } + if (FS.isDir(stream.node.mode)) { + throw new FS.ErrnoError(31); + } + if (!stream.stream_ops.read) { + throw new FS.ErrnoError(28); + } + var seeking = typeof position !== "undefined"; + if (!seeking) { + position = stream.position; + } else if (!stream.seekable) { + throw new FS.ErrnoError(70); + } + var bytesRead = stream.stream_ops.read( + stream, + buffer2, + offset, + length, + position + ); + if (!seeking) + stream.position += bytesRead; + return bytesRead; + }, + write: function(stream, buffer2, offset, length, position, canOwn) { + if (length < 0 || position < 0) { + throw new FS.ErrnoError(28); + } + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if ((stream.flags & 2097155) === 0) { + throw new FS.ErrnoError(8); + } + if (FS.isDir(stream.node.mode)) { + throw new FS.ErrnoError(31); + } + if (!stream.stream_ops.write) { + throw new FS.ErrnoError(28); + } + if (stream.seekable && stream.flags & 1024) { + FS.llseek(stream, 0, 2); + } + var seeking = typeof position !== "undefined"; + if (!seeking) { + position = stream.position; + } else if (!stream.seekable) { + throw new FS.ErrnoError(70); + } + var bytesWritten = stream.stream_ops.write( + stream, + buffer2, + offset, + length, + position, + canOwn + ); + if (!seeking) + stream.position += bytesWritten; + try { + if (stream.path && FS.trackingDelegate["onWriteToFile"]) + FS.trackingDelegate["onWriteToFile"](stream.path); + } catch (e) { + err( + "FS.trackingDelegate['onWriteToFile']('" + stream.path + "') threw an exception: " + e.message + ); + } + return bytesWritten; + }, + allocate: function(stream, offset, length) { + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if (offset < 0 || length <= 0) { + throw new FS.ErrnoError(28); + } + if ((stream.flags & 2097155) === 0) { + throw new FS.ErrnoError(8); + } + if (!FS.isFile(stream.node.mode) && !FS.isDir(stream.node.mode)) { + throw new FS.ErrnoError(43); + } + if (!stream.stream_ops.allocate) { + throw new FS.ErrnoError(138); + } + stream.stream_ops.allocate(stream, offset, length); + }, + mmap: function(stream, address, length, position, prot, flags) { + if ((prot & 2) !== 0 && (flags & 2) === 0 && (stream.flags & 2097155) !== 2) { + throw new FS.ErrnoError(2); + } + if ((stream.flags & 2097155) === 1) { + throw new FS.ErrnoError(2); + } + if (!stream.stream_ops.mmap) { + throw new FS.ErrnoError(43); + } + return stream.stream_ops.mmap( + stream, + address, + length, + position, + prot, + flags + ); + }, + msync: function(stream, buffer2, offset, length, mmapFlags) { + if (!stream || !stream.stream_ops.msync) { + return 0; + } + return stream.stream_ops.msync( + stream, + buffer2, + offset, + length, + mmapFlags + ); + }, + munmap: function(stream) { + return 0; + }, + ioctl: function(stream, cmd, arg) { + if (!stream.stream_ops.ioctl) { + throw new FS.ErrnoError(59); + } + return stream.stream_ops.ioctl(stream, cmd, arg); + }, + readFile: function(path, opts) { + opts = opts || {}; + opts.flags = opts.flags || 0; + opts.encoding = opts.encoding || "binary"; + if (opts.encoding !== "utf8" && opts.encoding !== "binary") { + throw new Error('Invalid encoding type "' + opts.encoding + '"'); + } + var ret; + var stream = FS.open(path, opts.flags); + var stat = FS.stat(path); + var length = stat.size; + var buf = new Uint8Array(length); + FS.read(stream, buf, 0, length, 0); + if (opts.encoding === "utf8") { + ret = UTF8ArrayToString(buf, 0); + } else if (opts.encoding === "binary") { + ret = buf; + } + FS.close(stream); + return ret; + }, + writeFile: function(path, data, opts) { + opts = opts || {}; + opts.flags = opts.flags || 577; + var stream = FS.open(path, opts.flags, opts.mode); + if (typeof data === "string") { + var buf = new Uint8Array(lengthBytesUTF8(data) + 1); + var actualNumBytes = stringToUTF8Array(data, buf, 0, buf.length); + FS.write(stream, buf, 0, actualNumBytes, void 0, opts.canOwn); + } else if (ArrayBuffer.isView(data)) { + FS.write(stream, data, 0, data.byteLength, void 0, opts.canOwn); + } else { + throw new Error("Unsupported data type"); + } + FS.close(stream); + }, + cwd: function() { + return FS.currentPath; + }, + chdir: function(path) { + var lookup = FS.lookupPath(path, { follow: true }); + if (lookup.node === null) { + throw new FS.ErrnoError(44); + } + if (!FS.isDir(lookup.node.mode)) { + throw new FS.ErrnoError(54); + } + var errCode = FS.nodePermissions(lookup.node, "x"); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + FS.currentPath = lookup.path; + }, + createDefaultDirectories: function() { + FS.mkdir("/tmp"); + FS.mkdir("/home"); + FS.mkdir("/home/web_user"); + }, + createDefaultDevices: function() { + FS.mkdir("/dev"); + FS.registerDevice(FS.makedev(1, 3), { + read: function() { + return 0; + }, + write: function(stream, buffer2, offset, length, pos) { + return length; + } + }); + FS.mkdev("/dev/null", FS.makedev(1, 3)); + TTY.register(FS.makedev(5, 0), TTY.default_tty_ops); + TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops); + FS.mkdev("/dev/tty", FS.makedev(5, 0)); + FS.mkdev("/dev/tty1", FS.makedev(6, 0)); + var random_device = getRandomDevice(); + FS.createDevice("/dev", "random", random_device); + FS.createDevice("/dev", "urandom", random_device); + FS.mkdir("/dev/shm"); + FS.mkdir("/dev/shm/tmp"); + }, + createSpecialDirectories: function() { + FS.mkdir("/proc"); + var proc_self = FS.mkdir("/proc/self"); + FS.mkdir("/proc/self/fd"); + FS.mount( + { + mount: function() { + var node = FS.createNode(proc_self, "fd", 16384 | 511, 73); + node.node_ops = { + lookup: function(parent, name) { + var fd = +name; + var stream = FS.getStream(fd); + if (!stream) + throw new FS.ErrnoError(8); + var ret = { + parent: null, + mount: { mountpoint: "fake" }, + node_ops: { + readlink: function() { + return stream.path; + } + } + }; + ret.parent = ret; + return ret; + } + }; + return node; + } + }, + {}, + "/proc/self/fd" + ); + }, + createStandardStreams: function() { + if (Module["stdin"]) { + FS.createDevice("/dev", "stdin", Module["stdin"]); + } else { + FS.symlink("/dev/tty", "/dev/stdin"); + } + if (Module["stdout"]) { + FS.createDevice("/dev", "stdout", null, Module["stdout"]); + } else { + FS.symlink("/dev/tty", "/dev/stdout"); + } + if (Module["stderr"]) { + FS.createDevice("/dev", "stderr", null, Module["stderr"]); + } else { + FS.symlink("/dev/tty1", "/dev/stderr"); + } + FS.open("/dev/stdin", 0); + FS.open("/dev/stdout", 1); + FS.open("/dev/stderr", 1); + }, + ensureErrnoError: function() { + if (FS.ErrnoError) + return; + FS.ErrnoError = function ErrnoError(errno, node) { + this.node = node; + this.setErrno = function(errno2) { + this.errno = errno2; + }; + this.setErrno(errno); + this.message = "FS error"; + }; + FS.ErrnoError.prototype = new Error(); + FS.ErrnoError.prototype.constructor = FS.ErrnoError; + [44].forEach(function(code) { + FS.genericErrors[code] = new FS.ErrnoError(code); + FS.genericErrors[code].stack = ""; + }); + }, + staticInit: function() { + FS.ensureErrnoError(); + FS.nameTable = new Array(4096); + FS.mount(MEMFS, {}, "/"); + FS.createDefaultDirectories(); + FS.createDefaultDevices(); + FS.createSpecialDirectories(); + FS.filesystems = { MEMFS, NODEFS }; + }, + init: function(input, output, error) { + FS.init.initialized = true; + FS.ensureErrnoError(); + Module["stdin"] = input || Module["stdin"]; + Module["stdout"] = output || Module["stdout"]; + Module["stderr"] = error || Module["stderr"]; + FS.createStandardStreams(); + }, + quit: function() { + FS.init.initialized = false; + var fflush = Module["_fflush"]; + if (fflush) + fflush(0); + for (var i = 0; i < FS.streams.length; i++) { + var stream = FS.streams[i]; + if (!stream) { + continue; + } + FS.close(stream); + } + }, + getMode: function(canRead, canWrite) { + var mode = 0; + if (canRead) + mode |= 292 | 73; + if (canWrite) + mode |= 146; + return mode; + }, + findObject: function(path, dontResolveLastLink) { + var ret = FS.analyzePath(path, dontResolveLastLink); + if (ret.exists) { + return ret.object; + } else { + return null; + } + }, + analyzePath: function(path, dontResolveLastLink) { + try { + var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink }); + path = lookup.path; + } catch (e) { + } + var ret = { + isRoot: false, + exists: false, + error: 0, + name: null, + path: null, + object: null, + parentExists: false, + parentPath: null, + parentObject: null + }; + try { + var lookup = FS.lookupPath(path, { parent: true }); + ret.parentExists = true; + ret.parentPath = lookup.path; + ret.parentObject = lookup.node; + ret.name = PATH.basename(path); + lookup = FS.lookupPath(path, { follow: !dontResolveLastLink }); + ret.exists = true; + ret.path = lookup.path; + ret.object = lookup.node; + ret.name = lookup.node.name; + ret.isRoot = lookup.path === "/"; + } catch (e) { + ret.error = e.errno; + } + return ret; + }, + createPath: function(parent, path, canRead, canWrite) { + parent = typeof parent === "string" ? parent : FS.getPath(parent); + var parts = path.split("/").reverse(); + while (parts.length) { + var part = parts.pop(); + if (!part) + continue; + var current = PATH.join2(parent, part); + try { + FS.mkdir(current); + } catch (e) { + } + parent = current; + } + return current; + }, + createFile: function(parent, name, properties, canRead, canWrite) { + var path = PATH.join2( + typeof parent === "string" ? parent : FS.getPath(parent), + name + ); + var mode = FS.getMode(canRead, canWrite); + return FS.create(path, mode); + }, + createDataFile: function(parent, name, data, canRead, canWrite, canOwn) { + var path = name ? PATH.join2( + typeof parent === "string" ? parent : FS.getPath(parent), + name + ) : parent; + var mode = FS.getMode(canRead, canWrite); + var node = FS.create(path, mode); + if (data) { + if (typeof data === "string") { + var arr = new Array(data.length); + for (var i = 0, len = data.length; i < len; ++i) + arr[i] = data.charCodeAt(i); + data = arr; + } + FS.chmod(node, mode | 146); + var stream = FS.open(node, 577); + FS.write(stream, data, 0, data.length, 0, canOwn); + FS.close(stream); + FS.chmod(node, mode); + } + return node; + }, + createDevice: function(parent, name, input, output) { + var path = PATH.join2( + typeof parent === "string" ? parent : FS.getPath(parent), + name + ); + var mode = FS.getMode(!!input, !!output); + if (!FS.createDevice.major) + FS.createDevice.major = 64; + var dev = FS.makedev(FS.createDevice.major++, 0); + FS.registerDevice(dev, { + open: function(stream) { + stream.seekable = false; + }, + close: function(stream) { + if (output && output.buffer && output.buffer.length) { + output(10); + } + }, + read: function(stream, buffer2, offset, length, pos) { + var bytesRead = 0; + for (var i = 0; i < length; i++) { + var result; + try { + result = input(); + } catch (e) { + throw new FS.ErrnoError(29); + } + if (result === void 0 && bytesRead === 0) { + throw new FS.ErrnoError(6); + } + if (result === null || result === void 0) + break; + bytesRead++; + buffer2[offset + i] = result; + } + if (bytesRead) { + stream.node.timestamp = Date.now(); + } + return bytesRead; + }, + write: function(stream, buffer2, offset, length, pos) { + for (var i = 0; i < length; i++) { + try { + output(buffer2[offset + i]); + } catch (e) { + throw new FS.ErrnoError(29); + } + } + if (length) { + stream.node.timestamp = Date.now(); + } + return i; + } + }); + return FS.mkdev(path, mode, dev); + }, + forceLoadFile: function(obj) { + if (obj.isDevice || obj.isFolder || obj.link || obj.contents) + return true; + if (read_) { + try { + obj.contents = intArrayFromString(read_(obj.url), true); + obj.usedBytes = obj.contents.length; + } catch (e) { + throw new FS.ErrnoError(29); + } + } else { + throw new Error("Cannot load without read() or XMLHttpRequest."); + } + }, + createLazyFile: function(parent, name, url, canRead, canWrite) { + var properties; { + var properties = { isDevice: false, url }; + } + var node = FS.createFile(parent, name, properties, canRead, canWrite); + if (properties.contents) { + node.contents = properties.contents; + } else if (properties.url) { + node.contents = null; + node.url = properties.url; + } + Object.defineProperties(node, { + usedBytes: { + get: function() { + return this.contents.length; + } + } + }); + var stream_ops = {}; + var keys = Object.keys(node.stream_ops); + keys.forEach(function(key2) { + var fn = node.stream_ops[key2]; + stream_ops[key2] = function forceLoadLazyFile() { + FS.forceLoadFile(node); + return fn.apply(null, arguments); + }; + }); + stream_ops.read = function stream_ops_read(stream, buffer2, offset, length, position) { + FS.forceLoadFile(node); + var contents = stream.node.contents; + if (position >= contents.length) + return 0; + var size = Math.min(contents.length - position, length); + if (contents.slice) { + for (var i = 0; i < size; i++) { + buffer2[offset + i] = contents[position + i]; + } + } else { + for (var i = 0; i < size; i++) { + buffer2[offset + i] = contents.get(position + i); + } + } + return size; + }; + node.stream_ops = stream_ops; + return node; + }, + createPreloadedFile: function(parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn, preFinish) { + Browser.init(); + var fullname = name ? PATH_FS.resolve(PATH.join2(parent, name)) : parent; + function processData(byteArray) { + function finish(byteArray2) { + if (preFinish) + preFinish(); + if (!dontCreateFile) { + FS.createDataFile( + parent, + name, + byteArray2, + canRead, + canWrite, + canOwn + ); + } + if (onload) + onload(); + removeRunDependency(); + } + var handled = false; + Module["preloadPlugins"].forEach(function(plugin) { + if (handled) + return; + if (plugin["canHandle"](fullname)) { + plugin["handle"](byteArray, fullname, finish, function() { + if (onerror) + onerror(); + removeRunDependency(); + }); + handled = true; + } + }); + if (!handled) + finish(byteArray); + } + addRunDependency(); + if (typeof url == "string") { + Browser.asyncLoad( + url, + function(byteArray) { + processData(byteArray); + }, + onerror + ); + } else { + processData(url); + } + }, + indexedDB: function() { + return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; + }, + DB_NAME: function() { + return "EM_FS_" + window.location.pathname; + }, + DB_VERSION: 20, + DB_STORE_NAME: "FILE_DATA", + saveFilesToDB: function(paths, onload, onerror) { + onload = onload || function() { + }; + onerror = onerror || function() { + }; + var indexedDB = FS.indexedDB(); + try { + var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION); + } catch (e) { + return onerror(e); + } + openRequest.onupgradeneeded = function openRequest_onupgradeneeded() { + out("creating db"); + var db = openRequest.result; + db.createObjectStore(FS.DB_STORE_NAME); + }; + openRequest.onsuccess = function openRequest_onsuccess() { + var db = openRequest.result; + var transaction = db.transaction([FS.DB_STORE_NAME], "readwrite"); + var files = transaction.objectStore(FS.DB_STORE_NAME); + var ok = 0, fail = 0, total = paths.length; + function finish() { + if (fail == 0) + onload(); + else + onerror(); + } + paths.forEach(function(path) { + var putRequest = files.put( + FS.analyzePath(path).object.contents, + path + ); + putRequest.onsuccess = function putRequest_onsuccess() { + ok++; + if (ok + fail == total) + finish(); + }; + putRequest.onerror = function putRequest_onerror() { + fail++; + if (ok + fail == total) + finish(); + }; + }); + transaction.onerror = onerror; + }; + openRequest.onerror = onerror; + }, + loadFilesFromDB: function(paths, onload, onerror) { + onload = onload || function() { + }; + onerror = onerror || function() { + }; + var indexedDB = FS.indexedDB(); + try { + var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION); + } catch (e) { + return onerror(e); + } + openRequest.onupgradeneeded = onerror; + openRequest.onsuccess = function openRequest_onsuccess() { + var db = openRequest.result; + try { + var transaction = db.transaction([FS.DB_STORE_NAME], "readonly"); + } catch (e) { + onerror(e); + return; + } + var files = transaction.objectStore(FS.DB_STORE_NAME); + var ok = 0, fail = 0, total = paths.length; + function finish() { + if (fail == 0) + onload(); + else + onerror(); + } + paths.forEach(function(path) { + var getRequest = files.get(path); + getRequest.onsuccess = function getRequest_onsuccess() { + if (FS.analyzePath(path).exists) { + FS.unlink(path); + } + FS.createDataFile( + PATH.dirname(path), + PATH.basename(path), + getRequest.result, + true, + true, + true + ); + ok++; + if (ok + fail == total) + finish(); + }; + getRequest.onerror = function getRequest_onerror() { + fail++; + if (ok + fail == total) + finish(); + }; + }); + transaction.onerror = onerror; + }; + openRequest.onerror = onerror; + } + }; + var SYSCALLS = { + mappings: {}, + DEFAULT_POLLMASK: 5, + umask: 511, + calculateAt: function(dirfd, path, allowEmpty) { + if (path[0] === "/") { + return path; + } + var dir; + if (dirfd === -100) { + dir = FS.cwd(); + } else { + var dirstream = FS.getStream(dirfd); + if (!dirstream) + throw new FS.ErrnoError(8); + dir = dirstream.path; + } + if (path.length == 0) { + if (!allowEmpty) { + throw new FS.ErrnoError(44); + } + return dir; + } + return PATH.join2(dir, path); + }, + doStat: function(func, path, buf) { + try { + var stat = func(path); + } catch (e) { + if (e && e.node && PATH.normalize(path) !== PATH.normalize(FS.getPath(e.node))) { + return -54; + } + throw e; + } + HEAP32[buf >> 2] = stat.dev; + HEAP32[buf + 4 >> 2] = 0; + HEAP32[buf + 8 >> 2] = stat.ino; + HEAP32[buf + 12 >> 2] = stat.mode; + HEAP32[buf + 16 >> 2] = stat.nlink; + HEAP32[buf + 20 >> 2] = stat.uid; + HEAP32[buf + 24 >> 2] = stat.gid; + HEAP32[buf + 28 >> 2] = stat.rdev; + HEAP32[buf + 32 >> 2] = 0; + tempI64 = [ + stat.size >>> 0, + (tempDouble = stat.size, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil( + (tempDouble - +(~~tempDouble >>> 0)) / 4294967296 + ) >>> 0 : 0) + ], HEAP32[buf + 40 >> 2] = tempI64[0], HEAP32[buf + 44 >> 2] = tempI64[1]; + HEAP32[buf + 48 >> 2] = 4096; + HEAP32[buf + 52 >> 2] = stat.blocks; + HEAP32[buf + 56 >> 2] = stat.atime.getTime() / 1e3 | 0; + HEAP32[buf + 60 >> 2] = 0; + HEAP32[buf + 64 >> 2] = stat.mtime.getTime() / 1e3 | 0; + HEAP32[buf + 68 >> 2] = 0; + HEAP32[buf + 72 >> 2] = stat.ctime.getTime() / 1e3 | 0; + HEAP32[buf + 76 >> 2] = 0; + tempI64 = [ + stat.ino >>> 0, + (tempDouble = stat.ino, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil( + (tempDouble - +(~~tempDouble >>> 0)) / 4294967296 + ) >>> 0 : 0) + ], HEAP32[buf + 80 >> 2] = tempI64[0], HEAP32[buf + 84 >> 2] = tempI64[1]; + return 0; + }, + doMsync: function(addr, stream, len, flags, offset) { + var buffer2 = HEAPU8.slice(addr, addr + len); + FS.msync(stream, buffer2, offset, len, flags); + }, + doMkdir: function(path, mode) { + path = PATH.normalize(path); + if (path[path.length - 1] === "/") + path = path.substr(0, path.length - 1); + FS.mkdir(path, mode, 0); + return 0; + }, + doMknod: function(path, mode, dev) { + switch (mode & 61440) { + case 32768: + case 8192: + case 24576: + case 4096: + case 49152: + break; + default: + return -28; + } + FS.mknod(path, mode, dev); + return 0; + }, + doReadlink: function(path, buf, bufsize) { + if (bufsize <= 0) + return -28; + var ret = FS.readlink(path); + var len = Math.min(bufsize, lengthBytesUTF8(ret)); + var endChar = HEAP8[buf + len]; + stringToUTF8(ret, buf, bufsize + 1); + HEAP8[buf + len] = endChar; + return len; + }, + doAccess: function(path, amode) { + if (amode & ~7) { + return -28; + } + var node; + var lookup = FS.lookupPath(path, { follow: true }); + node = lookup.node; + if (!node) { + return -44; + } + var perms = ""; + if (amode & 4) + perms += "r"; + if (amode & 2) + perms += "w"; + if (amode & 1) + perms += "x"; + if (perms && FS.nodePermissions(node, perms)) { + return -2; + } + return 0; + }, + doDup: function(path, flags, suggestFD) { + var suggest = FS.getStream(suggestFD); + if (suggest) + FS.close(suggest); + return FS.open(path, flags, 0, suggestFD, suggestFD).fd; + }, + doReadv: function(stream, iov, iovcnt, offset) { + var ret = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = HEAP32[iov + i * 8 >> 2]; + var len = HEAP32[iov + (i * 8 + 4) >> 2]; + var curr = FS.read(stream, HEAP8, ptr, len, offset); + if (curr < 0) + return -1; + ret += curr; + if (curr < len) + break; + } + return ret; + }, + doWritev: function(stream, iov, iovcnt, offset) { + var ret = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = HEAP32[iov + i * 8 >> 2]; + var len = HEAP32[iov + (i * 8 + 4) >> 2]; + var curr = FS.write(stream, HEAP8, ptr, len, offset); + if (curr < 0) + return -1; + ret += curr; + } + return ret; + }, + varargs: void 0, + get: function() { + SYSCALLS.varargs += 4; + var ret = HEAP32[SYSCALLS.varargs - 4 >> 2]; + return ret; + }, + getStr: function(ptr) { + var ret = UTF8ToString(ptr); + return ret; + }, + getStreamFromFD: function(fd) { + var stream = FS.getStream(fd); + if (!stream) + throw new FS.ErrnoError(8); + return stream; + }, + get64: function(low, high) { + return low; + } + }; + function ___sys_chmod(path, mode) { + try { + path = SYSCALLS.getStr(path); + FS.chmod(path, mode); + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) + abort(e); + return -e.errno; + } + } + function setErrNo(value) { + HEAP32[___errno_location() >> 2] = value; + return value; + } + function ___sys_fcntl64(fd, cmd, varargs) { + SYSCALLS.varargs = varargs; + try { + var stream = SYSCALLS.getStreamFromFD(fd); + switch (cmd) { + case 0: { + var arg = SYSCALLS.get(); + if (arg < 0) { + return -28; + } + var newStream; + newStream = FS.open(stream.path, stream.flags, 0, arg); + return newStream.fd; + } + case 1: + case 2: + return 0; + case 3: + return stream.flags; + case 4: { + var arg = SYSCALLS.get(); + stream.flags |= arg; + return 0; + } + case 12: { + var arg = SYSCALLS.get(); + var offset = 0; + HEAP16[arg + offset >> 1] = 2; + return 0; + } + case 13: + case 14: + return 0; + case 16: + case 8: + return -28; + case 9: + setErrNo(28); + return -1; + default: { + return -28; + } + } + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) + abort(e); + return -e.errno; + } + } + function ___sys_fstat64(fd, buf) { + try { + var stream = SYSCALLS.getStreamFromFD(fd); + return SYSCALLS.doStat(FS.stat, stream.path, buf); + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) + abort(e); + return -e.errno; + } + } + function ___sys_ioctl(fd, op, varargs) { + SYSCALLS.varargs = varargs; + try { + var stream = SYSCALLS.getStreamFromFD(fd); + switch (op) { + case 21509: + case 21505: { + if (!stream.tty) + return -59; + return 0; + } + case 21510: + case 21511: + case 21512: + case 21506: + case 21507: + case 21508: { + if (!stream.tty) + return -59; + return 0; + } + case 21519: { + if (!stream.tty) + return -59; + var argp = SYSCALLS.get(); + HEAP32[argp >> 2] = 0; + return 0; + } + case 21520: { + if (!stream.tty) + return -59; + return -28; + } + case 21531: { + var argp = SYSCALLS.get(); + return FS.ioctl(stream, op, argp); + } + case 21523: { + if (!stream.tty) + return -59; + return 0; + } + case 21524: { + if (!stream.tty) + return -59; + return 0; + } + default: + abort("bad ioctl syscall " + op); + } + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) + abort(e); + return -e.errno; + } + } + function ___sys_open(path, flags, varargs) { + SYSCALLS.varargs = varargs; + try { + var pathname = SYSCALLS.getStr(path); + var mode = varargs ? SYSCALLS.get() : 0; + var stream = FS.open(pathname, flags, mode); + return stream.fd; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) + abort(e); + return -e.errno; + } + } + function ___sys_rename(old_path, new_path) { + try { + old_path = SYSCALLS.getStr(old_path); + new_path = SYSCALLS.getStr(new_path); + FS.rename(old_path, new_path); + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) + abort(e); + return -e.errno; + } + } + function ___sys_rmdir(path) { + try { + path = SYSCALLS.getStr(path); + FS.rmdir(path); + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) + abort(e); + return -e.errno; + } + } + function ___sys_stat64(path, buf) { + try { + path = SYSCALLS.getStr(path); + return SYSCALLS.doStat(FS.stat, path, buf); + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) + abort(e); + return -e.errno; + } + } + function ___sys_unlink(path) { + try { + path = SYSCALLS.getStr(path); + FS.unlink(path); + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) + abort(e); + return -e.errno; + } + } + function _emscripten_memcpy_big(dest, src, num) { + HEAPU8.copyWithin(dest, src, src + num); + } + function emscripten_realloc_buffer(size) { + try { + wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); + updateGlobalBufferAndViews(wasmMemory.buffer); + return 1; + } catch (e) { + } + } + function _emscripten_resize_heap(requestedSize) { + var oldSize = HEAPU8.length; + requestedSize = requestedSize >>> 0; + var maxHeapSize = 2147483648; + if (requestedSize > maxHeapSize) { + return false; + } + for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { + var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); + overGrownHeapSize = Math.min( + overGrownHeapSize, + requestedSize + 100663296 + ); + var newSize = Math.min( + maxHeapSize, + alignUp(Math.max(requestedSize, overGrownHeapSize), 65536) + ); + var replacement = emscripten_realloc_buffer(newSize); + if (replacement) { + return true; + } + } + return false; + } + function _fd_close(fd) { + try { + var stream = SYSCALLS.getStreamFromFD(fd); + FS.close(stream); + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) + abort(e); + return e.errno; + } + } + function _fd_fdstat_get(fd, pbuf) { + try { + var stream = SYSCALLS.getStreamFromFD(fd); + var type = stream.tty ? 2 : FS.isDir(stream.mode) ? 3 : FS.isLink(stream.mode) ? 7 : 4; + HEAP8[pbuf >> 0] = type; + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) + abort(e); + return e.errno; + } + } + function _fd_read(fd, iov, iovcnt, pnum) { + try { + var stream = SYSCALLS.getStreamFromFD(fd); + var num = SYSCALLS.doReadv(stream, iov, iovcnt); + HEAP32[pnum >> 2] = num; + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) + abort(e); + return e.errno; + } + } + function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { + try { + var stream = SYSCALLS.getStreamFromFD(fd); + var HIGH_OFFSET = 4294967296; + var offset = offset_high * HIGH_OFFSET + (offset_low >>> 0); + var DOUBLE_LIMIT = 9007199254740992; + if (offset <= -DOUBLE_LIMIT || offset >= DOUBLE_LIMIT) { + return -61; + } + FS.llseek(stream, offset, whence); + tempI64 = [ + stream.position >>> 0, + (tempDouble = stream.position, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil( + (tempDouble - +(~~tempDouble >>> 0)) / 4294967296 + ) >>> 0 : 0) + ], HEAP32[newOffset >> 2] = tempI64[0], HEAP32[newOffset + 4 >> 2] = tempI64[1]; + if (stream.getdents && offset === 0 && whence === 0) + stream.getdents = null; + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) + abort(e); + return e.errno; + } + } + function _fd_write(fd, iov, iovcnt, pnum) { + try { + var stream = SYSCALLS.getStreamFromFD(fd); + var num = SYSCALLS.doWritev(stream, iov, iovcnt); + HEAP32[pnum >> 2] = num; + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) + abort(e); + return e.errno; + } + } + function _setTempRet0(val) { + } + function _time(ptr) { + var ret = Date.now() / 1e3 | 0; + if (ptr) { + HEAP32[ptr >> 2] = ret; + } + return ret; + } + function _tzset() { + if (_tzset.called) + return; + _tzset.called = true; + var currentYear = new Date().getFullYear(); + var winter = new Date(currentYear, 0, 1); + var summer = new Date(currentYear, 6, 1); + var winterOffset = winter.getTimezoneOffset(); + var summerOffset = summer.getTimezoneOffset(); + var stdTimezoneOffset = Math.max(winterOffset, summerOffset); + HEAP32[__get_timezone() >> 2] = stdTimezoneOffset * 60; + HEAP32[__get_daylight() >> 2] = Number(winterOffset != summerOffset); + function extractZone(date) { + var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/); + return match ? match[1] : "GMT"; + } + var winterName = extractZone(winter); + var summerName = extractZone(summer); + var winterNamePtr = allocateUTF8(winterName); + var summerNamePtr = allocateUTF8(summerName); + if (summerOffset < winterOffset) { + HEAP32[__get_tzname() >> 2] = winterNamePtr; + HEAP32[__get_tzname() + 4 >> 2] = summerNamePtr; + } else { + HEAP32[__get_tzname() >> 2] = summerNamePtr; + HEAP32[__get_tzname() + 4 >> 2] = winterNamePtr; + } + } + function _timegm(tmPtr) { + _tzset(); + var time = Date.UTC( + HEAP32[tmPtr + 20 >> 2] + 1900, + HEAP32[tmPtr + 16 >> 2], + HEAP32[tmPtr + 12 >> 2], + HEAP32[tmPtr + 8 >> 2], + HEAP32[tmPtr + 4 >> 2], + HEAP32[tmPtr >> 2], + 0 + ); + var date = new Date(time); + HEAP32[tmPtr + 24 >> 2] = date.getUTCDay(); + var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); + var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; + HEAP32[tmPtr + 28 >> 2] = yday; + return date.getTime() / 1e3 | 0; + } + var FSNode = function(parent, name, mode, rdev) { + if (!parent) { + parent = this; + } + this.parent = parent; + this.mount = parent.mount; + this.mounted = null; + this.id = FS.nextInode++; + this.name = name; + this.mode = mode; + this.node_ops = {}; + this.stream_ops = {}; + this.rdev = rdev; + }; + var readMode = 292 | 73; + var writeMode = 146; + Object.defineProperties(FSNode.prototype, { + read: { + get: function() { + return (this.mode & readMode) === readMode; + }, + set: function(val) { + val ? this.mode |= readMode : this.mode &= ~readMode; + } + }, + write: { + get: function() { + return (this.mode & writeMode) === writeMode; + }, + set: function(val) { + val ? this.mode |= writeMode : this.mode &= ~writeMode; + } + }, + isFolder: { + get: function() { + return FS.isDir(this.mode); + } + }, + isDevice: { + get: function() { + return FS.isChrdev(this.mode); + } + } + }); + FS.FSNode = FSNode; + FS.staticInit(); + { + var fs = frozenFs; + var NODEJS_PATH = path__default.default; + NODEFS.staticInit(); + } + { + var _wrapNodeError = function(func) { + return function() { + try { + return func.apply(this, arguments); + } catch (e) { + if (!e.code) + throw e; + throw new FS.ErrnoError(ERRNO_CODES[e.code]); + } + }; + }; + var VFS = Object.assign({}, FS); + for (var _key in NODERAWFS) + FS[_key] = _wrapNodeError(NODERAWFS[_key]); + } + function intArrayFromString(stringy, dontAddNull, length) { + var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1; + var u8array = new Array(len); + var numBytesWritten = stringToUTF8Array( + stringy, + u8array, + 0, + u8array.length + ); + if (dontAddNull) + u8array.length = numBytesWritten; + return u8array; + } + function intArrayFromBase64(s) { + { + var buf; + try { + buf = Buffer.from(s, "base64"); + } catch (_) { + buf = new Buffer(s, "base64"); + } + return new Uint8Array( + buf["buffer"], + buf["byteOffset"], + buf["byteLength"] + ); + } + } + function tryParseAsDataURI(filename) { + if (!isDataURI(filename)) { + return; + } + return intArrayFromBase64(filename.slice(dataURIPrefix.length)); + } + var asmLibraryArg = { + s: ___gmtime_r, + p: ___sys_chmod, + e: ___sys_fcntl64, + k: ___sys_fstat64, + o: ___sys_ioctl, + q: ___sys_open, + i: ___sys_rename, + r: ___sys_rmdir, + c: ___sys_stat64, + h: ___sys_unlink, + l: _emscripten_memcpy_big, + m: _emscripten_resize_heap, + f: _fd_close, + j: _fd_fdstat_get, + g: _fd_read, + n: _fd_seek, + d: _fd_write, + a: _setTempRet0, + b: _time, + t: _timegm + }; + var asm = createWasm(); + Module["___wasm_call_ctors"] = asm["v"]; + Module["_zip_ext_count_symlinks"] = asm["w"]; + Module["_zip_file_get_external_attributes"] = asm["x"]; + Module["_zipstruct_stat"] = asm["y"]; + Module["_zipstruct_statS"] = asm["z"]; + Module["_zipstruct_stat_name"] = asm["A"]; + Module["_zipstruct_stat_index"] = asm["B"]; + Module["_zipstruct_stat_size"] = asm["C"]; + Module["_zipstruct_stat_mtime"] = asm["D"]; + Module["_zipstruct_stat_crc"] = asm["E"]; + Module["_zipstruct_error"] = asm["F"]; + Module["_zipstruct_errorS"] = asm["G"]; + Module["_zipstruct_error_code_zip"] = asm["H"]; + Module["_zipstruct_stat_comp_size"] = asm["I"]; + Module["_zipstruct_stat_comp_method"] = asm["J"]; + Module["_zip_close"] = asm["K"]; + Module["_zip_delete"] = asm["L"]; + Module["_zip_dir_add"] = asm["M"]; + Module["_zip_discard"] = asm["N"]; + Module["_zip_error_init_with_code"] = asm["O"]; + Module["_zip_get_error"] = asm["P"]; + Module["_zip_file_get_error"] = asm["Q"]; + Module["_zip_error_strerror"] = asm["R"]; + Module["_zip_fclose"] = asm["S"]; + Module["_zip_file_add"] = asm["T"]; + Module["_free"] = asm["U"]; + var _malloc = Module["_malloc"] = asm["V"]; + var ___errno_location = Module["___errno_location"] = asm["W"]; + Module["_zip_source_error"] = asm["X"]; + Module["_zip_source_seek"] = asm["Y"]; + Module["_zip_file_set_external_attributes"] = asm["Z"]; + Module["_zip_file_set_mtime"] = asm["_"]; + Module["_zip_fopen"] = asm["$"]; + Module["_zip_fopen_index"] = asm["aa"]; + Module["_zip_fread"] = asm["ba"]; + Module["_zip_get_name"] = asm["ca"]; + Module["_zip_get_num_entries"] = asm["da"]; + Module["_zip_source_read"] = asm["ea"]; + Module["_zip_name_locate"] = asm["fa"]; + Module["_zip_open"] = asm["ga"]; + Module["_zip_open_from_source"] = asm["ha"]; + Module["_zip_set_file_compression"] = asm["ia"]; + Module["_zip_source_buffer"] = asm["ja"]; + Module["_zip_source_buffer_create"] = asm["ka"]; + Module["_zip_source_close"] = asm["la"]; + Module["_zip_source_free"] = asm["ma"]; + Module["_zip_source_keep"] = asm["na"]; + Module["_zip_source_open"] = asm["oa"]; + Module["_zip_source_set_mtime"] = asm["qa"]; + Module["_zip_source_tell"] = asm["ra"]; + Module["_zip_stat"] = asm["sa"]; + Module["_zip_stat_index"] = asm["ta"]; + var __get_tzname = Module["__get_tzname"] = asm["ua"]; + var __get_daylight = Module["__get_daylight"] = asm["va"]; + var __get_timezone = Module["__get_timezone"] = asm["wa"]; + var stackSave = Module["stackSave"] = asm["xa"]; + var stackRestore = Module["stackRestore"] = asm["ya"]; + var stackAlloc = Module["stackAlloc"] = asm["za"]; + Module["cwrap"] = cwrap; + Module["getValue"] = getValue; + var calledRun; + dependenciesFulfilled = function runCaller() { + if (!calledRun) + run(); + if (!calledRun) + dependenciesFulfilled = runCaller; + }; + function run(args) { + if (runDependencies > 0) { + return; + } + preRun(); + if (runDependencies > 0) { + return; + } + function doRun() { + if (calledRun) + return; + calledRun = true; + Module["calledRun"] = true; + if (ABORT) + return; + initRuntime(); + readyPromiseResolve(Module); + if (Module["onRuntimeInitialized"]) + Module["onRuntimeInitialized"](); + postRun(); + } + if (Module["setStatus"]) { + Module["setStatus"]("Running..."); + setTimeout(function() { + setTimeout(function() { + Module["setStatus"](""); + }, 1); + doRun(); + }, 1); + } else { + doRun(); + } + } + Module["run"] = run; + if (Module["preInit"]) { + if (typeof Module["preInit"] == "function") + Module["preInit"] = [Module["preInit"]]; + while (Module["preInit"].length > 0) { + Module["preInit"].pop()(); + } + } + run(); + return createModule2; + }; +}(); +module.exports = createModule; +}(libzipSync)); + +const createModule = libzipSync.exports; + +const number64 = [ + `number`, + `number` +]; +var Errors = /* @__PURE__ */ ((Errors2) => { + Errors2[Errors2["ZIP_ER_OK"] = 0] = "ZIP_ER_OK"; + Errors2[Errors2["ZIP_ER_MULTIDISK"] = 1] = "ZIP_ER_MULTIDISK"; + Errors2[Errors2["ZIP_ER_RENAME"] = 2] = "ZIP_ER_RENAME"; + Errors2[Errors2["ZIP_ER_CLOSE"] = 3] = "ZIP_ER_CLOSE"; + Errors2[Errors2["ZIP_ER_SEEK"] = 4] = "ZIP_ER_SEEK"; + Errors2[Errors2["ZIP_ER_READ"] = 5] = "ZIP_ER_READ"; + Errors2[Errors2["ZIP_ER_WRITE"] = 6] = "ZIP_ER_WRITE"; + Errors2[Errors2["ZIP_ER_CRC"] = 7] = "ZIP_ER_CRC"; + Errors2[Errors2["ZIP_ER_ZIPCLOSED"] = 8] = "ZIP_ER_ZIPCLOSED"; + Errors2[Errors2["ZIP_ER_NOENT"] = 9] = "ZIP_ER_NOENT"; + Errors2[Errors2["ZIP_ER_EXISTS"] = 10] = "ZIP_ER_EXISTS"; + Errors2[Errors2["ZIP_ER_OPEN"] = 11] = "ZIP_ER_OPEN"; + Errors2[Errors2["ZIP_ER_TMPOPEN"] = 12] = "ZIP_ER_TMPOPEN"; + Errors2[Errors2["ZIP_ER_ZLIB"] = 13] = "ZIP_ER_ZLIB"; + Errors2[Errors2["ZIP_ER_MEMORY"] = 14] = "ZIP_ER_MEMORY"; + Errors2[Errors2["ZIP_ER_CHANGED"] = 15] = "ZIP_ER_CHANGED"; + Errors2[Errors2["ZIP_ER_COMPNOTSUPP"] = 16] = "ZIP_ER_COMPNOTSUPP"; + Errors2[Errors2["ZIP_ER_EOF"] = 17] = "ZIP_ER_EOF"; + Errors2[Errors2["ZIP_ER_INVAL"] = 18] = "ZIP_ER_INVAL"; + Errors2[Errors2["ZIP_ER_NOZIP"] = 19] = "ZIP_ER_NOZIP"; + Errors2[Errors2["ZIP_ER_INTERNAL"] = 20] = "ZIP_ER_INTERNAL"; + Errors2[Errors2["ZIP_ER_INCONS"] = 21] = "ZIP_ER_INCONS"; + Errors2[Errors2["ZIP_ER_REMOVE"] = 22] = "ZIP_ER_REMOVE"; + Errors2[Errors2["ZIP_ER_DELETED"] = 23] = "ZIP_ER_DELETED"; + Errors2[Errors2["ZIP_ER_ENCRNOTSUPP"] = 24] = "ZIP_ER_ENCRNOTSUPP"; + Errors2[Errors2["ZIP_ER_RDONLY"] = 25] = "ZIP_ER_RDONLY"; + Errors2[Errors2["ZIP_ER_NOPASSWD"] = 26] = "ZIP_ER_NOPASSWD"; + Errors2[Errors2["ZIP_ER_WRONGPASSWD"] = 27] = "ZIP_ER_WRONGPASSWD"; + Errors2[Errors2["ZIP_ER_OPNOTSUPP"] = 28] = "ZIP_ER_OPNOTSUPP"; + Errors2[Errors2["ZIP_ER_INUSE"] = 29] = "ZIP_ER_INUSE"; + Errors2[Errors2["ZIP_ER_TELL"] = 30] = "ZIP_ER_TELL"; + Errors2[Errors2["ZIP_ER_COMPRESSED_DATA"] = 31] = "ZIP_ER_COMPRESSED_DATA"; + return Errors2; +})(Errors || {}); +const makeInterface = (libzip) => ({ + get HEAP8() { + return libzip.HEAP8; + }, + get HEAPU8() { + return libzip.HEAPU8; + }, + errors: Errors, + SEEK_SET: 0, + SEEK_CUR: 1, + SEEK_END: 2, + ZIP_CHECKCONS: 4, + ZIP_CREATE: 1, + ZIP_EXCL: 2, + ZIP_TRUNCATE: 8, + ZIP_RDONLY: 16, + ZIP_FL_OVERWRITE: 8192, + ZIP_FL_COMPRESSED: 4, + ZIP_OPSYS_DOS: 0, + ZIP_OPSYS_AMIGA: 1, + ZIP_OPSYS_OPENVMS: 2, + ZIP_OPSYS_UNIX: 3, + ZIP_OPSYS_VM_CMS: 4, + ZIP_OPSYS_ATARI_ST: 5, + ZIP_OPSYS_OS_2: 6, + ZIP_OPSYS_MACINTOSH: 7, + ZIP_OPSYS_Z_SYSTEM: 8, + ZIP_OPSYS_CPM: 9, + ZIP_OPSYS_WINDOWS_NTFS: 10, + ZIP_OPSYS_MVS: 11, + ZIP_OPSYS_VSE: 12, + ZIP_OPSYS_ACORN_RISC: 13, + ZIP_OPSYS_VFAT: 14, + ZIP_OPSYS_ALTERNATE_MVS: 15, + ZIP_OPSYS_BEOS: 16, + ZIP_OPSYS_TANDEM: 17, + ZIP_OPSYS_OS_400: 18, + ZIP_OPSYS_OS_X: 19, + ZIP_CM_DEFAULT: -1, + ZIP_CM_STORE: 0, + ZIP_CM_DEFLATE: 8, + uint08S: libzip._malloc(1), + uint16S: libzip._malloc(2), + uint32S: libzip._malloc(4), + uint64S: libzip._malloc(8), + malloc: libzip._malloc, + free: libzip._free, + getValue: libzip.getValue, + open: libzip.cwrap(`zip_open`, `number`, [`string`, `number`, `number`]), + openFromSource: libzip.cwrap(`zip_open_from_source`, `number`, [`number`, `number`, `number`]), + close: libzip.cwrap(`zip_close`, `number`, [`number`]), + discard: libzip.cwrap(`zip_discard`, null, [`number`]), + getError: libzip.cwrap(`zip_get_error`, `number`, [`number`]), + getName: libzip.cwrap(`zip_get_name`, `string`, [`number`, `number`, `number`]), + getNumEntries: libzip.cwrap(`zip_get_num_entries`, `number`, [`number`, `number`]), + delete: libzip.cwrap(`zip_delete`, `number`, [`number`, `number`]), + stat: libzip.cwrap(`zip_stat`, `number`, [`number`, `string`, `number`, `number`]), + statIndex: libzip.cwrap(`zip_stat_index`, `number`, [`number`, ...number64, `number`, `number`]), + fopen: libzip.cwrap(`zip_fopen`, `number`, [`number`, `string`, `number`]), + fopenIndex: libzip.cwrap(`zip_fopen_index`, `number`, [`number`, ...number64, `number`]), + fread: libzip.cwrap(`zip_fread`, `number`, [`number`, `number`, `number`, `number`]), + fclose: libzip.cwrap(`zip_fclose`, `number`, [`number`]), + dir: { + add: libzip.cwrap(`zip_dir_add`, `number`, [`number`, `string`]) + }, + file: { + add: libzip.cwrap(`zip_file_add`, `number`, [`number`, `string`, `number`, `number`]), + getError: libzip.cwrap(`zip_file_get_error`, `number`, [`number`]), + getExternalAttributes: libzip.cwrap(`zip_file_get_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), + setExternalAttributes: libzip.cwrap(`zip_file_set_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), + setMtime: libzip.cwrap(`zip_file_set_mtime`, `number`, [`number`, ...number64, `number`, `number`]), + setCompression: libzip.cwrap(`zip_set_file_compression`, `number`, [`number`, ...number64, `number`, `number`]) + }, + ext: { + countSymlinks: libzip.cwrap(`zip_ext_count_symlinks`, `number`, [`number`]) + }, + error: { + initWithCode: libzip.cwrap(`zip_error_init_with_code`, null, [`number`, `number`]), + strerror: libzip.cwrap(`zip_error_strerror`, `string`, [`number`]) + }, + name: { + locate: libzip.cwrap(`zip_name_locate`, `number`, [`number`, `string`, `number`]) + }, + source: { + fromUnattachedBuffer: libzip.cwrap(`zip_source_buffer_create`, `number`, [`number`, `number`, `number`, `number`]), + fromBuffer: libzip.cwrap(`zip_source_buffer`, `number`, [`number`, `number`, ...number64, `number`]), + free: libzip.cwrap(`zip_source_free`, null, [`number`]), + keep: libzip.cwrap(`zip_source_keep`, null, [`number`]), + open: libzip.cwrap(`zip_source_open`, `number`, [`number`]), + close: libzip.cwrap(`zip_source_close`, `number`, [`number`]), + seek: libzip.cwrap(`zip_source_seek`, `number`, [`number`, ...number64, `number`]), + tell: libzip.cwrap(`zip_source_tell`, `number`, [`number`]), + read: libzip.cwrap(`zip_source_read`, `number`, [`number`, `number`, `number`]), + error: libzip.cwrap(`zip_source_error`, `number`, [`number`]), + setMtime: libzip.cwrap(`zip_source_set_mtime`, `number`, [`number`, `number`]) + }, + struct: { + stat: libzip.cwrap(`zipstruct_stat`, `number`, []), + statS: libzip.cwrap(`zipstruct_statS`, `number`, []), + statName: libzip.cwrap(`zipstruct_stat_name`, `string`, [`number`]), + statIndex: libzip.cwrap(`zipstruct_stat_index`, `number`, [`number`]), + statSize: libzip.cwrap(`zipstruct_stat_size`, `number`, [`number`]), + statCompSize: libzip.cwrap(`zipstruct_stat_comp_size`, `number`, [`number`]), + statCompMethod: libzip.cwrap(`zipstruct_stat_comp_method`, `number`, [`number`]), + statMtime: libzip.cwrap(`zipstruct_stat_mtime`, `number`, [`number`]), + statCrc: libzip.cwrap(`zipstruct_stat_crc`, `number`, [`number`]), + error: libzip.cwrap(`zipstruct_error`, `number`, []), + errorS: libzip.cwrap(`zipstruct_errorS`, `number`, []), + errorCodeZip: libzip.cwrap(`zipstruct_error_code_zip`, `number`, [`number`]) + } +}); + +let mod = null; +function getLibzipSync() { + if (mod === null) + mod = makeInterface(createModule()); + return mod; +} + +var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => { + ErrorCode2["API_ERROR"] = `API_ERROR`; + ErrorCode2["BUILTIN_NODE_RESOLUTION_FAILED"] = `BUILTIN_NODE_RESOLUTION_FAILED`; + ErrorCode2["EXPORTS_RESOLUTION_FAILED"] = `EXPORTS_RESOLUTION_FAILED`; + ErrorCode2["MISSING_DEPENDENCY"] = `MISSING_DEPENDENCY`; + ErrorCode2["MISSING_PEER_DEPENDENCY"] = `MISSING_PEER_DEPENDENCY`; + ErrorCode2["QUALIFIED_PATH_RESOLUTION_FAILED"] = `QUALIFIED_PATH_RESOLUTION_FAILED`; + ErrorCode2["INTERNAL"] = `INTERNAL`; + ErrorCode2["UNDECLARED_DEPENDENCY"] = `UNDECLARED_DEPENDENCY`; + ErrorCode2["UNSUPPORTED"] = `UNSUPPORTED`; + return ErrorCode2; +})(ErrorCode || {}); +const MODULE_NOT_FOUND_ERRORS = /* @__PURE__ */ new Set([ + "BUILTIN_NODE_RESOLUTION_FAILED" /* BUILTIN_NODE_RESOLUTION_FAILED */, + "MISSING_DEPENDENCY" /* MISSING_DEPENDENCY */, + "MISSING_PEER_DEPENDENCY" /* MISSING_PEER_DEPENDENCY */, + "QUALIFIED_PATH_RESOLUTION_FAILED" /* QUALIFIED_PATH_RESOLUTION_FAILED */, + "UNDECLARED_DEPENDENCY" /* UNDECLARED_DEPENDENCY */ +]); +function makeError(pnpCode, message, data = {}, code) { + code != null ? code : code = MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode; + const propertySpec = { + configurable: true, + writable: true, + enumerable: false + }; + return Object.defineProperties(new Error(message), { + code: { + ...propertySpec, + value: code + }, + pnpCode: { + ...propertySpec, + value: pnpCode + }, + data: { + ...propertySpec, + value: data + } + }); +} +function getIssuerModule(parent) { + let issuer = parent; + while (issuer && (issuer.id === `[eval]` || issuer.id === `` || !issuer.filename)) + issuer = issuer.parent; + return issuer || null; +} +function getPathForDisplay(p) { + return npath.normalize(npath.fromPortablePath(p)); +} + +const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10)); +const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13; + +const builtinModules = new Set(require$$0.Module.builtinModules || Object.keys(process.binding(`natives`))); +const isBuiltinModule = (request) => request.startsWith(`node:`) || builtinModules.has(request); +function readPackageScope(checkPath) { + const rootSeparatorIndex = checkPath.indexOf(npath.sep); + let separatorIndex; + do { + separatorIndex = checkPath.lastIndexOf(npath.sep); + checkPath = checkPath.slice(0, separatorIndex); + if (checkPath.endsWith(`${npath.sep}node_modules`)) + return false; + const pjson = readPackage(checkPath + npath.sep); + if (pjson) { + return { + data: pjson, + path: checkPath + }; + } + } while (separatorIndex > rootSeparatorIndex); + return false; +} +function readPackage(requestPath) { + const jsonPath = npath.resolve(requestPath, `package.json`); + if (!fs__default.default.existsSync(jsonPath)) + return null; + return JSON.parse(fs__default.default.readFileSync(jsonPath, `utf8`)); +} +function ERR_REQUIRE_ESM(filename, parentPath = null) { + const basename = parentPath && path__default.default.basename(filename) === path__default.default.basename(parentPath) ? filename : path__default.default.basename(filename); + const msg = `require() of ES Module ${filename}${parentPath ? ` from ${parentPath}` : ``} not supported. +Instead change the require of ${basename} in ${parentPath} to a dynamic import() which is available in all CommonJS modules.`; + const err = new Error(msg); + err.code = `ERR_REQUIRE_ESM`; + return err; +} +function reportRequiredFilesToWatchMode(files) { + if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) { + files = files.map((filename) => npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename)))); + if (WATCH_MODE_MESSAGE_USES_ARRAYS) { + process.send({ "watch:require": files }); + } else { + for (const filename of files) { + process.send({ "watch:require": filename }); + } + } + } +} + +function applyPatch(pnpapi, opts) { + const defaultCache = {}; + let enableNativeHooks = true; + process.versions.pnp = String(pnpapi.VERSIONS.std); + const moduleExports = require$$0__default.default; + moduleExports.findPnpApi = (lookupSource) => { + const lookupPath = lookupSource instanceof url.URL ? url.fileURLToPath(lookupSource) : lookupSource; + const apiPath = opts.manager.findApiPathFor(lookupPath); + if (apiPath === null) + return null; + const apiEntry = opts.manager.getApiEntry(apiPath, true); + return apiEntry.instance.findPackageLocator(lookupPath) ? apiEntry.instance : null; + }; + function getRequireStack(parent) { + const requireStack = []; + for (let cursor = parent; cursor; cursor = cursor.parent) + requireStack.push(cursor.filename || cursor.id); + return requireStack; + } + const originalModuleLoad = require$$0.Module._load; + require$$0.Module._load = function(request, parent, isMain) { + if (!enableNativeHooks) + return originalModuleLoad.call(require$$0.Module, request, parent, isMain); + if (isBuiltinModule(request)) { + try { + enableNativeHooks = false; + return originalModuleLoad.call(require$$0.Module, request, parent, isMain); + } finally { + enableNativeHooks = true; + } + } + const parentApiPath = opts.manager.getApiPathFromParent(parent); + const parentApi = parentApiPath !== null ? opts.manager.getApiEntry(parentApiPath, true).instance : null; + if (parentApi === null) + return originalModuleLoad(request, parent, isMain); + if (request === `pnpapi`) + return parentApi; + const modulePath = require$$0.Module._resolveFilename(request, parent, isMain); + const isOwnedByRuntime = parentApi !== null ? parentApi.findPackageLocator(modulePath) !== null : false; + const moduleApiPath = isOwnedByRuntime ? parentApiPath : opts.manager.findApiPathFor(npath.dirname(modulePath)); + const entry = moduleApiPath !== null ? opts.manager.getApiEntry(moduleApiPath) : { instance: null, cache: defaultCache }; + const cacheEntry = entry.cache[modulePath]; + if (cacheEntry) { + if (cacheEntry.loaded === false && cacheEntry.isLoading !== true) { + try { + cacheEntry.isLoading = true; + if (isMain) { + process.mainModule = cacheEntry; + cacheEntry.id = `.`; + } + cacheEntry.load(modulePath); + } finally { + cacheEntry.isLoading = false; + } + } + return cacheEntry.exports; + } + const module = new require$$0.Module(modulePath, parent != null ? parent : void 0); + module.pnpApiPath = moduleApiPath; + reportRequiredFilesToWatchMode([modulePath]); + entry.cache[modulePath] = module; + if (isMain) { + process.mainModule = module; + module.id = `.`; + } + let hasThrown = true; + try { + module.isLoading = true; + module.load(modulePath); + hasThrown = false; + } finally { + module.isLoading = false; + if (hasThrown) { + delete require$$0.Module._cache[modulePath]; + } + } + return module.exports; + }; + function getIssuerSpecsFromPaths(paths) { + return paths.map((path) => ({ + apiPath: opts.manager.findApiPathFor(path), + path, + module: null + })); + } + function getIssuerSpecsFromModule(module) { + var _a; + if (module && module.id !== `` && module.id !== `internal/preload` && !module.parent && !module.filename && module.paths.length > 0) { + return [{ + apiPath: opts.manager.findApiPathFor(module.paths[0]), + path: module.paths[0], + module + }]; + } + const issuer = getIssuerModule(module); + if (issuer !== null) { + const path = npath.dirname(issuer.filename); + const apiPath = opts.manager.getApiPathFromParent(issuer); + return [{ apiPath, path, module }]; + } else { + const path = process.cwd(); + const apiPath = (_a = opts.manager.findApiPathFor(npath.join(path, `[file]`))) != null ? _a : opts.manager.getApiPathFromParent(null); + return [{ apiPath, path, module }]; + } + } + function makeFakeParent(path) { + const fakeParent = new require$$0.Module(``); + const fakeFilePath = npath.join(path, `[file]`); + fakeParent.paths = require$$0.Module._nodeModulePaths(fakeFilePath); + return fakeParent; + } + const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:@[^/]+\/)?[^/]+)\/*(.*|)$/; + const originalModuleResolveFilename = require$$0.Module._resolveFilename; + require$$0.Module._resolveFilename = function(request, parent, isMain, options) { + if (isBuiltinModule(request)) + return request; + if (!enableNativeHooks) + return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, options); + if (options && options.plugnplay === false) { + const { plugnplay, ...rest } = options; + const forwardedOptions = Object.keys(rest).length > 0 ? rest : void 0; + try { + enableNativeHooks = false; + return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, forwardedOptions); + } finally { + enableNativeHooks = true; + } + } + if (options) { + const optionNames = new Set(Object.keys(options)); + optionNames.delete(`paths`); + optionNames.delete(`plugnplay`); + if (optionNames.size > 0) { + throw makeError( + ErrorCode.UNSUPPORTED, + `Some options passed to require() aren't supported by PnP yet (${Array.from(optionNames).join(`, `)})` + ); + } + } + const issuerSpecs = options && options.paths ? getIssuerSpecsFromPaths(options.paths) : getIssuerSpecsFromModule(parent); + if (request.match(pathRegExp) === null) { + const parentDirectory = (parent == null ? void 0 : parent.filename) != null ? npath.dirname(parent.filename) : null; + const absoluteRequest = npath.isAbsolute(request) ? request : parentDirectory !== null ? npath.resolve(parentDirectory, request) : null; + if (absoluteRequest !== null) { + const apiPath = parentDirectory === npath.dirname(absoluteRequest) && (parent == null ? void 0 : parent.pnpApiPath) ? parent.pnpApiPath : opts.manager.findApiPathFor(absoluteRequest); + if (apiPath !== null) { + issuerSpecs.unshift({ + apiPath, + path: parentDirectory, + module: null + }); + } + } + } + let firstError; + for (const { apiPath, path, module } of issuerSpecs) { + let resolution; + const issuerApi = apiPath !== null ? opts.manager.getApiEntry(apiPath, true).instance : null; + try { + if (issuerApi !== null) { + resolution = issuerApi.resolveRequest(request, path !== null ? `${path}/` : null); + } else { + if (path === null) + throw new Error(`Assertion failed: Expected the path to be set`); + resolution = originalModuleResolveFilename.call(require$$0.Module, request, module || makeFakeParent(path), isMain); + } + } catch (error) { + firstError = firstError || error; + continue; + } + if (resolution !== null) { + return resolution; + } + } + const requireStack = getRequireStack(parent); + Object.defineProperty(firstError, `requireStack`, { + configurable: true, + writable: true, + enumerable: false, + value: requireStack + }); + if (requireStack.length > 0) + firstError.message += ` +Require stack: +- ${requireStack.join(` +- `)}`; + if (typeof firstError.pnpCode === `string`) + Error.captureStackTrace(firstError); + throw firstError; + }; + const originalFindPath = require$$0.Module._findPath; + require$$0.Module._findPath = function(request, paths, isMain) { + if (request === `pnpapi`) + return false; + if (!enableNativeHooks) + return originalFindPath.call(require$$0.Module, request, paths, isMain); + const isAbsolute = npath.isAbsolute(request); + if (isAbsolute) + paths = [``]; + else if (!paths || paths.length === 0) + return false; + for (const path of paths) { + let resolution; + try { + const pnpApiPath = opts.manager.findApiPathFor(isAbsolute ? request : path); + if (pnpApiPath !== null) { + const api = opts.manager.getApiEntry(pnpApiPath, true).instance; + resolution = api.resolveRequest(request, path) || false; + } else { + resolution = originalFindPath.call(require$$0.Module, request, [path], isMain); + } + } catch (error) { + continue; + } + if (resolution) { + return resolution; + } + } + return false; + }; + const originalExtensionJSFunction = require$$0.Module._extensions[`.js`]; + require$$0.Module._extensions[`.js`] = function(module, filename) { + var _a, _b; + if (filename.endsWith(`.js`)) { + const pkg = readPackageScope(filename); + if (pkg && ((_a = pkg.data) == null ? void 0 : _a.type) === `module`) { + const err = ERR_REQUIRE_ESM(filename, (_b = module.parent) == null ? void 0 : _b.filename); + Error.captureStackTrace(err); + throw err; + } + } + originalExtensionJSFunction.call(this, module, filename); + }; + const originalDlopen = process.dlopen; + process.dlopen = function(...args) { + const [module, filename, ...rest] = args; + return originalDlopen.call( + this, + module, + npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))), + ...rest + ); + }; + const originalEmit = process.emit; + process.emit = function(name, data, ...args) { + if (name === `warning` && typeof data === `object` && data.name === `ExperimentalWarning` && (data.message.includes(`--experimental-loader`) || data.message.includes(`Custom ESM Loaders is an experimental feature`))) + return false; + return originalEmit.apply(process, arguments); + }; + patchFs(fs__default.default, new PosixFS(opts.fakeFs)); +} + +function hydrateRuntimeState(data, { basePath }) { + const portablePath = npath.toPortablePath(basePath); + const absolutePortablePath = ppath.resolve(portablePath); + const ignorePattern = data.ignorePatternData !== null ? new RegExp(data.ignorePatternData) : null; + const packageLocatorsByLocations = /* @__PURE__ */ new Map(); + const packageRegistry = new Map(data.packageRegistryData.map(([packageName, packageStoreData]) => { + return [packageName, new Map(packageStoreData.map(([packageReference, packageInformationData]) => { + var _a; + if (packageName === null !== (packageReference === null)) + throw new Error(`Assertion failed: The name and reference should be null, or neither should`); + const discardFromLookup = (_a = packageInformationData.discardFromLookup) != null ? _a : false; + const packageLocator = { name: packageName, reference: packageReference }; + const entry = packageLocatorsByLocations.get(packageInformationData.packageLocation); + if (!entry) { + packageLocatorsByLocations.set(packageInformationData.packageLocation, { locator: packageLocator, discardFromLookup }); + } else { + entry.discardFromLookup = entry.discardFromLookup && discardFromLookup; + if (!discardFromLookup) { + entry.locator = packageLocator; + } + } + let resolvedPackageLocation = null; + return [packageReference, { + packageDependencies: new Map(packageInformationData.packageDependencies), + packagePeers: new Set(packageInformationData.packagePeers), + linkType: packageInformationData.linkType, + discardFromLookup, + get packageLocation() { + return resolvedPackageLocation || (resolvedPackageLocation = ppath.join(absolutePortablePath, packageInformationData.packageLocation)); + } + }]; + }))]; + })); + const fallbackExclusionList = new Map(data.fallbackExclusionList.map(([packageName, packageReferences]) => { + return [packageName, new Set(packageReferences)]; + })); + const fallbackPool = new Map(data.fallbackPool); + const dependencyTreeRoots = data.dependencyTreeRoots; + const enableTopLevelFallback = data.enableTopLevelFallback; + return { + basePath: portablePath, + dependencyTreeRoots, + enableTopLevelFallback, + fallbackExclusionList, + fallbackPool, + ignorePattern, + packageLocatorsByLocations, + packageRegistry + }; +} + +/** + * @param {object} exports + * @param {Set} keys + */ +function loop(exports, keys) { + if (typeof exports === 'string') { + return exports; + } + + if (exports) { + let idx, tmp; + if (Array.isArray(exports)) { + for (idx=0; idx < exports.length; idx++) { + if (tmp = loop(exports[idx], keys)) return tmp; + } + } else { + for (idx in exports) { + if (keys.has(idx)) { + return loop(exports[idx], keys); + } + } + } + } +} + +/** + * @param {string} name The package name + * @param {string} entry The target entry, eg "." + * @param {number} [condition] Unmatched condition? + */ +function bail(name, entry, condition) { + throw new Error( + condition + ? `No known conditions for "${entry}" entry in "${name}" package` + : `Missing "${entry}" export in "${name}" package` + ); +} + +/** + * @param {string} name the package name + * @param {string} entry the target path/import + */ +function toName(name, entry) { + return entry === name ? '.' + : entry[0] === '.' ? entry + : entry.replace(new RegExp('^' + name + '\/'), './'); +} + +/** + * @param {object} pkg package.json contents + * @param {string} [entry] entry name or import path + * @param {object} [options] + * @param {boolean} [options.browser] + * @param {boolean} [options.require] + * @param {string[]} [options.conditions] + * @param {boolean} [options.unsafe] + */ +function resolve(pkg, entry='.', options={}) { + let { name, exports } = pkg; + + if (exports) { + let { browser, require, unsafe, conditions=[] } = options; + + let target = toName(name, entry); + if (target[0] !== '.') target = './' + target; + + if (typeof exports === 'string') { + return target === '.' ? exports : bail(name, target); + } + + let allows = new Set(['default', ...conditions]); + unsafe || allows.add(require ? 'require' : 'import'); + unsafe || allows.add(browser ? 'browser' : 'node'); + + let key, tmp, isSingle=false; + + for (key in exports) { + isSingle = key[0] !== '.'; + break; + } + + if (isSingle) { + return target === '.' + ? loop(exports, allows) || bail(name, target, 1) + : bail(name, target); + } + + if (tmp = exports[target]) { + return loop(tmp, allows) || bail(name, target, 1); + } + + for (key in exports) { + tmp = key[key.length - 1]; + if (tmp === '/' && target.startsWith(key)) { + return (tmp = loop(exports[key], allows)) + ? (tmp + target.substring(key.length)) + : bail(name, target, 1); + } + if (tmp === '*' && target.startsWith(key.slice(0, -1))) { + // do not trigger if no *content* to inject + if (target.substring(key.length - 1).length > 0) { + return (tmp = loop(exports[key], allows)) + ? tmp.replace('*', target.substring(key.length - 1)) + : bail(name, target, 1); + } + } + } + + return bail(name, target); + } +} + +const ArrayIsArray = Array.isArray; +const JSONStringify = JSON.stringify; +const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames; +const ObjectPrototypeHasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); +const RegExpPrototypeExec = (obj, string) => RegExp.prototype.exec.call(obj, string); +const RegExpPrototypeSymbolReplace = (obj, ...rest) => RegExp.prototype[Symbol.replace].apply(obj, rest); +const StringPrototypeEndsWith = (str, ...rest) => String.prototype.endsWith.apply(str, rest); +const StringPrototypeIncludes = (str, ...rest) => String.prototype.includes.apply(str, rest); +const StringPrototypeLastIndexOf = (str, ...rest) => String.prototype.lastIndexOf.apply(str, rest); +const StringPrototypeIndexOf = (str, ...rest) => String.prototype.indexOf.apply(str, rest); +const StringPrototypeReplace = (str, ...rest) => String.prototype.replace.apply(str, rest); +const StringPrototypeSlice = (str, ...rest) => String.prototype.slice.apply(str, rest); +const StringPrototypeStartsWith = (str, ...rest) => String.prototype.startsWith.apply(str, rest); +const SafeMap = Map; +const JSONParse = JSON.parse; + +function createErrorType(code, messageCreator, errorType) { + return class extends errorType { + constructor(...args) { + super(messageCreator(...args)); + this.code = code; + this.name = `${errorType.name} [${code}]`; + } + }; +} +const ERR_PACKAGE_IMPORT_NOT_DEFINED = createErrorType( + `ERR_PACKAGE_IMPORT_NOT_DEFINED`, + (specifier, packagePath, base) => { + return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ``} imported from ${base}`; + }, + TypeError +); +const ERR_INVALID_MODULE_SPECIFIER = createErrorType( + `ERR_INVALID_MODULE_SPECIFIER`, + (request, reason, base = void 0) => { + return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ``}`; + }, + TypeError +); +const ERR_INVALID_PACKAGE_TARGET = createErrorType( + `ERR_INVALID_PACKAGE_TARGET`, + (pkgPath, key, target, isImport = false, base = void 0) => { + const relError = typeof target === `string` && !isImport && target.length && !StringPrototypeStartsWith(target, `./`); + if (key === `.`) { + assert__default.default(isImport === false); + return `Invalid "exports" main target ${JSONStringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; + } + return `Invalid "${isImport ? `imports` : `exports`}" target ${JSONStringify( + target + )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; + }, + Error +); +const ERR_INVALID_PACKAGE_CONFIG = createErrorType( + `ERR_INVALID_PACKAGE_CONFIG`, + (path, base, message) => { + return `Invalid package config ${path}${base ? ` while importing ${base}` : ``}${message ? `. ${message}` : ``}`; + }, + Error +); + +function filterOwnProperties(source, keys) { + const filtered = /* @__PURE__ */ Object.create(null); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if (ObjectPrototypeHasOwnProperty(source, key)) { + filtered[key] = source[key]; + } + } + return filtered; +} + +const packageJSONCache = new SafeMap(); +function getPackageConfig(path, specifier, base, readFileSyncFn) { + const existing = packageJSONCache.get(path); + if (existing !== void 0) { + return existing; + } + const source = readFileSyncFn(path); + if (source === void 0) { + const packageConfig2 = { + pjsonPath: path, + exists: false, + main: void 0, + name: void 0, + type: "none", + exports: void 0, + imports: void 0 + }; + packageJSONCache.set(path, packageConfig2); + return packageConfig2; + } + let packageJSON; + try { + packageJSON = JSONParse(source); + } catch (error) { + throw new ERR_INVALID_PACKAGE_CONFIG( + path, + (base ? `"${specifier}" from ` : "") + url.fileURLToPath(base || specifier), + error.message + ); + } + let { imports, main, name, type } = filterOwnProperties(packageJSON, [ + "imports", + "main", + "name", + "type" + ]); + const exports = ObjectPrototypeHasOwnProperty(packageJSON, "exports") ? packageJSON.exports : void 0; + if (typeof imports !== "object" || imports === null) { + imports = void 0; + } + if (typeof main !== "string") { + main = void 0; + } + if (typeof name !== "string") { + name = void 0; + } + if (type !== "module" && type !== "commonjs") { + type = "none"; + } + const packageConfig = { + pjsonPath: path, + exists: true, + main, + name, + type, + exports, + imports + }; + packageJSONCache.set(path, packageConfig); + return packageConfig; +} +function getPackageScopeConfig(resolved, readFileSyncFn) { + let packageJSONUrl = new URL("./package.json", resolved); + while (true) { + const packageJSONPath2 = packageJSONUrl.pathname; + if (StringPrototypeEndsWith(packageJSONPath2, "node_modules/package.json")) { + break; + } + const packageConfig2 = getPackageConfig( + url.fileURLToPath(packageJSONUrl), + resolved, + void 0, + readFileSyncFn + ); + if (packageConfig2.exists) { + return packageConfig2; + } + const lastPackageJSONUrl = packageJSONUrl; + packageJSONUrl = new URL("../package.json", packageJSONUrl); + if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { + break; + } + } + const packageJSONPath = url.fileURLToPath(packageJSONUrl); + const packageConfig = { + pjsonPath: packageJSONPath, + exists: false, + main: void 0, + name: void 0, + type: "none", + exports: void 0, + imports: void 0 + }; + packageJSONCache.set(packageJSONPath, packageConfig); + return packageConfig; +} + +/** + @license + Copyright Node.js contributors. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. +*/ +function throwImportNotDefined(specifier, packageJSONUrl, base) { + throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( + specifier, + packageJSONUrl && url.fileURLToPath(new URL(".", packageJSONUrl)), + url.fileURLToPath(base) + ); +} +function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { + const reason = `request is not a valid subpath for the "${internal ? "imports" : "exports"}" resolution of ${url.fileURLToPath(packageJSONUrl)}`; + throw new ERR_INVALID_MODULE_SPECIFIER( + subpath, + reason, + base && url.fileURLToPath(base) + ); +} +function throwInvalidPackageTarget(subpath, target, packageJSONUrl, internal, base) { + if (typeof target === "object" && target !== null) { + target = JSONStringify(target, null, ""); + } else { + target = `${target}`; + } + throw new ERR_INVALID_PACKAGE_TARGET( + url.fileURLToPath(new URL(".", packageJSONUrl)), + subpath, + target, + internal, + base && url.fileURLToPath(base) + ); +} +const invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i; +const patternRegEx = /\*/g; +function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base, pattern, internal, conditions) { + if (subpath !== "" && !pattern && target[target.length - 1] !== "/") + throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); + if (!StringPrototypeStartsWith(target, "./")) { + if (internal && !StringPrototypeStartsWith(target, "../") && !StringPrototypeStartsWith(target, "/")) { + let isURL = false; + try { + new URL(target); + isURL = true; + } catch { + } + if (!isURL) { + const exportTarget = pattern ? RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) : target + subpath; + return exportTarget; + } + } + throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); + } + if (RegExpPrototypeExec( + invalidSegmentRegEx, + StringPrototypeSlice(target, 2) + ) !== null) + throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); + const resolved = new URL(target, packageJSONUrl); + const resolvedPath = resolved.pathname; + const packagePath = new URL(".", packageJSONUrl).pathname; + if (!StringPrototypeStartsWith(resolvedPath, packagePath)) + throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); + if (subpath === "") + return resolved; + if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { + const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; + throwInvalidSubpath(request, packageJSONUrl, internal, base); + } + if (pattern) { + return new URL( + RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath) + ); + } + return new URL(subpath, resolved); +} +function isArrayIndex(key) { + const keyNum = +key; + if (`${keyNum}` !== key) + return false; + return keyNum >= 0 && keyNum < 4294967295; +} +function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { + if (typeof target === "string") { + return resolvePackageTargetString( + target, + subpath, + packageSubpath, + packageJSONUrl, + base, + pattern, + internal); + } else if (ArrayIsArray(target)) { + if (target.length === 0) { + return null; + } + let lastException; + for (let i = 0; i < target.length; i++) { + const targetItem = target[i]; + let resolveResult; + try { + resolveResult = resolvePackageTarget( + packageJSONUrl, + targetItem, + subpath, + packageSubpath, + base, + pattern, + internal, + conditions + ); + } catch (e) { + lastException = e; + if (e.code === "ERR_INVALID_PACKAGE_TARGET") { + continue; + } + throw e; + } + if (resolveResult === void 0) { + continue; + } + if (resolveResult === null) { + lastException = null; + continue; + } + return resolveResult; + } + if (lastException === void 0 || lastException === null) + return lastException; + throw lastException; + } else if (typeof target === "object" && target !== null) { + const keys = ObjectGetOwnPropertyNames(target); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if (isArrayIndex(key)) { + throw new ERR_INVALID_PACKAGE_CONFIG( + url.fileURLToPath(packageJSONUrl), + base, + '"exports" cannot contain numeric property keys.' + ); + } + } + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if (key === "default" || conditions.has(key)) { + const conditionalTarget = target[key]; + const resolveResult = resolvePackageTarget( + packageJSONUrl, + conditionalTarget, + subpath, + packageSubpath, + base, + pattern, + internal, + conditions + ); + if (resolveResult === void 0) + continue; + return resolveResult; + } + } + return void 0; + } else if (target === null) { + return null; + } + throwInvalidPackageTarget( + packageSubpath, + target, + packageJSONUrl, + internal, + base + ); +} +function patternKeyCompare(a, b) { + const aPatternIndex = StringPrototypeIndexOf(a, "*"); + const bPatternIndex = StringPrototypeIndexOf(b, "*"); + const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; + const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; + if (baseLenA > baseLenB) + return -1; + if (baseLenB > baseLenA) + return 1; + if (aPatternIndex === -1) + return 1; + if (bPatternIndex === -1) + return -1; + if (a.length > b.length) + return -1; + if (b.length > a.length) + return 1; + return 0; +} +function packageImportsResolve({ + name, + base, + conditions, + readFileSyncFn +}) { + if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { + const reason = "is not a valid internal imports specifier name"; + throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, url.fileURLToPath(base)); + } + let packageJSONUrl; + const packageConfig = getPackageScopeConfig(base, readFileSyncFn); + if (packageConfig.exists) { + packageJSONUrl = url.pathToFileURL(packageConfig.pjsonPath); + const imports = packageConfig.imports; + if (imports) { + if (ObjectPrototypeHasOwnProperty(imports, name) && !StringPrototypeIncludes(name, "*")) { + const resolveResult = resolvePackageTarget( + packageJSONUrl, + imports[name], + "", + name, + base, + false, + true, + conditions + ); + if (resolveResult != null) { + return resolveResult; + } + } else { + let bestMatch = ""; + let bestMatchSubpath; + const keys = ObjectGetOwnPropertyNames(imports); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const patternIndex = StringPrototypeIndexOf(key, "*"); + if (patternIndex !== -1 && StringPrototypeStartsWith( + name, + StringPrototypeSlice(key, 0, patternIndex) + )) { + const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); + if (name.length >= key.length && StringPrototypeEndsWith(name, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { + bestMatch = key; + bestMatchSubpath = StringPrototypeSlice( + name, + patternIndex, + name.length - patternTrailer.length + ); + } + } + } + if (bestMatch) { + const target = imports[bestMatch]; + const resolveResult = resolvePackageTarget( + packageJSONUrl, + target, + bestMatchSubpath, + bestMatch, + base, + true, + true, + conditions + ); + if (resolveResult != null) { + return resolveResult; + } + } + } + } + } + throwImportNotDefined(name, packageJSONUrl, base); +} + +const flagSymbol = Symbol('arg flag'); + +class ArgError extends Error { + constructor(msg, code) { + super(msg); + this.name = 'ArgError'; + this.code = code; + + Object.setPrototypeOf(this, ArgError.prototype); + } +} + +function arg( + opts, + { + argv = process.argv.slice(2), + permissive = false, + stopAtPositional = false + } = {} +) { + if (!opts) { + throw new ArgError( + 'argument specification object is required', + 'ARG_CONFIG_NO_SPEC' + ); + } + + const result = { _: [] }; + + const aliases = {}; + const handlers = {}; + + for (const key of Object.keys(opts)) { + if (!key) { + throw new ArgError( + 'argument key cannot be an empty string', + 'ARG_CONFIG_EMPTY_KEY' + ); + } + + if (key[0] !== '-') { + throw new ArgError( + `argument key must start with '-' but found: '${key}'`, + 'ARG_CONFIG_NONOPT_KEY' + ); + } + + if (key.length === 1) { + throw new ArgError( + `argument key must have a name; singular '-' keys are not allowed: ${key}`, + 'ARG_CONFIG_NONAME_KEY' + ); + } + + if (typeof opts[key] === 'string') { + aliases[key] = opts[key]; + continue; + } + + let type = opts[key]; + let isFlag = false; + + if ( + Array.isArray(type) && + type.length === 1 && + typeof type[0] === 'function' + ) { + const [fn] = type; + type = (value, name, prev = []) => { + prev.push(fn(value, name, prev[prev.length - 1])); + return prev; + }; + isFlag = fn === Boolean || fn[flagSymbol] === true; + } else if (typeof type === 'function') { + isFlag = type === Boolean || type[flagSymbol] === true; + } else { + throw new ArgError( + `type missing or not a function or valid array type: ${key}`, + 'ARG_CONFIG_VAD_TYPE' + ); + } + + if (key[1] !== '-' && key.length > 2) { + throw new ArgError( + `short argument keys (with a single hyphen) must have only one character: ${key}`, + 'ARG_CONFIG_SHORTOPT_TOOLONG' + ); + } + + handlers[key] = [type, isFlag]; + } + + for (let i = 0, len = argv.length; i < len; i++) { + const wholeArg = argv[i]; + + if (stopAtPositional && result._.length > 0) { + result._ = result._.concat(argv.slice(i)); + break; + } + + if (wholeArg === '--') { + result._ = result._.concat(argv.slice(i + 1)); + break; + } + + if (wholeArg.length > 1 && wholeArg[0] === '-') { + /* eslint-disable operator-linebreak */ + const separatedArguments = + wholeArg[1] === '-' || wholeArg.length === 2 + ? [wholeArg] + : wholeArg + .slice(1) + .split('') + .map((a) => `-${a}`); + /* eslint-enable operator-linebreak */ + + for (let j = 0; j < separatedArguments.length; j++) { + const arg = separatedArguments[j]; + const [originalArgName, argStr] = + arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined]; + + let argName = originalArgName; + while (argName in aliases) { + argName = aliases[argName]; + } + + if (!(argName in handlers)) { + if (permissive) { + result._.push(arg); + continue; + } else { + throw new ArgError( + `unknown or unexpected option: ${originalArgName}`, + 'ARG_UNKNOWN_OPTION' + ); + } + } + + const [type, isFlag] = handlers[argName]; + + if (!isFlag && j + 1 < separatedArguments.length) { + throw new ArgError( + `option requires argument (but was followed by another short argument): ${originalArgName}`, + 'ARG_MISSING_REQUIRED_SHORTARG' + ); + } + + if (isFlag) { + result[argName] = type(true, argName, result[argName]); + } else if (argStr === undefined) { + if ( + argv.length < i + 2 || + (argv[i + 1].length > 1 && + argv[i + 1][0] === '-' && + !( + argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && + (type === Number || + // eslint-disable-next-line no-undef + (typeof BigInt !== 'undefined' && type === BigInt)) + )) + ) { + const extended = + originalArgName === argName ? '' : ` (alias for ${argName})`; + throw new ArgError( + `option requires argument: ${originalArgName}${extended}`, + 'ARG_MISSING_REQUIRED_LONGARG' + ); + } + + result[argName] = type(argv[i + 1], argName, result[argName]); + ++i; + } else { + result[argName] = type(argStr, argName, result[argName]); + } + } + } else { + result._.push(wholeArg); + } + } + + return result; +} + +arg.flag = (fn) => { + fn[flagSymbol] = true; + return fn; +}; + +// Utility types +arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1); + +// Expose error class +arg.ArgError = ArgError; + +var arg_1 = arg; + +/** + @license + The MIT License (MIT) + + Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ +function getOptionValue(opt) { + parseOptions(); + return options[opt]; +} +let options; +function parseOptions() { + if (!options) { + options = { + "--conditions": [], + ...parseArgv(getNodeOptionsEnvArgv()), + ...parseArgv(process.execArgv) + }; + } +} +function parseArgv(argv) { + return arg_1( + { + "--conditions": [String], + "-C": "--conditions" + }, + { + argv, + permissive: true + } + ); +} +function getNodeOptionsEnvArgv() { + const errors = []; + const envArgv = ParseNodeOptionsEnvVar(process.env.NODE_OPTIONS || "", errors); + if (errors.length !== 0) ; + return envArgv; +} +function ParseNodeOptionsEnvVar(node_options, errors) { + const env_argv = []; + let is_in_string = false; + let will_start_new_arg = true; + for (let index = 0; index < node_options.length; ++index) { + let c = node_options[index]; + if (c === "\\" && is_in_string) { + if (index + 1 === node_options.length) { + errors.push("invalid value for NODE_OPTIONS (invalid escape)\n"); + return env_argv; + } else { + c = node_options[++index]; + } + } else if (c === " " && !is_in_string) { + will_start_new_arg = true; + continue; + } else if (c === '"') { + is_in_string = !is_in_string; + continue; + } + if (will_start_new_arg) { + env_argv.push(c); + will_start_new_arg = false; + } else { + env_argv[env_argv.length - 1] += c; + } + } + if (is_in_string) { + errors.push("invalid value for NODE_OPTIONS (unterminated string)\n"); + } + return env_argv; +} + +function makeApi(runtimeState, opts) { + const alwaysWarnOnFallback = Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK) > 0; + const debugLevel = Number(process.env.PNP_DEBUG_LEVEL); + const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/; + const isStrictRegExp = /^(\/|\.{1,2}(\/|$))/; + const isDirRegExp = /\/$/; + const isRelativeRegexp = /^\.{0,2}\//; + const topLevelLocator = { name: null, reference: null }; + const fallbackLocators = []; + const emittedWarnings = /* @__PURE__ */ new Set(); + if (runtimeState.enableTopLevelFallback === true) + fallbackLocators.push(topLevelLocator); + if (opts.compatibilityMode !== false) { + for (const name of [`react-scripts`, `gatsby`]) { + const packageStore = runtimeState.packageRegistry.get(name); + if (packageStore) { + for (const reference of packageStore.keys()) { + if (reference === null) { + throw new Error(`Assertion failed: This reference shouldn't be null`); + } else { + fallbackLocators.push({ name, reference }); + } + } + } + } + } + const { + ignorePattern, + packageRegistry, + packageLocatorsByLocations + } = runtimeState; + function makeLogEntry(name, args) { + return { + fn: name, + args, + error: null, + result: null + }; + } + function trace(entry) { + var _a, _b, _c, _d, _e, _f; + const colors = (_c = (_b = (_a = process.stderr) == null ? void 0 : _a.hasColors) == null ? void 0 : _b.call(_a)) != null ? _c : process.stdout.isTTY; + const c = (n, str) => `\x1B[${n}m${str}\x1B[0m`; + const error = entry.error; + if (error) + console.error(c(`31;1`, `\u2716 ${(_d = entry.error) == null ? void 0 : _d.message.replace(/\n.*/s, ``)}`)); + else + console.error(c(`33;1`, `\u203C Resolution`)); + if (entry.args.length > 0) + console.error(); + for (const arg of entry.args) + console.error(` ${c(`37;1`, `In \u2190`)} ${nodeUtils.inspect(arg, { colors, compact: true })}`); + if (entry.result) { + console.error(); + console.error(` ${c(`37;1`, `Out \u2192`)} ${nodeUtils.inspect(entry.result, { colors, compact: true })}`); + } + const stack = (_f = (_e = new Error().stack.match(/(?<=^ +)at.*/gm)) == null ? void 0 : _e.slice(2)) != null ? _f : []; + if (stack.length > 0) { + console.error(); + for (const line of stack) { + console.error(` ${c(`38;5;244`, line)}`); + } + } + console.error(); + } + function maybeLog(name, fn) { + if (opts.allowDebug === false) + return fn; + if (Number.isFinite(debugLevel)) { + if (debugLevel >= 2) { + return (...args) => { + const logEntry = makeLogEntry(name, args); + try { + return logEntry.result = fn(...args); + } catch (error) { + throw logEntry.error = error; + } finally { + trace(logEntry); + } + }; + } else if (debugLevel >= 1) { + return (...args) => { + try { + return fn(...args); + } catch (error) { + const logEntry = makeLogEntry(name, args); + logEntry.error = error; + trace(logEntry); + throw error; + } + }; + } + } + return fn; + } + function getPackageInformationSafe(packageLocator) { + const packageInformation = getPackageInformation(packageLocator); + if (!packageInformation) { + throw makeError( + ErrorCode.INTERNAL, + `Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)` + ); + } + return packageInformation; + } + function isDependencyTreeRoot(packageLocator) { + if (packageLocator.name === null) + return true; + for (const dependencyTreeRoot of runtimeState.dependencyTreeRoots) + if (dependencyTreeRoot.name === packageLocator.name && dependencyTreeRoot.reference === packageLocator.reference) + return true; + return false; + } + const defaultExportsConditions = /* @__PURE__ */ new Set([ + `default`, + `node`, + `require`, + ...getOptionValue(`--conditions`) + ]); + function applyNodeExportsResolution(unqualifiedPath, conditions = defaultExportsConditions) { + const locator = findPackageLocator(ppath.join(unqualifiedPath, `internal.js`), { + resolveIgnored: true, + includeDiscardFromLookup: true + }); + if (locator === null) { + throw makeError( + ErrorCode.INTERNAL, + `The locator that owns the "${unqualifiedPath}" path can't be found inside the dependency tree (this is probably an internal error)` + ); + } + const { packageLocation } = getPackageInformationSafe(locator); + const manifestPath = ppath.join(packageLocation, Filename.manifest); + if (!opts.fakeFs.existsSync(manifestPath)) + return null; + const pkgJson = JSON.parse(opts.fakeFs.readFileSync(manifestPath, `utf8`)); + let subpath = ppath.contains(packageLocation, unqualifiedPath); + if (subpath === null) { + throw makeError( + ErrorCode.INTERNAL, + `unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)` + ); + } + if (!isRelativeRegexp.test(subpath)) + subpath = `./${subpath}`; + let resolvedExport; + try { + resolvedExport = resolve(pkgJson, ppath.normalize(subpath), { + conditions, + unsafe: true + }); + } catch (error) { + throw makeError( + ErrorCode.EXPORTS_RESOLUTION_FAILED, + error.message, + { unqualifiedPath: getPathForDisplay(unqualifiedPath), locator, pkgJson, subpath: getPathForDisplay(subpath), conditions }, + `ERR_PACKAGE_PATH_NOT_EXPORTED` + ); + } + if (typeof resolvedExport === `string`) + return ppath.join(packageLocation, resolvedExport); + return null; + } + function applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }) { + let stat; + try { + candidates.push(unqualifiedPath); + stat = opts.fakeFs.statSync(unqualifiedPath); + } catch (error) { + } + if (stat && !stat.isDirectory()) + return opts.fakeFs.realpathSync(unqualifiedPath); + if (stat && stat.isDirectory()) { + let pkgJson; + try { + pkgJson = JSON.parse(opts.fakeFs.readFileSync(ppath.join(unqualifiedPath, Filename.manifest), `utf8`)); + } catch (error) { + } + let nextUnqualifiedPath; + if (pkgJson && pkgJson.main) + nextUnqualifiedPath = ppath.resolve(unqualifiedPath, pkgJson.main); + if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) { + const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, { extensions }); + if (resolution !== null) { + return resolution; + } + } + } + for (let i = 0, length = extensions.length; i < length; i++) { + const candidateFile = `${unqualifiedPath}${extensions[i]}`; + candidates.push(candidateFile); + if (opts.fakeFs.existsSync(candidateFile)) { + return candidateFile; + } + } + if (stat && stat.isDirectory()) { + for (let i = 0, length = extensions.length; i < length; i++) { + const candidateFile = ppath.format({ dir: unqualifiedPath, name: `index`, ext: extensions[i] }); + candidates.push(candidateFile); + if (opts.fakeFs.existsSync(candidateFile)) { + return candidateFile; + } + } + } + return null; + } + function makeFakeModule(path) { + const fakeModule = new require$$0.Module(path, null); + fakeModule.filename = path; + fakeModule.paths = require$$0.Module._nodeModulePaths(path); + return fakeModule; + } + function callNativeResolution(request, issuer) { + if (issuer.endsWith(`/`)) + issuer = ppath.join(issuer, `internal.js`); + return require$$0.Module._resolveFilename(npath.fromPortablePath(request), makeFakeModule(npath.fromPortablePath(issuer)), false, { plugnplay: false }); + } + function isPathIgnored(path) { + if (ignorePattern === null) + return false; + const subPath = ppath.contains(runtimeState.basePath, path); + if (subPath === null) + return false; + if (ignorePattern.test(subPath.replace(/\/$/, ``))) { + return true; + } else { + return false; + } + } + const VERSIONS = { std: 3, resolveVirtual: 1, getAllLocators: 1 }; + const topLevel = topLevelLocator; + function getPackageInformation({ name, reference }) { + const packageInformationStore = packageRegistry.get(name); + if (!packageInformationStore) + return null; + const packageInformation = packageInformationStore.get(reference); + if (!packageInformation) + return null; + return packageInformation; + } + function findPackageDependents({ name, reference }) { + const dependents = []; + for (const [dependentName, packageInformationStore] of packageRegistry) { + if (dependentName === null) + continue; + for (const [dependentReference, packageInformation] of packageInformationStore) { + if (dependentReference === null) + continue; + const dependencyReference = packageInformation.packageDependencies.get(name); + if (dependencyReference !== reference) + continue; + if (dependentName === name && dependentReference === reference) + continue; + dependents.push({ + name: dependentName, + reference: dependentReference + }); + } + } + return dependents; + } + function findBrokenPeerDependencies(dependency, initialPackage) { + const brokenPackages = /* @__PURE__ */ new Map(); + const alreadyVisited = /* @__PURE__ */ new Set(); + const traversal = (currentPackage) => { + const identifier = JSON.stringify(currentPackage.name); + if (alreadyVisited.has(identifier)) + return; + alreadyVisited.add(identifier); + const dependents = findPackageDependents(currentPackage); + for (const dependent of dependents) { + const dependentInformation = getPackageInformationSafe(dependent); + if (dependentInformation.packagePeers.has(dependency)) { + traversal(dependent); + } else { + let brokenSet = brokenPackages.get(dependent.name); + if (typeof brokenSet === `undefined`) + brokenPackages.set(dependent.name, brokenSet = /* @__PURE__ */ new Set()); + brokenSet.add(dependent.reference); + } + } + }; + traversal(initialPackage); + const brokenList = []; + for (const name of [...brokenPackages.keys()].sort()) + for (const reference of [...brokenPackages.get(name)].sort()) + brokenList.push({ name, reference }); + return brokenList; + } + function findPackageLocator(location, { resolveIgnored = false, includeDiscardFromLookup = false } = {}) { + if (isPathIgnored(location) && !resolveIgnored) + return null; + let relativeLocation = ppath.relative(runtimeState.basePath, location); + if (!relativeLocation.match(isStrictRegExp)) + relativeLocation = `./${relativeLocation}`; + if (!relativeLocation.endsWith(`/`)) + relativeLocation = `${relativeLocation}/`; + do { + const entry = packageLocatorsByLocations.get(relativeLocation); + if (typeof entry === `undefined` || entry.discardFromLookup && !includeDiscardFromLookup) { + relativeLocation = relativeLocation.substring(0, relativeLocation.lastIndexOf(`/`, relativeLocation.length - 2) + 1); + continue; + } + return entry.locator; + } while (relativeLocation !== ``); + return null; + } + function tryReadFile(filePath) { + try { + return opts.fakeFs.readFileSync(npath.toPortablePath(filePath), `utf8`); + } catch (err) { + if (err.code === `ENOENT`) + return void 0; + throw err; + } + } + function resolveToUnqualified(request, issuer, { considerBuiltins = true } = {}) { + if (request.startsWith(`#`)) + throw new Error(`resolveToUnqualified can not handle private import mappings`); + if (request === `pnpapi`) + return npath.toPortablePath(opts.pnpapiResolution); + if (considerBuiltins && isBuiltinModule(request)) + return null; + const requestForDisplay = getPathForDisplay(request); + const issuerForDisplay = issuer && getPathForDisplay(issuer); + if (issuer && isPathIgnored(issuer)) { + if (!ppath.isAbsolute(request) || findPackageLocator(request) === null) { + const result = callNativeResolution(request, issuer); + if (result === false) { + throw makeError( + ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, + `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) + +Require request: "${requestForDisplay}" +Required by: ${issuerForDisplay} +`, + { request: requestForDisplay, issuer: issuerForDisplay } + ); + } + return npath.toPortablePath(result); + } + } + let unqualifiedPath; + const dependencyNameMatch = request.match(pathRegExp); + if (!dependencyNameMatch) { + if (ppath.isAbsolute(request)) { + unqualifiedPath = ppath.normalize(request); + } else { + if (!issuer) { + throw makeError( + ErrorCode.API_ERROR, + `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, + { request: requestForDisplay, issuer: issuerForDisplay } + ); + } + const absoluteIssuer = ppath.resolve(issuer); + if (issuer.match(isDirRegExp)) { + unqualifiedPath = ppath.normalize(ppath.join(absoluteIssuer, request)); + } else { + unqualifiedPath = ppath.normalize(ppath.join(ppath.dirname(absoluteIssuer), request)); + } + } + } else { + if (!issuer) { + throw makeError( + ErrorCode.API_ERROR, + `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, + { request: requestForDisplay, issuer: issuerForDisplay } + ); + } + const [, dependencyName, subPath] = dependencyNameMatch; + const issuerLocator = findPackageLocator(issuer); + if (!issuerLocator) { + const result = callNativeResolution(request, issuer); + if (result === false) { + throw makeError( + ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, + `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). + +Require path: "${requestForDisplay}" +Required by: ${issuerForDisplay} +`, + { request: requestForDisplay, issuer: issuerForDisplay } + ); + } + return npath.toPortablePath(result); + } + const issuerInformation = getPackageInformationSafe(issuerLocator); + let dependencyReference = issuerInformation.packageDependencies.get(dependencyName); + let fallbackReference = null; + if (dependencyReference == null) { + if (issuerLocator.name !== null) { + const exclusionEntry = runtimeState.fallbackExclusionList.get(issuerLocator.name); + const canUseFallbacks = !exclusionEntry || !exclusionEntry.has(issuerLocator.reference); + if (canUseFallbacks) { + for (let t = 0, T = fallbackLocators.length; t < T; ++t) { + const fallbackInformation = getPackageInformationSafe(fallbackLocators[t]); + const reference = fallbackInformation.packageDependencies.get(dependencyName); + if (reference == null) + continue; + if (alwaysWarnOnFallback) + fallbackReference = reference; + else + dependencyReference = reference; + break; + } + if (runtimeState.enableTopLevelFallback) { + if (dependencyReference == null && fallbackReference === null) { + const reference = runtimeState.fallbackPool.get(dependencyName); + if (reference != null) { + fallbackReference = reference; + } + } + } + } + } + } + let error = null; + if (dependencyReference === null) { + if (isDependencyTreeRoot(issuerLocator)) { + error = makeError( + ErrorCode.MISSING_PEER_DEPENDENCY, + `Your application tried to access ${dependencyName} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed. + +Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} +Required by: ${issuerForDisplay} +`, + { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } + ); + } else { + const brokenAncestors = findBrokenPeerDependencies(dependencyName, issuerLocator); + if (brokenAncestors.every((ancestor) => isDependencyTreeRoot(ancestor))) { + error = makeError( + ErrorCode.MISSING_PEER_DEPENDENCY, + `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. + +Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} +Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) +${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} +`).join(``)} +`, + { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } + ); + } else { + error = makeError( + ErrorCode.MISSING_PEER_DEPENDENCY, + `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. + +Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} +Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) + +${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} +`).join(``)} +`, + { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } + ); + } + } + } else if (dependencyReference === void 0) { + if (!considerBuiltins && isBuiltinModule(request)) { + if (isDependencyTreeRoot(issuerLocator)) { + error = makeError( + ErrorCode.UNDECLARED_DEPENDENCY, + `Your application tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. + +Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} +Required by: ${issuerForDisplay} +`, + { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } + ); + } else { + error = makeError( + ErrorCode.UNDECLARED_DEPENDENCY, + `${issuerLocator.name} tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in ${issuerLocator.name}'s dependencies, this makes the require call ambiguous and unsound. + +Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} +Required by: ${issuerForDisplay} +`, + { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } + ); + } + } else { + if (isDependencyTreeRoot(issuerLocator)) { + error = makeError( + ErrorCode.UNDECLARED_DEPENDENCY, + `Your application tried to access ${dependencyName}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. + +Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} +Required by: ${issuerForDisplay} +`, + { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } + ); + } else { + error = makeError( + ErrorCode.UNDECLARED_DEPENDENCY, + `${issuerLocator.name} tried to access ${dependencyName}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. + +Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} +Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) +`, + { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } + ); + } + } + } + if (dependencyReference == null) { + if (fallbackReference === null || error === null) + throw error || new Error(`Assertion failed: Expected an error to have been set`); + dependencyReference = fallbackReference; + const message = error.message.replace(/\n.*/g, ``); + error.message = message; + if (!emittedWarnings.has(message) && debugLevel !== 0) { + emittedWarnings.add(message); + process.emitWarning(error); + } + } + const dependencyLocator = Array.isArray(dependencyReference) ? { name: dependencyReference[0], reference: dependencyReference[1] } : { name: dependencyName, reference: dependencyReference }; + const dependencyInformation = getPackageInformationSafe(dependencyLocator); + if (!dependencyInformation.packageLocation) { + throw makeError( + ErrorCode.MISSING_DEPENDENCY, + `A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. + +Required package: ${dependencyLocator.name}@${dependencyLocator.reference}${dependencyLocator.name !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} +Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) +`, + { request: requestForDisplay, issuer: issuerForDisplay, dependencyLocator: Object.assign({}, dependencyLocator) } + ); + } + const dependencyLocation = dependencyInformation.packageLocation; + if (subPath) { + unqualifiedPath = ppath.join(dependencyLocation, subPath); + } else { + unqualifiedPath = dependencyLocation; + } + } + return ppath.normalize(unqualifiedPath); + } + function resolveUnqualifiedExport(request, unqualifiedPath, conditions = defaultExportsConditions) { + if (isStrictRegExp.test(request)) + return unqualifiedPath; + const unqualifiedExportPath = applyNodeExportsResolution(unqualifiedPath, conditions); + if (unqualifiedExportPath) { + return ppath.normalize(unqualifiedExportPath); + } else { + return unqualifiedPath; + } + } + function resolveUnqualified(unqualifiedPath, { extensions = Object.keys(require$$0.Module._extensions) } = {}) { + var _a, _b; + const candidates = []; + const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }); + if (qualifiedPath) { + return ppath.normalize(qualifiedPath); + } else { + reportRequiredFilesToWatchMode(candidates.map((candidate) => npath.fromPortablePath(candidate))); + const unqualifiedPathForDisplay = getPathForDisplay(unqualifiedPath); + const containingPackage = findPackageLocator(unqualifiedPath); + if (containingPackage) { + const { packageLocation } = getPackageInformationSafe(containingPackage); + let exists = true; + try { + opts.fakeFs.accessSync(packageLocation); + } catch (err) { + if ((err == null ? void 0 : err.code) === `ENOENT`) { + exists = false; + } else { + const readableError = ((_b = (_a = err == null ? void 0 : err.message) != null ? _a : err) != null ? _b : `empty exception thrown`).replace(/^[A-Z]/, ($0) => $0.toLowerCase()); + throw makeError(ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, `Required package exists but could not be accessed (${readableError}). + +Missing package: ${containingPackage.name}@${containingPackage.reference} +Expected package location: ${getPathForDisplay(packageLocation)} +`, { unqualifiedPath: unqualifiedPathForDisplay, extensions }); + } + } + if (!exists) { + const errorMessage = packageLocation.includes(`/unplugged/`) ? `Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).` : `Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.`; + throw makeError( + ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, + `${errorMessage} + +Missing package: ${containingPackage.name}@${containingPackage.reference} +Expected package location: ${getPathForDisplay(packageLocation)} +`, + { unqualifiedPath: unqualifiedPathForDisplay, extensions } + ); + } + } + throw makeError( + ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, + `Qualified path resolution failed: we looked for the following paths, but none could be accessed. + +Source path: ${unqualifiedPathForDisplay} +${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} +`).join(``)}`, + { unqualifiedPath: unqualifiedPathForDisplay, extensions } + ); + } + } + function resolvePrivateRequest(request, issuer, opts2) { + var _a; + if (!issuer) + throw new Error(`Assertion failed: An issuer is required to resolve private import mappings`); + const resolved = packageImportsResolve({ + name: request, + base: url.pathToFileURL(npath.fromPortablePath(issuer)), + conditions: (_a = opts2.conditions) != null ? _a : defaultExportsConditions, + readFileSyncFn: tryReadFile + }); + if (resolved instanceof URL) { + return resolveUnqualified(npath.toPortablePath(url.fileURLToPath(resolved)), { extensions: opts2.extensions }); + } else { + if (resolved.startsWith(`#`)) + throw new Error(`Mapping from one private import to another isn't allowed`); + return resolveRequest(resolved, issuer, opts2); + } + } + function resolveRequest(request, issuer, opts2 = {}) { + try { + if (request.startsWith(`#`)) + return resolvePrivateRequest(request, issuer, opts2); + const { considerBuiltins, extensions, conditions } = opts2; + const unqualifiedPath = resolveToUnqualified(request, issuer, { considerBuiltins }); + if (request === `pnpapi`) + return unqualifiedPath; + if (unqualifiedPath === null) + return null; + const isIssuerIgnored = () => issuer !== null ? isPathIgnored(issuer) : false; + const remappedPath = (!considerBuiltins || !isBuiltinModule(request)) && !isIssuerIgnored() ? resolveUnqualifiedExport(request, unqualifiedPath, conditions) : unqualifiedPath; + return resolveUnqualified(remappedPath, { extensions }); + } catch (error) { + if (Object.prototype.hasOwnProperty.call(error, `pnpCode`)) + Object.assign(error.data, { request: getPathForDisplay(request), issuer: issuer && getPathForDisplay(issuer) }); + throw error; + } + } + function resolveVirtual(request) { + const normalized = ppath.normalize(request); + const resolved = VirtualFS.resolveVirtual(normalized); + return resolved !== normalized ? resolved : null; + } + return { + VERSIONS, + topLevel, + getLocator: (name, referencish) => { + if (Array.isArray(referencish)) { + return { name: referencish[0], reference: referencish[1] }; + } else { + return { name, reference: referencish }; + } + }, + getDependencyTreeRoots: () => { + return [...runtimeState.dependencyTreeRoots]; + }, + getAllLocators() { + const locators = []; + for (const [name, entry] of packageRegistry) + for (const reference of entry.keys()) + if (name !== null && reference !== null) + locators.push({ name, reference }); + return locators; + }, + getPackageInformation: (locator) => { + const info = getPackageInformation(locator); + if (info === null) + return null; + const packageLocation = npath.fromPortablePath(info.packageLocation); + const nativeInfo = { ...info, packageLocation }; + return nativeInfo; + }, + findPackageLocator: (path) => { + return findPackageLocator(npath.toPortablePath(path)); + }, + resolveToUnqualified: maybeLog(`resolveToUnqualified`, (request, issuer, opts2) => { + const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; + const resolution = resolveToUnqualified(npath.toPortablePath(request), portableIssuer, opts2); + if (resolution === null) + return null; + return npath.fromPortablePath(resolution); + }), + resolveUnqualified: maybeLog(`resolveUnqualified`, (unqualifiedPath, opts2) => { + return npath.fromPortablePath(resolveUnqualified(npath.toPortablePath(unqualifiedPath), opts2)); + }), + resolveRequest: maybeLog(`resolveRequest`, (request, issuer, opts2) => { + const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; + const resolution = resolveRequest(npath.toPortablePath(request), portableIssuer, opts2); + if (resolution === null) + return null; + return npath.fromPortablePath(resolution); + }), + resolveVirtual: maybeLog(`resolveVirtual`, (path) => { + const result = resolveVirtual(npath.toPortablePath(path)); + if (result !== null) { + return npath.fromPortablePath(result); + } else { + return null; + } + }) + }; +} + +function makeManager(pnpapi, opts) { + const initialApiPath = npath.toPortablePath(pnpapi.resolveToUnqualified(`pnpapi`, null)); + const initialApiStats = opts.fakeFs.statSync(npath.toPortablePath(initialApiPath)); + const apiMetadata = /* @__PURE__ */ new Map([ + [initialApiPath, { + cache: require$$0.Module._cache, + instance: pnpapi, + stats: initialApiStats, + lastRefreshCheck: Date.now() + }] + ]); + function loadApiInstance(pnpApiPath) { + const nativePath = npath.fromPortablePath(pnpApiPath); + const module = new require$$0.Module(nativePath, null); + module.load(nativePath); + return module.exports; + } + function refreshApiEntry(pnpApiPath, apiEntry) { + const timeNow = Date.now(); + if (timeNow - apiEntry.lastRefreshCheck < 500) + return; + apiEntry.lastRefreshCheck = timeNow; + const stats = opts.fakeFs.statSync(pnpApiPath); + if (stats.mtime > apiEntry.stats.mtime) { + process.emitWarning(`[Warning] The runtime detected new informations in a PnP file; reloading the API instance (${npath.fromPortablePath(pnpApiPath)})`); + apiEntry.stats = stats; + apiEntry.instance = loadApiInstance(pnpApiPath); + } + } + function getApiEntry(pnpApiPath, refresh = false) { + let apiEntry = apiMetadata.get(pnpApiPath); + if (typeof apiEntry !== `undefined`) { + if (refresh) { + refreshApiEntry(pnpApiPath, apiEntry); + } + } else { + apiMetadata.set(pnpApiPath, apiEntry = { + cache: {}, + instance: loadApiInstance(pnpApiPath), + stats: opts.fakeFs.statSync(pnpApiPath), + lastRefreshCheck: Date.now() + }); + } + return apiEntry; + } + const findApiPathCache = /* @__PURE__ */ new Map(); + function addToCacheAndReturn(start, end, target) { + if (target !== null) + target = VirtualFS.resolveVirtual(target); + let curr; + let next = start; + do { + curr = next; + findApiPathCache.set(curr, target); + next = ppath.dirname(curr); + } while (curr !== end); + return target; + } + function findApiPathFor(modulePath) { + let bestCandidate = null; + for (const [apiPath, apiEntry] of apiMetadata) { + const locator = apiEntry.instance.findPackageLocator(modulePath); + if (!locator) + continue; + if (apiMetadata.size === 1) + return apiPath; + const packageInformation = apiEntry.instance.getPackageInformation(locator); + if (!packageInformation) + throw new Error(`Assertion failed: Couldn't get package information for '${modulePath}'`); + if (!bestCandidate) + bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [] }; + if (packageInformation.packageLocation === bestCandidate.packageLocation) { + bestCandidate.apiPaths.push(apiPath); + } else if (packageInformation.packageLocation.length > bestCandidate.packageLocation.length) { + bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [apiPath] }; + } + } + if (bestCandidate) { + if (bestCandidate.apiPaths.length === 1) + return bestCandidate.apiPaths[0]; + const controlSegment = bestCandidate.apiPaths.map((apiPath) => ` ${npath.fromPortablePath(apiPath)}`).join(` +`); + throw new Error(`Unable to locate pnpapi, the module '${modulePath}' is controlled by multiple pnpapi instances. +This is usually caused by using the global cache (enableGlobalCache: true) + +Controlled by: +${controlSegment} +`); + } + const start = ppath.resolve(npath.toPortablePath(modulePath)); + let curr; + let next = start; + do { + curr = next; + const cached = findApiPathCache.get(curr); + if (cached !== void 0) + return addToCacheAndReturn(start, curr, cached); + const cjsCandidate = ppath.join(curr, Filename.pnpCjs); + if (opts.fakeFs.existsSync(cjsCandidate) && opts.fakeFs.statSync(cjsCandidate).isFile()) + return addToCacheAndReturn(start, curr, cjsCandidate); + const legacyCjsCandidate = ppath.join(curr, Filename.pnpJs); + if (opts.fakeFs.existsSync(legacyCjsCandidate) && opts.fakeFs.statSync(legacyCjsCandidate).isFile()) + return addToCacheAndReturn(start, curr, legacyCjsCandidate); + next = ppath.dirname(curr); + } while (curr !== PortablePath.root); + return addToCacheAndReturn(start, curr, null); + } + function getApiPathFromParent(parent) { + if (parent == null) + return initialApiPath; + if (typeof parent.pnpApiPath === `undefined`) { + if (parent.filename !== null) { + return parent.pnpApiPath = findApiPathFor(parent.filename); + } else { + return initialApiPath; + } + } + if (parent.pnpApiPath !== null) + return parent.pnpApiPath; + return null; + } + return { + getApiPathFromParent, + findApiPathFor, + getApiEntry + }; +} + +const localFs = { ...fs__default.default }; +const nodeFs = new NodeFS(localFs); +const defaultRuntimeState = $$SETUP_STATE(hydrateRuntimeState); +const defaultPnpapiResolution = __filename; +const defaultFsLayer = new VirtualFS({ + baseFs: new ZipOpenFS({ + baseFs: nodeFs, + libzip: () => getLibzipSync(), + maxOpenFiles: 80, + readOnlyArchives: true + }) +}); +class DynamicFS extends ProxiedFS { + constructor() { + super(ppath); + this.baseFs = defaultFsLayer; + } + mapToBase(p) { + return p; + } + mapFromBase(p) { + return p; + } +} +const dynamicFsLayer = new DynamicFS(); +let manager; +const defaultApi = Object.assign(makeApi(defaultRuntimeState, { + fakeFs: dynamicFsLayer, + pnpapiResolution: defaultPnpapiResolution +}), { + makeApi: ({ + basePath = void 0, + fakeFs = dynamicFsLayer, + pnpapiResolution = defaultPnpapiResolution, + ...rest + }) => { + const apiRuntimeState = typeof basePath !== `undefined` ? $$SETUP_STATE(hydrateRuntimeState, basePath) : defaultRuntimeState; + return makeApi(apiRuntimeState, { + fakeFs, + pnpapiResolution, + ...rest + }); + }, + setup: (api) => { + applyPatch(api || defaultApi, { + fakeFs: defaultFsLayer, + manager + }); + dynamicFsLayer.baseFs = new NodeFS(fs__default.default); + } +}); +manager = makeManager(defaultApi, { + fakeFs: dynamicFsLayer +}); +if (module.parent && module.parent.id === `internal/preload`) { + defaultApi.setup(); + if (module.filename) { + delete require$$0__default.default._cache[module.filename]; + } +} +if (process.mainModule === module) { + const reportError = (code, message, data) => { + process.stdout.write(`${JSON.stringify([{ code, message, data }, null])} +`); + }; + const reportSuccess = (resolution) => { + process.stdout.write(`${JSON.stringify([null, resolution])} +`); + }; + const processResolution = (request, issuer) => { + try { + reportSuccess(defaultApi.resolveRequest(request, issuer)); + } catch (error) { + reportError(error.code, error.message, error.data); + } + }; + const processRequest = (data) => { + try { + const [request, issuer] = JSON.parse(data); + processResolution(request, issuer); + } catch (error) { + reportError(`INVALID_JSON`, error.message, error.data); + } + }; + if (process.argv.length > 2) { + if (process.argv.length !== 4) { + process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} +`); + process.exitCode = 64; + } else { + processResolution(process.argv[2], process.argv[3]); + } + } else { + let buffer = ``; + const decoder = new StringDecoder__default.default.StringDecoder(); + process.stdin.on(`data`, (chunk) => { + buffer += decoder.write(chunk); + do { + const index = buffer.indexOf(` +`); + if (index === -1) + break; + const line = buffer.slice(0, index); + buffer = buffer.slice(index + 1); + processRequest(line); + } while (true); + }); + } +} + +module.exports = defaultApi; diff --git a/internal/module/pnp/testdata/pnp-yarn-v4.cjs b/internal/module/pnp/testdata/pnp-yarn-v4.cjs new file mode 100644 index 0000000000..53539201e4 --- /dev/null +++ b/internal/module/pnp/testdata/pnp-yarn-v4.cjs @@ -0,0 +1,7429 @@ +#!/usr/bin/env node +/* eslint-disable */ +"use strict"; + +const RAW_RUNTIME_STATE = +'{\ + "__info": [\ + "This file is automatically generated. Do not touch it, or risk",\ + "your modifications being lost."\ + ],\ + "dependencyTreeRoots": [\ + {\ + "name": "tmp.trDEa5gPrG",\ + "reference": "workspace:."\ + }\ + ],\ + "enableTopLevelFallback": true,\ + "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ + "fallbackExclusionList": [\ + ["tmp.trDEa5gPrG", ["workspace:."]]\ + ],\ + "fallbackPool": [\ + ],\ + "packageRegistryData": [\ + [null, [\ + [null, {\ + "packageLocation": "./",\ + "packageDependencies": [\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ + ["tmp.trDEa5gPrG", [\ + ["workspace:.", {\ + "packageLocation": "./",\ + "packageDependencies": [\ + ["tmp.trDEa5gPrG", "workspace:."]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]]\ + ]\ +}'; + +function $$SETUP_STATE(hydrateRuntimeState, basePath) { + return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname}); +} + +const fs = require('fs'); +const path = require('path'); +const crypto = require('crypto'); +const os = require('os'); +const events = require('events'); +const nodeUtils = require('util'); +const stream = require('stream'); +const zlib = require('zlib'); +const require$$0 = require('module'); +const StringDecoder = require('string_decoder'); +const url = require('url'); +const readline = require('readline'); +const assert = require('assert'); + +const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e }; + +function _interopNamespace(e) { + if (e && e.__esModule) return e; + const n = Object.create(null); + if (e) { + for (const k in e) { + if (k !== 'default') { + const d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: () => e[k] + }); + } + } + } + n.default = e; + return Object.freeze(n); +} + +const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); +const path__default = /*#__PURE__*/_interopDefaultLegacy(path); +const nodeUtils__namespace = /*#__PURE__*/_interopNamespace(nodeUtils); +const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); +const require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); +const StringDecoder__default = /*#__PURE__*/_interopDefaultLegacy(StringDecoder); +const assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); + +const S_IFMT = 61440; +const S_IFDIR = 16384; +const S_IFREG = 32768; +const S_IFLNK = 40960; +const SAFE_TIME = 456789e3; + +function makeError$1(code, message) { + return Object.assign(new Error(`${code}: ${message}`), { code }); +} +function EBUSY(message) { + return makeError$1(`EBUSY`, message); +} +function ENOSYS(message, reason) { + return makeError$1(`ENOSYS`, `${message}, ${reason}`); +} +function EINVAL(reason) { + return makeError$1(`EINVAL`, `invalid argument, ${reason}`); +} +function EBADF(reason) { + return makeError$1(`EBADF`, `bad file descriptor, ${reason}`); +} +function ENOENT(reason) { + return makeError$1(`ENOENT`, `no such file or directory, ${reason}`); +} +function ENOTDIR(reason) { + return makeError$1(`ENOTDIR`, `not a directory, ${reason}`); +} +function EISDIR(reason) { + return makeError$1(`EISDIR`, `illegal operation on a directory, ${reason}`); +} +function EEXIST(reason) { + return makeError$1(`EEXIST`, `file already exists, ${reason}`); +} +function EROFS(reason) { + return makeError$1(`EROFS`, `read-only filesystem, ${reason}`); +} +function ENOTEMPTY(reason) { + return makeError$1(`ENOTEMPTY`, `directory not empty, ${reason}`); +} +function EOPNOTSUPP(reason) { + return makeError$1(`EOPNOTSUPP`, `operation not supported, ${reason}`); +} +function ERR_DIR_CLOSED() { + return makeError$1(`ERR_DIR_CLOSED`, `Directory handle was closed`); +} + +const DEFAULT_MODE = S_IFREG | 420; +class StatEntry { + constructor() { + this.uid = 0; + this.gid = 0; + this.size = 0; + this.blksize = 0; + this.atimeMs = 0; + this.mtimeMs = 0; + this.ctimeMs = 0; + this.birthtimeMs = 0; + this.atime = new Date(0); + this.mtime = new Date(0); + this.ctime = new Date(0); + this.birthtime = new Date(0); + this.dev = 0; + this.ino = 0; + this.mode = DEFAULT_MODE; + this.nlink = 1; + this.rdev = 0; + this.blocks = 1; + } + isBlockDevice() { + return false; + } + isCharacterDevice() { + return false; + } + isDirectory() { + return (this.mode & S_IFMT) === S_IFDIR; + } + isFIFO() { + return false; + } + isFile() { + return (this.mode & S_IFMT) === S_IFREG; + } + isSocket() { + return false; + } + isSymbolicLink() { + return (this.mode & S_IFMT) === S_IFLNK; + } +} +class BigIntStatsEntry { + constructor() { + this.uid = BigInt(0); + this.gid = BigInt(0); + this.size = BigInt(0); + this.blksize = BigInt(0); + this.atimeMs = BigInt(0); + this.mtimeMs = BigInt(0); + this.ctimeMs = BigInt(0); + this.birthtimeMs = BigInt(0); + this.atimeNs = BigInt(0); + this.mtimeNs = BigInt(0); + this.ctimeNs = BigInt(0); + this.birthtimeNs = BigInt(0); + this.atime = new Date(0); + this.mtime = new Date(0); + this.ctime = new Date(0); + this.birthtime = new Date(0); + this.dev = BigInt(0); + this.ino = BigInt(0); + this.mode = BigInt(DEFAULT_MODE); + this.nlink = BigInt(1); + this.rdev = BigInt(0); + this.blocks = BigInt(1); + } + isBlockDevice() { + return false; + } + isCharacterDevice() { + return false; + } + isDirectory() { + return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFDIR); + } + isFIFO() { + return false; + } + isFile() { + return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFREG); + } + isSocket() { + return false; + } + isSymbolicLink() { + return (this.mode & BigInt(S_IFMT)) === BigInt(S_IFLNK); + } +} +function makeDefaultStats() { + return new StatEntry(); +} +function clearStats(stats) { + for (const key in stats) { + if (Object.prototype.hasOwnProperty.call(stats, key)) { + const element = stats[key]; + if (typeof element === `number`) { + stats[key] = 0; + } else if (typeof element === `bigint`) { + stats[key] = BigInt(0); + } else if (nodeUtils__namespace.types.isDate(element)) { + stats[key] = new Date(0); + } + } + } + return stats; +} +function convertToBigIntStats(stats) { + const bigintStats = new BigIntStatsEntry(); + for (const key in stats) { + if (Object.prototype.hasOwnProperty.call(stats, key)) { + const element = stats[key]; + if (typeof element === `number`) { + bigintStats[key] = BigInt(element); + } else if (nodeUtils__namespace.types.isDate(element)) { + bigintStats[key] = new Date(element); + } + } + } + bigintStats.atimeNs = bigintStats.atimeMs * BigInt(1e6); + bigintStats.mtimeNs = bigintStats.mtimeMs * BigInt(1e6); + bigintStats.ctimeNs = bigintStats.ctimeMs * BigInt(1e6); + bigintStats.birthtimeNs = bigintStats.birthtimeMs * BigInt(1e6); + return bigintStats; +} +function areStatsEqual(a, b) { + if (a.atimeMs !== b.atimeMs) + return false; + if (a.birthtimeMs !== b.birthtimeMs) + return false; + if (a.blksize !== b.blksize) + return false; + if (a.blocks !== b.blocks) + return false; + if (a.ctimeMs !== b.ctimeMs) + return false; + if (a.dev !== b.dev) + return false; + if (a.gid !== b.gid) + return false; + if (a.ino !== b.ino) + return false; + if (a.isBlockDevice() !== b.isBlockDevice()) + return false; + if (a.isCharacterDevice() !== b.isCharacterDevice()) + return false; + if (a.isDirectory() !== b.isDirectory()) + return false; + if (a.isFIFO() !== b.isFIFO()) + return false; + if (a.isFile() !== b.isFile()) + return false; + if (a.isSocket() !== b.isSocket()) + return false; + if (a.isSymbolicLink() !== b.isSymbolicLink()) + return false; + if (a.mode !== b.mode) + return false; + if (a.mtimeMs !== b.mtimeMs) + return false; + if (a.nlink !== b.nlink) + return false; + if (a.rdev !== b.rdev) + return false; + if (a.size !== b.size) + return false; + if (a.uid !== b.uid) + return false; + const aN = a; + const bN = b; + if (aN.atimeNs !== bN.atimeNs) + return false; + if (aN.mtimeNs !== bN.mtimeNs) + return false; + if (aN.ctimeNs !== bN.ctimeNs) + return false; + if (aN.birthtimeNs !== bN.birthtimeNs) + return false; + return true; +} + +const PortablePath = { + root: `/`, + dot: `.`, + parent: `..` +}; +const Filename = { + home: `~`, + nodeModules: `node_modules`, + manifest: `package.json`, + lockfile: `yarn.lock`, + virtual: `__virtual__`, + pnpJs: `.pnp.js`, + pnpCjs: `.pnp.cjs`, + pnpData: `.pnp.data.json`, + pnpEsmLoader: `.pnp.loader.mjs`, + rc: `.yarnrc.yml` +}; +const npath = Object.create(path__default.default); +const ppath = Object.create(path__default.default.posix); +npath.cwd = () => process.cwd(); +ppath.cwd = () => toPortablePath(process.cwd()); +ppath.resolve = (...segments) => { + if (segments.length > 0 && ppath.isAbsolute(segments[0])) { + return path__default.default.posix.resolve(...segments); + } else { + return path__default.default.posix.resolve(ppath.cwd(), ...segments); + } +}; +const contains = function(pathUtils, from, to) { + from = pathUtils.normalize(from); + to = pathUtils.normalize(to); + if (from === to) + return `.`; + if (!from.endsWith(pathUtils.sep)) + from = from + pathUtils.sep; + if (to.startsWith(from)) { + return to.slice(from.length); + } else { + return null; + } +}; +npath.fromPortablePath = fromPortablePath; +npath.toPortablePath = toPortablePath; +npath.contains = (from, to) => contains(npath, from, to); +ppath.contains = (from, to) => contains(ppath, from, to); +const WINDOWS_PATH_REGEXP = /^([a-zA-Z]:.*)$/; +const UNC_WINDOWS_PATH_REGEXP = /^\/\/(\.\/)?(.*)$/; +const PORTABLE_PATH_REGEXP = /^\/([a-zA-Z]:.*)$/; +const UNC_PORTABLE_PATH_REGEXP = /^\/unc\/(\.dot\/)?(.*)$/; +function fromPortablePath(p) { + if (process.platform !== `win32`) + return p; + let portablePathMatch, uncPortablePathMatch; + if (portablePathMatch = p.match(PORTABLE_PATH_REGEXP)) + p = portablePathMatch[1]; + else if (uncPortablePathMatch = p.match(UNC_PORTABLE_PATH_REGEXP)) + p = `\\\\${uncPortablePathMatch[1] ? `.\\` : ``}${uncPortablePathMatch[2]}`; + else + return p; + return p.replace(/\//g, `\\`); +} +function toPortablePath(p) { + if (process.platform !== `win32`) + return p; + p = p.replace(/\\/g, `/`); + let windowsPathMatch, uncWindowsPathMatch; + if (windowsPathMatch = p.match(WINDOWS_PATH_REGEXP)) + p = `/${windowsPathMatch[1]}`; + else if (uncWindowsPathMatch = p.match(UNC_WINDOWS_PATH_REGEXP)) + p = `/unc/${uncWindowsPathMatch[1] ? `.dot/` : ``}${uncWindowsPathMatch[2]}`; + return p; +} +function convertPath(targetPathUtils, sourcePath) { + return targetPathUtils === npath ? fromPortablePath(sourcePath) : toPortablePath(sourcePath); +} + +const defaultTime = new Date(SAFE_TIME * 1e3); +const defaultTimeMs = defaultTime.getTime(); +async function copyPromise(destinationFs, destination, sourceFs, source, opts) { + const normalizedDestination = destinationFs.pathUtils.normalize(destination); + const normalizedSource = sourceFs.pathUtils.normalize(source); + const prelayout = []; + const postlayout = []; + const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : await sourceFs.lstatPromise(normalizedSource); + await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination), { utimes: [atime, mtime] }); + await copyImpl(prelayout, postlayout, destinationFs, normalizedDestination, sourceFs, normalizedSource, { ...opts, didParentExist: true }); + for (const operation of prelayout) + await operation(); + await Promise.all(postlayout.map((operation) => { + return operation(); + })); +} +async function copyImpl(prelayout, postlayout, destinationFs, destination, sourceFs, source, opts) { + var _a, _b, _c; + const destinationStat = opts.didParentExist ? await maybeLStat(destinationFs, destination) : null; + const sourceStat = await sourceFs.lstatPromise(source); + const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : sourceStat; + let updated; + switch (true) { + case sourceStat.isDirectory(): + { + updated = await copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); + } + break; + case sourceStat.isFile(): + { + updated = await copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); + } + break; + case sourceStat.isSymbolicLink(): + { + updated = await copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); + } + break; + default: + { + throw new Error(`Unsupported file type (${sourceStat.mode})`); + } + } + if (((_a = opts.linkStrategy) == null ? void 0 : _a.type) !== `HardlinkFromIndex` || !sourceStat.isFile()) { + if (updated || ((_b = destinationStat == null ? void 0 : destinationStat.mtime) == null ? void 0 : _b.getTime()) !== mtime.getTime() || ((_c = destinationStat == null ? void 0 : destinationStat.atime) == null ? void 0 : _c.getTime()) !== atime.getTime()) { + postlayout.push(() => destinationFs.lutimesPromise(destination, atime, mtime)); + updated = true; + } + if (destinationStat === null || (destinationStat.mode & 511) !== (sourceStat.mode & 511)) { + postlayout.push(() => destinationFs.chmodPromise(destination, sourceStat.mode & 511)); + updated = true; + } + } + return updated; +} +async function maybeLStat(baseFs, p) { + try { + return await baseFs.lstatPromise(p); + } catch (e) { + return null; + } +} +async function copyFolder(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { + if (destinationStat !== null && !destinationStat.isDirectory()) { + if (opts.overwrite) { + prelayout.push(async () => destinationFs.removePromise(destination)); + destinationStat = null; + } else { + return false; + } + } + let updated = false; + if (destinationStat === null) { + prelayout.push(async () => { + try { + await destinationFs.mkdirPromise(destination, { mode: sourceStat.mode }); + } catch (err) { + if (err.code !== `EEXIST`) { + throw err; + } + } + }); + updated = true; + } + const entries = await sourceFs.readdirPromise(source); + const nextOpts = opts.didParentExist && !destinationStat ? { ...opts, didParentExist: false } : opts; + if (opts.stableSort) { + for (const entry of entries.sort()) { + if (await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts)) { + updated = true; + } + } + } else { + const entriesUpdateStatus = await Promise.all(entries.map(async (entry) => { + await copyImpl(prelayout, postlayout, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts); + })); + if (entriesUpdateStatus.some((status) => status)) { + updated = true; + } + } + return updated; +} +async function copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, linkStrategy) { + const sourceHash = await sourceFs.checksumFilePromise(source, { algorithm: `sha1` }); + const indexPath = destinationFs.pathUtils.join(linkStrategy.indexPath, sourceHash.slice(0, 2), `${sourceHash}.dat`); + let AtomicBehavior; + ((AtomicBehavior2) => { + AtomicBehavior2[AtomicBehavior2["Lock"] = 0] = "Lock"; + AtomicBehavior2[AtomicBehavior2["Rename"] = 1] = "Rename"; + })(AtomicBehavior || (AtomicBehavior = {})); + let atomicBehavior = 1 /* Rename */; + let indexStat = await maybeLStat(destinationFs, indexPath); + if (destinationStat) { + const isDestinationHardlinkedFromIndex = indexStat && destinationStat.dev === indexStat.dev && destinationStat.ino === indexStat.ino; + const isIndexModified = (indexStat == null ? void 0 : indexStat.mtimeMs) !== defaultTimeMs; + if (isDestinationHardlinkedFromIndex) { + if (isIndexModified && linkStrategy.autoRepair) { + atomicBehavior = 0 /* Lock */; + indexStat = null; + } + } + if (!isDestinationHardlinkedFromIndex) { + if (opts.overwrite) { + prelayout.push(async () => destinationFs.removePromise(destination)); + destinationStat = null; + } else { + return false; + } + } + } + const tempPath = !indexStat && atomicBehavior === 1 /* Rename */ ? `${indexPath}.${Math.floor(Math.random() * 4294967296).toString(16).padStart(8, `0`)}` : null; + let tempPathCleaned = false; + prelayout.push(async () => { + if (!indexStat) { + if (atomicBehavior === 0 /* Lock */) { + await destinationFs.lockPromise(indexPath, async () => { + const content = await sourceFs.readFilePromise(source); + await destinationFs.writeFilePromise(indexPath, content); + }); + } + if (atomicBehavior === 1 /* Rename */ && tempPath) { + const content = await sourceFs.readFilePromise(source); + await destinationFs.writeFilePromise(tempPath, content); + try { + await destinationFs.linkPromise(tempPath, indexPath); + } catch (err) { + if (err.code === `EEXIST`) { + tempPathCleaned = true; + await destinationFs.unlinkPromise(tempPath); + } else { + throw err; + } + } + } + } + if (!destinationStat) { + await destinationFs.linkPromise(indexPath, destination); + } + }); + postlayout.push(async () => { + if (!indexStat) + await destinationFs.lutimesPromise(indexPath, defaultTime, defaultTime); + if (tempPath && !tempPathCleaned) { + await destinationFs.unlinkPromise(tempPath); + } + }); + return false; +} +async function copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { + if (destinationStat !== null) { + if (opts.overwrite) { + prelayout.push(async () => destinationFs.removePromise(destination)); + destinationStat = null; + } else { + return false; + } + } + prelayout.push(async () => { + const content = await sourceFs.readFilePromise(source); + await destinationFs.writeFilePromise(destination, content); + }); + return true; +} +async function copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { + var _a; + if (((_a = opts.linkStrategy) == null ? void 0 : _a.type) === `HardlinkFromIndex`) { + return copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, opts.linkStrategy); + } else { + return copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); + } +} +async function copySymlink(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { + if (destinationStat !== null) { + if (opts.overwrite) { + prelayout.push(async () => destinationFs.removePromise(destination)); + destinationStat = null; + } else { + return false; + } + } + prelayout.push(async () => { + await destinationFs.symlinkPromise(convertPath(destinationFs.pathUtils, await sourceFs.readlinkPromise(source)), destination); + }); + return true; +} + +class CustomDir { + constructor(path, nextDirent, opts = {}) { + this.path = path; + this.nextDirent = nextDirent; + this.opts = opts; + this.closed = false; + } + throwIfClosed() { + if (this.closed) { + throw ERR_DIR_CLOSED(); + } + } + async *[Symbol.asyncIterator]() { + try { + let dirent; + while ((dirent = await this.read()) !== null) { + yield dirent; + } + } finally { + await this.close(); + } + } + read(cb) { + const dirent = this.readSync(); + if (typeof cb !== `undefined`) + return cb(null, dirent); + return Promise.resolve(dirent); + } + readSync() { + this.throwIfClosed(); + return this.nextDirent(); + } + close(cb) { + this.closeSync(); + if (typeof cb !== `undefined`) + return cb(null); + return Promise.resolve(); + } + closeSync() { + var _a, _b; + this.throwIfClosed(); + (_b = (_a = this.opts).onClose) == null ? void 0 : _b.call(_a); + this.closed = true; + } +} +function opendir(fakeFs, path, entries, opts) { + const nextDirent = () => { + const filename = entries.shift(); + if (typeof filename === `undefined`) + return null; + return Object.assign(fakeFs.statSync(fakeFs.pathUtils.join(path, filename)), { + name: filename + }); + }; + return new CustomDir(path, nextDirent, opts); +} + +function assertStatus(current, expected) { + if (current !== expected) { + throw new Error(`Invalid StatWatcher status: expected '${expected}', got '${current}'`); + } +} +class CustomStatWatcher extends events.EventEmitter { + constructor(fakeFs, path, { bigint = false } = {}) { + super(); + this.status = "ready" /* Ready */; + this.changeListeners = /* @__PURE__ */ new Map(); + this.startTimeout = null; + this.fakeFs = fakeFs; + this.path = path; + this.bigint = bigint; + this.lastStats = this.stat(); + } + static create(fakeFs, path, opts) { + const statWatcher = new CustomStatWatcher(fakeFs, path, opts); + statWatcher.start(); + return statWatcher; + } + start() { + assertStatus(this.status, "ready" /* Ready */); + this.status = "running" /* Running */; + this.startTimeout = setTimeout(() => { + this.startTimeout = null; + if (!this.fakeFs.existsSync(this.path)) { + this.emit("change" /* Change */, this.lastStats, this.lastStats); + } + }, 3); + } + stop() { + assertStatus(this.status, "running" /* Running */); + this.status = "stopped" /* Stopped */; + if (this.startTimeout !== null) { + clearTimeout(this.startTimeout); + this.startTimeout = null; + } + this.emit("stop" /* Stop */); + } + stat() { + try { + return this.fakeFs.statSync(this.path, { bigint: this.bigint }); + } catch (error) { + const statInstance = this.bigint ? new BigIntStatsEntry() : new StatEntry(); + return clearStats(statInstance); + } + } + makeInterval(opts) { + const interval = setInterval(() => { + const currentStats = this.stat(); + const previousStats = this.lastStats; + if (areStatsEqual(currentStats, previousStats)) + return; + this.lastStats = currentStats; + this.emit("change" /* Change */, currentStats, previousStats); + }, opts.interval); + return opts.persistent ? interval : interval.unref(); + } + registerChangeListener(listener, opts) { + this.addListener("change" /* Change */, listener); + this.changeListeners.set(listener, this.makeInterval(opts)); + } + unregisterChangeListener(listener) { + this.removeListener("change" /* Change */, listener); + const interval = this.changeListeners.get(listener); + if (typeof interval !== `undefined`) + clearInterval(interval); + this.changeListeners.delete(listener); + } + unregisterAllChangeListeners() { + for (const listener of this.changeListeners.keys()) { + this.unregisterChangeListener(listener); + } + } + hasChangeListeners() { + return this.changeListeners.size > 0; + } + ref() { + for (const interval of this.changeListeners.values()) + interval.ref(); + return this; + } + unref() { + for (const interval of this.changeListeners.values()) + interval.unref(); + return this; + } +} + +const statWatchersByFakeFS = /* @__PURE__ */ new WeakMap(); +function watchFile(fakeFs, path, a, b) { + let bigint; + let persistent; + let interval; + let listener; + switch (typeof a) { + case `function`: + { + bigint = false; + persistent = true; + interval = 5007; + listener = a; + } + break; + default: + { + ({ + bigint = false, + persistent = true, + interval = 5007 + } = a); + listener = b; + } + break; + } + let statWatchers = statWatchersByFakeFS.get(fakeFs); + if (typeof statWatchers === `undefined`) + statWatchersByFakeFS.set(fakeFs, statWatchers = /* @__PURE__ */ new Map()); + let statWatcher = statWatchers.get(path); + if (typeof statWatcher === `undefined`) { + statWatcher = CustomStatWatcher.create(fakeFs, path, { bigint }); + statWatchers.set(path, statWatcher); + } + statWatcher.registerChangeListener(listener, { persistent, interval }); + return statWatcher; +} +function unwatchFile(fakeFs, path, cb) { + const statWatchers = statWatchersByFakeFS.get(fakeFs); + if (typeof statWatchers === `undefined`) + return; + const statWatcher = statWatchers.get(path); + if (typeof statWatcher === `undefined`) + return; + if (typeof cb === `undefined`) + statWatcher.unregisterAllChangeListeners(); + else + statWatcher.unregisterChangeListener(cb); + if (!statWatcher.hasChangeListeners()) { + statWatcher.stop(); + statWatchers.delete(path); + } +} +function unwatchAllFiles(fakeFs) { + const statWatchers = statWatchersByFakeFS.get(fakeFs); + if (typeof statWatchers === `undefined`) + return; + for (const path of statWatchers.keys()) { + unwatchFile(fakeFs, path); + } +} + +class FakeFS { + constructor(pathUtils) { + this.pathUtils = pathUtils; + } + async *genTraversePromise(init, { stableSort = false } = {}) { + const stack = [init]; + while (stack.length > 0) { + const p = stack.shift(); + const entry = await this.lstatPromise(p); + if (entry.isDirectory()) { + const entries = await this.readdirPromise(p); + if (stableSort) { + for (const entry2 of entries.sort()) { + stack.push(this.pathUtils.join(p, entry2)); + } + } else { + throw new Error(`Not supported`); + } + } else { + yield p; + } + } + } + async checksumFilePromise(path, { algorithm = `sha512` } = {}) { + const fd = await this.openPromise(path, `r`); + try { + const CHUNK_SIZE = 65536; + const chunk = Buffer.allocUnsafeSlow(CHUNK_SIZE); + const hash = crypto.createHash(algorithm); + let bytesRead = 0; + while ((bytesRead = await this.readPromise(fd, chunk, 0, CHUNK_SIZE)) !== 0) + hash.update(bytesRead === CHUNK_SIZE ? chunk : chunk.slice(0, bytesRead)); + return hash.digest(`hex`); + } finally { + await this.closePromise(fd); + } + } + async removePromise(p, { recursive = true, maxRetries = 5 } = {}) { + let stat; + try { + stat = await this.lstatPromise(p); + } catch (error) { + if (error.code === `ENOENT`) { + return; + } else { + throw error; + } + } + if (stat.isDirectory()) { + if (recursive) { + const entries = await this.readdirPromise(p); + await Promise.all(entries.map((entry) => { + return this.removePromise(this.pathUtils.resolve(p, entry)); + })); + } + for (let t = 0; t <= maxRetries; t++) { + try { + await this.rmdirPromise(p); + break; + } catch (error) { + if (error.code !== `EBUSY` && error.code !== `ENOTEMPTY`) { + throw error; + } else if (t < maxRetries) { + await new Promise((resolve) => setTimeout(resolve, t * 100)); + } + } + } + } else { + await this.unlinkPromise(p); + } + } + removeSync(p, { recursive = true } = {}) { + let stat; + try { + stat = this.lstatSync(p); + } catch (error) { + if (error.code === `ENOENT`) { + return; + } else { + throw error; + } + } + if (stat.isDirectory()) { + if (recursive) + for (const entry of this.readdirSync(p)) + this.removeSync(this.pathUtils.resolve(p, entry)); + this.rmdirSync(p); + } else { + this.unlinkSync(p); + } + } + async mkdirpPromise(p, { chmod, utimes } = {}) { + p = this.resolve(p); + if (p === this.pathUtils.dirname(p)) + return void 0; + const parts = p.split(this.pathUtils.sep); + let createdDirectory; + for (let u = 2; u <= parts.length; ++u) { + const subPath = parts.slice(0, u).join(this.pathUtils.sep); + if (!this.existsSync(subPath)) { + try { + await this.mkdirPromise(subPath); + } catch (error) { + if (error.code === `EEXIST`) { + continue; + } else { + throw error; + } + } + createdDirectory ?? (createdDirectory = subPath); + if (chmod != null) + await this.chmodPromise(subPath, chmod); + if (utimes != null) { + await this.utimesPromise(subPath, utimes[0], utimes[1]); + } else { + const parentStat = await this.statPromise(this.pathUtils.dirname(subPath)); + await this.utimesPromise(subPath, parentStat.atime, parentStat.mtime); + } + } + } + return createdDirectory; + } + mkdirpSync(p, { chmod, utimes } = {}) { + p = this.resolve(p); + if (p === this.pathUtils.dirname(p)) + return void 0; + const parts = p.split(this.pathUtils.sep); + let createdDirectory; + for (let u = 2; u <= parts.length; ++u) { + const subPath = parts.slice(0, u).join(this.pathUtils.sep); + if (!this.existsSync(subPath)) { + try { + this.mkdirSync(subPath); + } catch (error) { + if (error.code === `EEXIST`) { + continue; + } else { + throw error; + } + } + createdDirectory ?? (createdDirectory = subPath); + if (chmod != null) + this.chmodSync(subPath, chmod); + if (utimes != null) { + this.utimesSync(subPath, utimes[0], utimes[1]); + } else { + const parentStat = this.statSync(this.pathUtils.dirname(subPath)); + this.utimesSync(subPath, parentStat.atime, parentStat.mtime); + } + } + } + return createdDirectory; + } + async copyPromise(destination, source, { baseFs = this, overwrite = true, stableSort = false, stableTime = false, linkStrategy = null } = {}) { + return await copyPromise(this, destination, baseFs, source, { overwrite, stableSort, stableTime, linkStrategy }); + } + copySync(destination, source, { baseFs = this, overwrite = true } = {}) { + const stat = baseFs.lstatSync(source); + const exists = this.existsSync(destination); + if (stat.isDirectory()) { + this.mkdirpSync(destination); + const directoryListing = baseFs.readdirSync(source); + for (const entry of directoryListing) { + this.copySync(this.pathUtils.join(destination, entry), baseFs.pathUtils.join(source, entry), { baseFs, overwrite }); + } + } else if (stat.isFile()) { + if (!exists || overwrite) { + if (exists) + this.removeSync(destination); + const content = baseFs.readFileSync(source); + this.writeFileSync(destination, content); + } + } else if (stat.isSymbolicLink()) { + if (!exists || overwrite) { + if (exists) + this.removeSync(destination); + const target = baseFs.readlinkSync(source); + this.symlinkSync(convertPath(this.pathUtils, target), destination); + } + } else { + throw new Error(`Unsupported file type (file: ${source}, mode: 0o${stat.mode.toString(8).padStart(6, `0`)})`); + } + const mode = stat.mode & 511; + this.chmodSync(destination, mode); + } + async changeFilePromise(p, content, opts = {}) { + if (Buffer.isBuffer(content)) { + return this.changeFileBufferPromise(p, content, opts); + } else { + return this.changeFileTextPromise(p, content, opts); + } + } + async changeFileBufferPromise(p, content, { mode } = {}) { + let current = Buffer.alloc(0); + try { + current = await this.readFilePromise(p); + } catch (error) { + } + if (Buffer.compare(current, content) === 0) + return; + await this.writeFilePromise(p, content, { mode }); + } + async changeFileTextPromise(p, content, { automaticNewlines, mode } = {}) { + let current = ``; + try { + current = await this.readFilePromise(p, `utf8`); + } catch (error) { + } + const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; + if (current === normalizedContent) + return; + await this.writeFilePromise(p, normalizedContent, { mode }); + } + changeFileSync(p, content, opts = {}) { + if (Buffer.isBuffer(content)) { + return this.changeFileBufferSync(p, content, opts); + } else { + return this.changeFileTextSync(p, content, opts); + } + } + changeFileBufferSync(p, content, { mode } = {}) { + let current = Buffer.alloc(0); + try { + current = this.readFileSync(p); + } catch (error) { + } + if (Buffer.compare(current, content) === 0) + return; + this.writeFileSync(p, content, { mode }); + } + changeFileTextSync(p, content, { automaticNewlines = false, mode } = {}) { + let current = ``; + try { + current = this.readFileSync(p, `utf8`); + } catch (error) { + } + const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; + if (current === normalizedContent) + return; + this.writeFileSync(p, normalizedContent, { mode }); + } + async movePromise(fromP, toP) { + try { + await this.renamePromise(fromP, toP); + } catch (error) { + if (error.code === `EXDEV`) { + await this.copyPromise(toP, fromP); + await this.removePromise(fromP); + } else { + throw error; + } + } + } + moveSync(fromP, toP) { + try { + this.renameSync(fromP, toP); + } catch (error) { + if (error.code === `EXDEV`) { + this.copySync(toP, fromP); + this.removeSync(fromP); + } else { + throw error; + } + } + } + async lockPromise(affectedPath, callback) { + const lockPath = `${affectedPath}.flock`; + const interval = 1e3 / 60; + const startTime = Date.now(); + let fd = null; + const isAlive = async () => { + let pid; + try { + [pid] = await this.readJsonPromise(lockPath); + } catch (error) { + return Date.now() - startTime < 500; + } + try { + process.kill(pid, 0); + return true; + } catch (error) { + return false; + } + }; + while (fd === null) { + try { + fd = await this.openPromise(lockPath, `wx`); + } catch (error) { + if (error.code === `EEXIST`) { + if (!await isAlive()) { + try { + await this.unlinkPromise(lockPath); + continue; + } catch (error2) { + } + } + if (Date.now() - startTime < 60 * 1e3) { + await new Promise((resolve) => setTimeout(resolve, interval)); + } else { + throw new Error(`Couldn't acquire a lock in a reasonable time (via ${lockPath})`); + } + } else { + throw error; + } + } + } + await this.writePromise(fd, JSON.stringify([process.pid])); + try { + return await callback(); + } finally { + try { + await this.closePromise(fd); + await this.unlinkPromise(lockPath); + } catch (error) { + } + } + } + async readJsonPromise(p) { + const content = await this.readFilePromise(p, `utf8`); + try { + return JSON.parse(content); + } catch (error) { + error.message += ` (in ${p})`; + throw error; + } + } + readJsonSync(p) { + const content = this.readFileSync(p, `utf8`); + try { + return JSON.parse(content); + } catch (error) { + error.message += ` (in ${p})`; + throw error; + } + } + async writeJsonPromise(p, data) { + return await this.writeFilePromise(p, `${JSON.stringify(data, null, 2)} +`); + } + writeJsonSync(p, data) { + return this.writeFileSync(p, `${JSON.stringify(data, null, 2)} +`); + } + async preserveTimePromise(p, cb) { + const stat = await this.lstatPromise(p); + const result = await cb(); + if (typeof result !== `undefined`) + p = result; + await this.lutimesPromise(p, stat.atime, stat.mtime); + } + async preserveTimeSync(p, cb) { + const stat = this.lstatSync(p); + const result = cb(); + if (typeof result !== `undefined`) + p = result; + this.lutimesSync(p, stat.atime, stat.mtime); + } +} +class BasePortableFakeFS extends FakeFS { + constructor() { + super(ppath); + } +} +function getEndOfLine(content) { + const matches = content.match(/\r?\n/g); + if (matches === null) + return os.EOL; + const crlf = matches.filter((nl) => nl === `\r +`).length; + const lf = matches.length - crlf; + return crlf > lf ? `\r +` : ` +`; +} +function normalizeLineEndings(originalContent, newContent) { + return newContent.replace(/\r?\n/g, getEndOfLine(originalContent)); +} + +class ProxiedFS extends FakeFS { + getExtractHint(hints) { + return this.baseFs.getExtractHint(hints); + } + resolve(path) { + return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path))); + } + getRealPath() { + return this.mapFromBase(this.baseFs.getRealPath()); + } + async openPromise(p, flags, mode) { + return this.baseFs.openPromise(this.mapToBase(p), flags, mode); + } + openSync(p, flags, mode) { + return this.baseFs.openSync(this.mapToBase(p), flags, mode); + } + async opendirPromise(p, opts) { + return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(p), opts), { path: p }); + } + opendirSync(p, opts) { + return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), { path: p }); + } + async readPromise(fd, buffer, offset, length, position) { + return await this.baseFs.readPromise(fd, buffer, offset, length, position); + } + readSync(fd, buffer, offset, length, position) { + return this.baseFs.readSync(fd, buffer, offset, length, position); + } + async writePromise(fd, buffer, offset, length, position) { + if (typeof buffer === `string`) { + return await this.baseFs.writePromise(fd, buffer, offset); + } else { + return await this.baseFs.writePromise(fd, buffer, offset, length, position); + } + } + writeSync(fd, buffer, offset, length, position) { + if (typeof buffer === `string`) { + return this.baseFs.writeSync(fd, buffer, offset); + } else { + return this.baseFs.writeSync(fd, buffer, offset, length, position); + } + } + async closePromise(fd) { + return this.baseFs.closePromise(fd); + } + closeSync(fd) { + this.baseFs.closeSync(fd); + } + createReadStream(p, opts) { + return this.baseFs.createReadStream(p !== null ? this.mapToBase(p) : p, opts); + } + createWriteStream(p, opts) { + return this.baseFs.createWriteStream(p !== null ? this.mapToBase(p) : p, opts); + } + async realpathPromise(p) { + return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(p))); + } + realpathSync(p) { + return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(p))); + } + async existsPromise(p) { + return this.baseFs.existsPromise(this.mapToBase(p)); + } + existsSync(p) { + return this.baseFs.existsSync(this.mapToBase(p)); + } + accessSync(p, mode) { + return this.baseFs.accessSync(this.mapToBase(p), mode); + } + async accessPromise(p, mode) { + return this.baseFs.accessPromise(this.mapToBase(p), mode); + } + async statPromise(p, opts) { + return this.baseFs.statPromise(this.mapToBase(p), opts); + } + statSync(p, opts) { + return this.baseFs.statSync(this.mapToBase(p), opts); + } + async fstatPromise(fd, opts) { + return this.baseFs.fstatPromise(fd, opts); + } + fstatSync(fd, opts) { + return this.baseFs.fstatSync(fd, opts); + } + lstatPromise(p, opts) { + return this.baseFs.lstatPromise(this.mapToBase(p), opts); + } + lstatSync(p, opts) { + return this.baseFs.lstatSync(this.mapToBase(p), opts); + } + async fchmodPromise(fd, mask) { + return this.baseFs.fchmodPromise(fd, mask); + } + fchmodSync(fd, mask) { + return this.baseFs.fchmodSync(fd, mask); + } + async chmodPromise(p, mask) { + return this.baseFs.chmodPromise(this.mapToBase(p), mask); + } + chmodSync(p, mask) { + return this.baseFs.chmodSync(this.mapToBase(p), mask); + } + async fchownPromise(fd, uid, gid) { + return this.baseFs.fchownPromise(fd, uid, gid); + } + fchownSync(fd, uid, gid) { + return this.baseFs.fchownSync(fd, uid, gid); + } + async chownPromise(p, uid, gid) { + return this.baseFs.chownPromise(this.mapToBase(p), uid, gid); + } + chownSync(p, uid, gid) { + return this.baseFs.chownSync(this.mapToBase(p), uid, gid); + } + async renamePromise(oldP, newP) { + return this.baseFs.renamePromise(this.mapToBase(oldP), this.mapToBase(newP)); + } + renameSync(oldP, newP) { + return this.baseFs.renameSync(this.mapToBase(oldP), this.mapToBase(newP)); + } + async copyFilePromise(sourceP, destP, flags = 0) { + return this.baseFs.copyFilePromise(this.mapToBase(sourceP), this.mapToBase(destP), flags); + } + copyFileSync(sourceP, destP, flags = 0) { + return this.baseFs.copyFileSync(this.mapToBase(sourceP), this.mapToBase(destP), flags); + } + async appendFilePromise(p, content, opts) { + return this.baseFs.appendFilePromise(this.fsMapToBase(p), content, opts); + } + appendFileSync(p, content, opts) { + return this.baseFs.appendFileSync(this.fsMapToBase(p), content, opts); + } + async writeFilePromise(p, content, opts) { + return this.baseFs.writeFilePromise(this.fsMapToBase(p), content, opts); + } + writeFileSync(p, content, opts) { + return this.baseFs.writeFileSync(this.fsMapToBase(p), content, opts); + } + async unlinkPromise(p) { + return this.baseFs.unlinkPromise(this.mapToBase(p)); + } + unlinkSync(p) { + return this.baseFs.unlinkSync(this.mapToBase(p)); + } + async utimesPromise(p, atime, mtime) { + return this.baseFs.utimesPromise(this.mapToBase(p), atime, mtime); + } + utimesSync(p, atime, mtime) { + return this.baseFs.utimesSync(this.mapToBase(p), atime, mtime); + } + async lutimesPromise(p, atime, mtime) { + return this.baseFs.lutimesPromise(this.mapToBase(p), atime, mtime); + } + lutimesSync(p, atime, mtime) { + return this.baseFs.lutimesSync(this.mapToBase(p), atime, mtime); + } + async mkdirPromise(p, opts) { + return this.baseFs.mkdirPromise(this.mapToBase(p), opts); + } + mkdirSync(p, opts) { + return this.baseFs.mkdirSync(this.mapToBase(p), opts); + } + async rmdirPromise(p, opts) { + return this.baseFs.rmdirPromise(this.mapToBase(p), opts); + } + rmdirSync(p, opts) { + return this.baseFs.rmdirSync(this.mapToBase(p), opts); + } + async linkPromise(existingP, newP) { + return this.baseFs.linkPromise(this.mapToBase(existingP), this.mapToBase(newP)); + } + linkSync(existingP, newP) { + return this.baseFs.linkSync(this.mapToBase(existingP), this.mapToBase(newP)); + } + async symlinkPromise(target, p, type) { + const mappedP = this.mapToBase(p); + if (this.pathUtils.isAbsolute(target)) + return this.baseFs.symlinkPromise(this.mapToBase(target), mappedP, type); + const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); + const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); + return this.baseFs.symlinkPromise(mappedTarget, mappedP, type); + } + symlinkSync(target, p, type) { + const mappedP = this.mapToBase(p); + if (this.pathUtils.isAbsolute(target)) + return this.baseFs.symlinkSync(this.mapToBase(target), mappedP, type); + const mappedAbsoluteTarget = this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(p), target)); + const mappedTarget = this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(mappedP), mappedAbsoluteTarget); + return this.baseFs.symlinkSync(mappedTarget, mappedP, type); + } + async readFilePromise(p, encoding) { + return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); + } + readFileSync(p, encoding) { + return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); + } + async readdirPromise(p, opts) { + return this.baseFs.readdirPromise(this.mapToBase(p), opts); + } + readdirSync(p, opts) { + return this.baseFs.readdirSync(this.mapToBase(p), opts); + } + async readlinkPromise(p) { + return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(p))); + } + readlinkSync(p) { + return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(p))); + } + async truncatePromise(p, len) { + return this.baseFs.truncatePromise(this.mapToBase(p), len); + } + truncateSync(p, len) { + return this.baseFs.truncateSync(this.mapToBase(p), len); + } + async ftruncatePromise(fd, len) { + return this.baseFs.ftruncatePromise(fd, len); + } + ftruncateSync(fd, len) { + return this.baseFs.ftruncateSync(fd, len); + } + watch(p, a, b) { + return this.baseFs.watch( + this.mapToBase(p), + a, + b + ); + } + watchFile(p, a, b) { + return this.baseFs.watchFile( + this.mapToBase(p), + a, + b + ); + } + unwatchFile(p, cb) { + return this.baseFs.unwatchFile(this.mapToBase(p), cb); + } + fsMapToBase(p) { + if (typeof p === `number`) { + return p; + } else { + return this.mapToBase(p); + } + } +} + +class NodeFS extends BasePortableFakeFS { + constructor(realFs = fs__default.default) { + super(); + this.realFs = realFs; + } + getExtractHint() { + return false; + } + getRealPath() { + return PortablePath.root; + } + resolve(p) { + return ppath.resolve(p); + } + async openPromise(p, flags, mode) { + return await new Promise((resolve, reject) => { + this.realFs.open(npath.fromPortablePath(p), flags, mode, this.makeCallback(resolve, reject)); + }); + } + openSync(p, flags, mode) { + return this.realFs.openSync(npath.fromPortablePath(p), flags, mode); + } + async opendirPromise(p, opts) { + return await new Promise((resolve, reject) => { + if (typeof opts !== `undefined`) { + this.realFs.opendir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + } + }).then((dir) => { + return Object.defineProperty(dir, `path`, { value: p, configurable: true, writable: true }); + }); + } + opendirSync(p, opts) { + const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p)); + return Object.defineProperty(dir, `path`, { value: p, configurable: true, writable: true }); + } + async readPromise(fd, buffer, offset = 0, length = 0, position = -1) { + return await new Promise((resolve, reject) => { + this.realFs.read(fd, buffer, offset, length, position, (error, bytesRead) => { + if (error) { + reject(error); + } else { + resolve(bytesRead); + } + }); + }); + } + readSync(fd, buffer, offset, length, position) { + return this.realFs.readSync(fd, buffer, offset, length, position); + } + async writePromise(fd, buffer, offset, length, position) { + return await new Promise((resolve, reject) => { + if (typeof buffer === `string`) { + return this.realFs.write(fd, buffer, offset, this.makeCallback(resolve, reject)); + } else { + return this.realFs.write(fd, buffer, offset, length, position, this.makeCallback(resolve, reject)); + } + }); + } + writeSync(fd, buffer, offset, length, position) { + if (typeof buffer === `string`) { + return this.realFs.writeSync(fd, buffer, offset); + } else { + return this.realFs.writeSync(fd, buffer, offset, length, position); + } + } + async closePromise(fd) { + await new Promise((resolve, reject) => { + this.realFs.close(fd, this.makeCallback(resolve, reject)); + }); + } + closeSync(fd) { + this.realFs.closeSync(fd); + } + createReadStream(p, opts) { + const realPath = p !== null ? npath.fromPortablePath(p) : p; + return this.realFs.createReadStream(realPath, opts); + } + createWriteStream(p, opts) { + const realPath = p !== null ? npath.fromPortablePath(p) : p; + return this.realFs.createWriteStream(realPath, opts); + } + async realpathPromise(p) { + return await new Promise((resolve, reject) => { + this.realFs.realpath(npath.fromPortablePath(p), {}, this.makeCallback(resolve, reject)); + }).then((path) => { + return npath.toPortablePath(path); + }); + } + realpathSync(p) { + return npath.toPortablePath(this.realFs.realpathSync(npath.fromPortablePath(p), {})); + } + async existsPromise(p) { + return await new Promise((resolve) => { + this.realFs.exists(npath.fromPortablePath(p), resolve); + }); + } + accessSync(p, mode) { + return this.realFs.accessSync(npath.fromPortablePath(p), mode); + } + async accessPromise(p, mode) { + return await new Promise((resolve, reject) => { + this.realFs.access(npath.fromPortablePath(p), mode, this.makeCallback(resolve, reject)); + }); + } + existsSync(p) { + return this.realFs.existsSync(npath.fromPortablePath(p)); + } + async statPromise(p, opts) { + return await new Promise((resolve, reject) => { + if (opts) { + this.realFs.stat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.stat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + } + }); + } + statSync(p, opts) { + if (opts) { + return this.realFs.statSync(npath.fromPortablePath(p), opts); + } else { + return this.realFs.statSync(npath.fromPortablePath(p)); + } + } + async fstatPromise(fd, opts) { + return await new Promise((resolve, reject) => { + if (opts) { + this.realFs.fstat(fd, opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.fstat(fd, this.makeCallback(resolve, reject)); + } + }); + } + fstatSync(fd, opts) { + if (opts) { + return this.realFs.fstatSync(fd, opts); + } else { + return this.realFs.fstatSync(fd); + } + } + async lstatPromise(p, opts) { + return await new Promise((resolve, reject) => { + if (opts) { + this.realFs.lstat(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.lstat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + } + }); + } + lstatSync(p, opts) { + if (opts) { + return this.realFs.lstatSync(npath.fromPortablePath(p), opts); + } else { + return this.realFs.lstatSync(npath.fromPortablePath(p)); + } + } + async fchmodPromise(fd, mask) { + return await new Promise((resolve, reject) => { + this.realFs.fchmod(fd, mask, this.makeCallback(resolve, reject)); + }); + } + fchmodSync(fd, mask) { + return this.realFs.fchmodSync(fd, mask); + } + async chmodPromise(p, mask) { + return await new Promise((resolve, reject) => { + this.realFs.chmod(npath.fromPortablePath(p), mask, this.makeCallback(resolve, reject)); + }); + } + chmodSync(p, mask) { + return this.realFs.chmodSync(npath.fromPortablePath(p), mask); + } + async fchownPromise(fd, uid, gid) { + return await new Promise((resolve, reject) => { + this.realFs.fchown(fd, uid, gid, this.makeCallback(resolve, reject)); + }); + } + fchownSync(fd, uid, gid) { + return this.realFs.fchownSync(fd, uid, gid); + } + async chownPromise(p, uid, gid) { + return await new Promise((resolve, reject) => { + this.realFs.chown(npath.fromPortablePath(p), uid, gid, this.makeCallback(resolve, reject)); + }); + } + chownSync(p, uid, gid) { + return this.realFs.chownSync(npath.fromPortablePath(p), uid, gid); + } + async renamePromise(oldP, newP) { + return await new Promise((resolve, reject) => { + this.realFs.rename(npath.fromPortablePath(oldP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); + }); + } + renameSync(oldP, newP) { + return this.realFs.renameSync(npath.fromPortablePath(oldP), npath.fromPortablePath(newP)); + } + async copyFilePromise(sourceP, destP, flags = 0) { + return await new Promise((resolve, reject) => { + this.realFs.copyFile(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags, this.makeCallback(resolve, reject)); + }); + } + copyFileSync(sourceP, destP, flags = 0) { + return this.realFs.copyFileSync(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags); + } + async appendFilePromise(p, content, opts) { + return await new Promise((resolve, reject) => { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + if (opts) { + this.realFs.appendFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.appendFile(fsNativePath, content, this.makeCallback(resolve, reject)); + } + }); + } + appendFileSync(p, content, opts) { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + if (opts) { + this.realFs.appendFileSync(fsNativePath, content, opts); + } else { + this.realFs.appendFileSync(fsNativePath, content); + } + } + async writeFilePromise(p, content, opts) { + return await new Promise((resolve, reject) => { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + if (opts) { + this.realFs.writeFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.writeFile(fsNativePath, content, this.makeCallback(resolve, reject)); + } + }); + } + writeFileSync(p, content, opts) { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + if (opts) { + this.realFs.writeFileSync(fsNativePath, content, opts); + } else { + this.realFs.writeFileSync(fsNativePath, content); + } + } + async unlinkPromise(p) { + return await new Promise((resolve, reject) => { + this.realFs.unlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + }); + } + unlinkSync(p) { + return this.realFs.unlinkSync(npath.fromPortablePath(p)); + } + async utimesPromise(p, atime, mtime) { + return await new Promise((resolve, reject) => { + this.realFs.utimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); + }); + } + utimesSync(p, atime, mtime) { + this.realFs.utimesSync(npath.fromPortablePath(p), atime, mtime); + } + async lutimesPromise(p, atime, mtime) { + return await new Promise((resolve, reject) => { + this.realFs.lutimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); + }); + } + lutimesSync(p, atime, mtime) { + this.realFs.lutimesSync(npath.fromPortablePath(p), atime, mtime); + } + async mkdirPromise(p, opts) { + return await new Promise((resolve, reject) => { + this.realFs.mkdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); + }); + } + mkdirSync(p, opts) { + return this.realFs.mkdirSync(npath.fromPortablePath(p), opts); + } + async rmdirPromise(p, opts) { + return await new Promise((resolve, reject) => { + if (opts) { + this.realFs.rmdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.rmdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + } + }); + } + rmdirSync(p, opts) { + return this.realFs.rmdirSync(npath.fromPortablePath(p), opts); + } + async linkPromise(existingP, newP) { + return await new Promise((resolve, reject) => { + this.realFs.link(npath.fromPortablePath(existingP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); + }); + } + linkSync(existingP, newP) { + return this.realFs.linkSync(npath.fromPortablePath(existingP), npath.fromPortablePath(newP)); + } + async symlinkPromise(target, p, type) { + return await new Promise((resolve, reject) => { + this.realFs.symlink(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type, this.makeCallback(resolve, reject)); + }); + } + symlinkSync(target, p, type) { + return this.realFs.symlinkSync(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), type); + } + async readFilePromise(p, encoding) { + return await new Promise((resolve, reject) => { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + this.realFs.readFile(fsNativePath, encoding, this.makeCallback(resolve, reject)); + }); + } + readFileSync(p, encoding) { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + return this.realFs.readFileSync(fsNativePath, encoding); + } + async readdirPromise(p, opts) { + return await new Promise((resolve, reject) => { + if (opts == null ? void 0 : opts.withFileTypes) { + this.realFs.readdir(npath.fromPortablePath(p), { withFileTypes: true }, this.makeCallback(resolve, reject)); + } else { + this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback((value) => resolve(value), reject)); + } + }); + } + readdirSync(p, opts) { + if (opts == null ? void 0 : opts.withFileTypes) { + return this.realFs.readdirSync(npath.fromPortablePath(p), { withFileTypes: true }); + } else { + return this.realFs.readdirSync(npath.fromPortablePath(p)); + } + } + async readlinkPromise(p) { + return await new Promise((resolve, reject) => { + this.realFs.readlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + }).then((path) => { + return npath.toPortablePath(path); + }); + } + readlinkSync(p) { + return npath.toPortablePath(this.realFs.readlinkSync(npath.fromPortablePath(p))); + } + async truncatePromise(p, len) { + return await new Promise((resolve, reject) => { + this.realFs.truncate(npath.fromPortablePath(p), len, this.makeCallback(resolve, reject)); + }); + } + truncateSync(p, len) { + return this.realFs.truncateSync(npath.fromPortablePath(p), len); + } + async ftruncatePromise(fd, len) { + return await new Promise((resolve, reject) => { + this.realFs.ftruncate(fd, len, this.makeCallback(resolve, reject)); + }); + } + ftruncateSync(fd, len) { + return this.realFs.ftruncateSync(fd, len); + } + watch(p, a, b) { + return this.realFs.watch( + npath.fromPortablePath(p), + a, + b + ); + } + watchFile(p, a, b) { + return this.realFs.watchFile( + npath.fromPortablePath(p), + a, + b + ); + } + unwatchFile(p, cb) { + return this.realFs.unwatchFile(npath.fromPortablePath(p), cb); + } + makeCallback(resolve, reject) { + return (err, result) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }; + } +} + +const MOUNT_MASK = 4278190080; +class MountFS extends BasePortableFakeFS { + constructor({ baseFs = new NodeFS(), filter = null, magicByte = 42, maxOpenFiles = Infinity, useCache = true, maxAge = 5e3, typeCheck = fs.constants.S_IFREG, getMountPoint, factoryPromise, factorySync }) { + if (Math.floor(magicByte) !== magicByte || !(magicByte > 1 && magicByte <= 127)) + throw new Error(`The magic byte must be set to a round value between 1 and 127 included`); + super(); + this.fdMap = /* @__PURE__ */ new Map(); + this.nextFd = 3; + this.isMount = /* @__PURE__ */ new Set(); + this.notMount = /* @__PURE__ */ new Set(); + this.realPaths = /* @__PURE__ */ new Map(); + this.limitOpenFilesTimeout = null; + this.baseFs = baseFs; + this.mountInstances = useCache ? /* @__PURE__ */ new Map() : null; + this.factoryPromise = factoryPromise; + this.factorySync = factorySync; + this.filter = filter; + this.getMountPoint = getMountPoint; + this.magic = magicByte << 24; + this.maxAge = maxAge; + this.maxOpenFiles = maxOpenFiles; + this.typeCheck = typeCheck; + } + getExtractHint(hints) { + return this.baseFs.getExtractHint(hints); + } + getRealPath() { + return this.baseFs.getRealPath(); + } + saveAndClose() { + var _a; + unwatchAllFiles(this); + if (this.mountInstances) { + for (const [path, { childFs }] of this.mountInstances.entries()) { + (_a = childFs.saveAndClose) == null ? void 0 : _a.call(childFs); + this.mountInstances.delete(path); + } + } + } + discardAndClose() { + var _a; + unwatchAllFiles(this); + if (this.mountInstances) { + for (const [path, { childFs }] of this.mountInstances.entries()) { + (_a = childFs.discardAndClose) == null ? void 0 : _a.call(childFs); + this.mountInstances.delete(path); + } + } + } + resolve(p) { + return this.baseFs.resolve(p); + } + remapFd(mountFs, fd) { + const remappedFd = this.nextFd++ | this.magic; + this.fdMap.set(remappedFd, [mountFs, fd]); + return remappedFd; + } + async openPromise(p, flags, mode) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.openPromise(p, flags, mode); + }, async (mountFs, { subPath }) => { + return this.remapFd(mountFs, await mountFs.openPromise(subPath, flags, mode)); + }); + } + openSync(p, flags, mode) { + return this.makeCallSync(p, () => { + return this.baseFs.openSync(p, flags, mode); + }, (mountFs, { subPath }) => { + return this.remapFd(mountFs, mountFs.openSync(subPath, flags, mode)); + }); + } + async opendirPromise(p, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.opendirPromise(p, opts); + }, async (mountFs, { subPath }) => { + return await mountFs.opendirPromise(subPath, opts); + }, { + requireSubpath: false + }); + } + opendirSync(p, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.opendirSync(p, opts); + }, (mountFs, { subPath }) => { + return mountFs.opendirSync(subPath, opts); + }, { + requireSubpath: false + }); + } + async readPromise(fd, buffer, offset, length, position) { + if ((fd & MOUNT_MASK) !== this.magic) + return await this.baseFs.readPromise(fd, buffer, offset, length, position); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`read`); + const [mountFs, realFd] = entry; + return await mountFs.readPromise(realFd, buffer, offset, length, position); + } + readSync(fd, buffer, offset, length, position) { + if ((fd & MOUNT_MASK) !== this.magic) + return this.baseFs.readSync(fd, buffer, offset, length, position); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`readSync`); + const [mountFs, realFd] = entry; + return mountFs.readSync(realFd, buffer, offset, length, position); + } + async writePromise(fd, buffer, offset, length, position) { + if ((fd & MOUNT_MASK) !== this.magic) { + if (typeof buffer === `string`) { + return await this.baseFs.writePromise(fd, buffer, offset); + } else { + return await this.baseFs.writePromise(fd, buffer, offset, length, position); + } + } + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`write`); + const [mountFs, realFd] = entry; + if (typeof buffer === `string`) { + return await mountFs.writePromise(realFd, buffer, offset); + } else { + return await mountFs.writePromise(realFd, buffer, offset, length, position); + } + } + writeSync(fd, buffer, offset, length, position) { + if ((fd & MOUNT_MASK) !== this.magic) { + if (typeof buffer === `string`) { + return this.baseFs.writeSync(fd, buffer, offset); + } else { + return this.baseFs.writeSync(fd, buffer, offset, length, position); + } + } + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`writeSync`); + const [mountFs, realFd] = entry; + if (typeof buffer === `string`) { + return mountFs.writeSync(realFd, buffer, offset); + } else { + return mountFs.writeSync(realFd, buffer, offset, length, position); + } + } + async closePromise(fd) { + if ((fd & MOUNT_MASK) !== this.magic) + return await this.baseFs.closePromise(fd); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`close`); + this.fdMap.delete(fd); + const [mountFs, realFd] = entry; + return await mountFs.closePromise(realFd); + } + closeSync(fd) { + if ((fd & MOUNT_MASK) !== this.magic) + return this.baseFs.closeSync(fd); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`closeSync`); + this.fdMap.delete(fd); + const [mountFs, realFd] = entry; + return mountFs.closeSync(realFd); + } + createReadStream(p, opts) { + if (p === null) + return this.baseFs.createReadStream(p, opts); + return this.makeCallSync(p, () => { + return this.baseFs.createReadStream(p, opts); + }, (mountFs, { archivePath, subPath }) => { + const stream = mountFs.createReadStream(subPath, opts); + stream.path = npath.fromPortablePath(this.pathUtils.join(archivePath, subPath)); + return stream; + }); + } + createWriteStream(p, opts) { + if (p === null) + return this.baseFs.createWriteStream(p, opts); + return this.makeCallSync(p, () => { + return this.baseFs.createWriteStream(p, opts); + }, (mountFs, { subPath }) => { + return mountFs.createWriteStream(subPath, opts); + }); + } + async realpathPromise(p) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.realpathPromise(p); + }, async (mountFs, { archivePath, subPath }) => { + let realArchivePath = this.realPaths.get(archivePath); + if (typeof realArchivePath === `undefined`) { + realArchivePath = await this.baseFs.realpathPromise(archivePath); + this.realPaths.set(archivePath, realArchivePath); + } + return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, await mountFs.realpathPromise(subPath))); + }); + } + realpathSync(p) { + return this.makeCallSync(p, () => { + return this.baseFs.realpathSync(p); + }, (mountFs, { archivePath, subPath }) => { + let realArchivePath = this.realPaths.get(archivePath); + if (typeof realArchivePath === `undefined`) { + realArchivePath = this.baseFs.realpathSync(archivePath); + this.realPaths.set(archivePath, realArchivePath); + } + return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, mountFs.realpathSync(subPath))); + }); + } + async existsPromise(p) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.existsPromise(p); + }, async (mountFs, { subPath }) => { + return await mountFs.existsPromise(subPath); + }); + } + existsSync(p) { + return this.makeCallSync(p, () => { + return this.baseFs.existsSync(p); + }, (mountFs, { subPath }) => { + return mountFs.existsSync(subPath); + }); + } + async accessPromise(p, mode) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.accessPromise(p, mode); + }, async (mountFs, { subPath }) => { + return await mountFs.accessPromise(subPath, mode); + }); + } + accessSync(p, mode) { + return this.makeCallSync(p, () => { + return this.baseFs.accessSync(p, mode); + }, (mountFs, { subPath }) => { + return mountFs.accessSync(subPath, mode); + }); + } + async statPromise(p, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.statPromise(p, opts); + }, async (mountFs, { subPath }) => { + return await mountFs.statPromise(subPath, opts); + }); + } + statSync(p, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.statSync(p, opts); + }, (mountFs, { subPath }) => { + return mountFs.statSync(subPath, opts); + }); + } + async fstatPromise(fd, opts) { + if ((fd & MOUNT_MASK) !== this.magic) + return this.baseFs.fstatPromise(fd, opts); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`fstat`); + const [mountFs, realFd] = entry; + return mountFs.fstatPromise(realFd, opts); + } + fstatSync(fd, opts) { + if ((fd & MOUNT_MASK) !== this.magic) + return this.baseFs.fstatSync(fd, opts); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`fstatSync`); + const [mountFs, realFd] = entry; + return mountFs.fstatSync(realFd, opts); + } + async lstatPromise(p, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.lstatPromise(p, opts); + }, async (mountFs, { subPath }) => { + return await mountFs.lstatPromise(subPath, opts); + }); + } + lstatSync(p, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.lstatSync(p, opts); + }, (mountFs, { subPath }) => { + return mountFs.lstatSync(subPath, opts); + }); + } + async fchmodPromise(fd, mask) { + if ((fd & MOUNT_MASK) !== this.magic) + return this.baseFs.fchmodPromise(fd, mask); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`fchmod`); + const [mountFs, realFd] = entry; + return mountFs.fchmodPromise(realFd, mask); + } + fchmodSync(fd, mask) { + if ((fd & MOUNT_MASK) !== this.magic) + return this.baseFs.fchmodSync(fd, mask); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`fchmodSync`); + const [mountFs, realFd] = entry; + return mountFs.fchmodSync(realFd, mask); + } + async chmodPromise(p, mask) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.chmodPromise(p, mask); + }, async (mountFs, { subPath }) => { + return await mountFs.chmodPromise(subPath, mask); + }); + } + chmodSync(p, mask) { + return this.makeCallSync(p, () => { + return this.baseFs.chmodSync(p, mask); + }, (mountFs, { subPath }) => { + return mountFs.chmodSync(subPath, mask); + }); + } + async fchownPromise(fd, uid, gid) { + if ((fd & MOUNT_MASK) !== this.magic) + return this.baseFs.fchownPromise(fd, uid, gid); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`fchown`); + const [zipFs, realFd] = entry; + return zipFs.fchownPromise(realFd, uid, gid); + } + fchownSync(fd, uid, gid) { + if ((fd & MOUNT_MASK) !== this.magic) + return this.baseFs.fchownSync(fd, uid, gid); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`fchownSync`); + const [zipFs, realFd] = entry; + return zipFs.fchownSync(realFd, uid, gid); + } + async chownPromise(p, uid, gid) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.chownPromise(p, uid, gid); + }, async (mountFs, { subPath }) => { + return await mountFs.chownPromise(subPath, uid, gid); + }); + } + chownSync(p, uid, gid) { + return this.makeCallSync(p, () => { + return this.baseFs.chownSync(p, uid, gid); + }, (mountFs, { subPath }) => { + return mountFs.chownSync(subPath, uid, gid); + }); + } + async renamePromise(oldP, newP) { + return await this.makeCallPromise(oldP, async () => { + return await this.makeCallPromise(newP, async () => { + return await this.baseFs.renamePromise(oldP, newP); + }, async () => { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); + }); + }, async (mountFsO, { subPath: subPathO }) => { + return await this.makeCallPromise(newP, async () => { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); + }, async (mountFsN, { subPath: subPathN }) => { + if (mountFsO !== mountFsN) { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); + } else { + return await mountFsO.renamePromise(subPathO, subPathN); + } + }); + }); + } + renameSync(oldP, newP) { + return this.makeCallSync(oldP, () => { + return this.makeCallSync(newP, () => { + return this.baseFs.renameSync(oldP, newP); + }, () => { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); + }); + }, (mountFsO, { subPath: subPathO }) => { + return this.makeCallSync(newP, () => { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); + }, (mountFsN, { subPath: subPathN }) => { + if (mountFsO !== mountFsN) { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); + } else { + return mountFsO.renameSync(subPathO, subPathN); + } + }); + }); + } + async copyFilePromise(sourceP, destP, flags = 0) { + const fallback = async (sourceFs, sourceP2, destFs, destP2) => { + if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) + throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); + if (flags & fs.constants.COPYFILE_EXCL && await this.existsPromise(sourceP2)) + throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); + let content; + try { + content = await sourceFs.readFilePromise(sourceP2); + } catch (error) { + throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); + } + await destFs.writeFilePromise(destP2, content); + }; + return await this.makeCallPromise(sourceP, async () => { + return await this.makeCallPromise(destP, async () => { + return await this.baseFs.copyFilePromise(sourceP, destP, flags); + }, async (mountFsD, { subPath: subPathD }) => { + return await fallback(this.baseFs, sourceP, mountFsD, subPathD); + }); + }, async (mountFsS, { subPath: subPathS }) => { + return await this.makeCallPromise(destP, async () => { + return await fallback(mountFsS, subPathS, this.baseFs, destP); + }, async (mountFsD, { subPath: subPathD }) => { + if (mountFsS !== mountFsD) { + return await fallback(mountFsS, subPathS, mountFsD, subPathD); + } else { + return await mountFsS.copyFilePromise(subPathS, subPathD, flags); + } + }); + }); + } + copyFileSync(sourceP, destP, flags = 0) { + const fallback = (sourceFs, sourceP2, destFs, destP2) => { + if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) + throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); + if (flags & fs.constants.COPYFILE_EXCL && this.existsSync(sourceP2)) + throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); + let content; + try { + content = sourceFs.readFileSync(sourceP2); + } catch (error) { + throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); + } + destFs.writeFileSync(destP2, content); + }; + return this.makeCallSync(sourceP, () => { + return this.makeCallSync(destP, () => { + return this.baseFs.copyFileSync(sourceP, destP, flags); + }, (mountFsD, { subPath: subPathD }) => { + return fallback(this.baseFs, sourceP, mountFsD, subPathD); + }); + }, (mountFsS, { subPath: subPathS }) => { + return this.makeCallSync(destP, () => { + return fallback(mountFsS, subPathS, this.baseFs, destP); + }, (mountFsD, { subPath: subPathD }) => { + if (mountFsS !== mountFsD) { + return fallback(mountFsS, subPathS, mountFsD, subPathD); + } else { + return mountFsS.copyFileSync(subPathS, subPathD, flags); + } + }); + }); + } + async appendFilePromise(p, content, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.appendFilePromise(p, content, opts); + }, async (mountFs, { subPath }) => { + return await mountFs.appendFilePromise(subPath, content, opts); + }); + } + appendFileSync(p, content, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.appendFileSync(p, content, opts); + }, (mountFs, { subPath }) => { + return mountFs.appendFileSync(subPath, content, opts); + }); + } + async writeFilePromise(p, content, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.writeFilePromise(p, content, opts); + }, async (mountFs, { subPath }) => { + return await mountFs.writeFilePromise(subPath, content, opts); + }); + } + writeFileSync(p, content, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.writeFileSync(p, content, opts); + }, (mountFs, { subPath }) => { + return mountFs.writeFileSync(subPath, content, opts); + }); + } + async unlinkPromise(p) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.unlinkPromise(p); + }, async (mountFs, { subPath }) => { + return await mountFs.unlinkPromise(subPath); + }); + } + unlinkSync(p) { + return this.makeCallSync(p, () => { + return this.baseFs.unlinkSync(p); + }, (mountFs, { subPath }) => { + return mountFs.unlinkSync(subPath); + }); + } + async utimesPromise(p, atime, mtime) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.utimesPromise(p, atime, mtime); + }, async (mountFs, { subPath }) => { + return await mountFs.utimesPromise(subPath, atime, mtime); + }); + } + utimesSync(p, atime, mtime) { + return this.makeCallSync(p, () => { + return this.baseFs.utimesSync(p, atime, mtime); + }, (mountFs, { subPath }) => { + return mountFs.utimesSync(subPath, atime, mtime); + }); + } + async lutimesPromise(p, atime, mtime) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.lutimesPromise(p, atime, mtime); + }, async (mountFs, { subPath }) => { + return await mountFs.lutimesPromise(subPath, atime, mtime); + }); + } + lutimesSync(p, atime, mtime) { + return this.makeCallSync(p, () => { + return this.baseFs.lutimesSync(p, atime, mtime); + }, (mountFs, { subPath }) => { + return mountFs.lutimesSync(subPath, atime, mtime); + }); + } + async mkdirPromise(p, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.mkdirPromise(p, opts); + }, async (mountFs, { subPath }) => { + return await mountFs.mkdirPromise(subPath, opts); + }); + } + mkdirSync(p, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.mkdirSync(p, opts); + }, (mountFs, { subPath }) => { + return mountFs.mkdirSync(subPath, opts); + }); + } + async rmdirPromise(p, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.rmdirPromise(p, opts); + }, async (mountFs, { subPath }) => { + return await mountFs.rmdirPromise(subPath, opts); + }); + } + rmdirSync(p, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.rmdirSync(p, opts); + }, (mountFs, { subPath }) => { + return mountFs.rmdirSync(subPath, opts); + }); + } + async linkPromise(existingP, newP) { + return await this.makeCallPromise(newP, async () => { + return await this.baseFs.linkPromise(existingP, newP); + }, async (mountFs, { subPath }) => { + return await mountFs.linkPromise(existingP, subPath); + }); + } + linkSync(existingP, newP) { + return this.makeCallSync(newP, () => { + return this.baseFs.linkSync(existingP, newP); + }, (mountFs, { subPath }) => { + return mountFs.linkSync(existingP, subPath); + }); + } + async symlinkPromise(target, p, type) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.symlinkPromise(target, p, type); + }, async (mountFs, { subPath }) => { + return await mountFs.symlinkPromise(target, subPath); + }); + } + symlinkSync(target, p, type) { + return this.makeCallSync(p, () => { + return this.baseFs.symlinkSync(target, p, type); + }, (mountFs, { subPath }) => { + return mountFs.symlinkSync(target, subPath); + }); + } + async readFilePromise(p, encoding) { + return this.makeCallPromise(p, async () => { + return await this.baseFs.readFilePromise(p, encoding); + }, async (mountFs, { subPath }) => { + return await mountFs.readFilePromise(subPath, encoding); + }); + } + readFileSync(p, encoding) { + return this.makeCallSync(p, () => { + return this.baseFs.readFileSync(p, encoding); + }, (mountFs, { subPath }) => { + return mountFs.readFileSync(subPath, encoding); + }); + } + async readdirPromise(p, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.readdirPromise(p, opts); + }, async (mountFs, { subPath }) => { + return await mountFs.readdirPromise(subPath, opts); + }, { + requireSubpath: false + }); + } + readdirSync(p, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.readdirSync(p, opts); + }, (mountFs, { subPath }) => { + return mountFs.readdirSync(subPath, opts); + }, { + requireSubpath: false + }); + } + async readlinkPromise(p) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.readlinkPromise(p); + }, async (mountFs, { subPath }) => { + return await mountFs.readlinkPromise(subPath); + }); + } + readlinkSync(p) { + return this.makeCallSync(p, () => { + return this.baseFs.readlinkSync(p); + }, (mountFs, { subPath }) => { + return mountFs.readlinkSync(subPath); + }); + } + async truncatePromise(p, len) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.truncatePromise(p, len); + }, async (mountFs, { subPath }) => { + return await mountFs.truncatePromise(subPath, len); + }); + } + truncateSync(p, len) { + return this.makeCallSync(p, () => { + return this.baseFs.truncateSync(p, len); + }, (mountFs, { subPath }) => { + return mountFs.truncateSync(subPath, len); + }); + } + async ftruncatePromise(fd, len) { + if ((fd & MOUNT_MASK) !== this.magic) + return this.baseFs.ftruncatePromise(fd, len); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`ftruncate`); + const [mountFs, realFd] = entry; + return mountFs.ftruncatePromise(realFd, len); + } + ftruncateSync(fd, len) { + if ((fd & MOUNT_MASK) !== this.magic) + return this.baseFs.ftruncateSync(fd, len); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`ftruncateSync`); + const [mountFs, realFd] = entry; + return mountFs.ftruncateSync(realFd, len); + } + watch(p, a, b) { + return this.makeCallSync(p, () => { + return this.baseFs.watch( + p, + a, + b + ); + }, (mountFs, { subPath }) => { + return mountFs.watch( + subPath, + a, + b + ); + }); + } + watchFile(p, a, b) { + return this.makeCallSync(p, () => { + return this.baseFs.watchFile( + p, + a, + b + ); + }, () => { + return watchFile(this, p, a, b); + }); + } + unwatchFile(p, cb) { + return this.makeCallSync(p, () => { + return this.baseFs.unwatchFile(p, cb); + }, () => { + return unwatchFile(this, p, cb); + }); + } + async makeCallPromise(p, discard, accept, { requireSubpath = true } = {}) { + if (typeof p !== `string`) + return await discard(); + const normalizedP = this.resolve(p); + const mountInfo = this.findMount(normalizedP); + if (!mountInfo) + return await discard(); + if (requireSubpath && mountInfo.subPath === `/`) + return await discard(); + return await this.getMountPromise(mountInfo.archivePath, async (mountFs) => await accept(mountFs, mountInfo)); + } + makeCallSync(p, discard, accept, { requireSubpath = true } = {}) { + if (typeof p !== `string`) + return discard(); + const normalizedP = this.resolve(p); + const mountInfo = this.findMount(normalizedP); + if (!mountInfo) + return discard(); + if (requireSubpath && mountInfo.subPath === `/`) + return discard(); + return this.getMountSync(mountInfo.archivePath, (mountFs) => accept(mountFs, mountInfo)); + } + findMount(p) { + if (this.filter && !this.filter.test(p)) + return null; + let filePath = ``; + while (true) { + const pathPartWithArchive = p.substring(filePath.length); + const mountPoint = this.getMountPoint(pathPartWithArchive, filePath); + if (!mountPoint) + return null; + filePath = this.pathUtils.join(filePath, mountPoint); + if (!this.isMount.has(filePath)) { + if (this.notMount.has(filePath)) + continue; + try { + if (this.typeCheck !== null && (this.baseFs.lstatSync(filePath).mode & fs.constants.S_IFMT) !== this.typeCheck) { + this.notMount.add(filePath); + continue; + } + } catch { + return null; + } + this.isMount.add(filePath); + } + return { + archivePath: filePath, + subPath: this.pathUtils.join(PortablePath.root, p.substring(filePath.length)) + }; + } + } + limitOpenFiles(max) { + var _a, _b, _c; + if (this.mountInstances === null) + return; + const now = Date.now(); + let nextExpiresAt = now + this.maxAge; + let closeCount = max === null ? 0 : this.mountInstances.size - max; + for (const [path, { childFs, expiresAt, refCount }] of this.mountInstances.entries()) { + if (refCount !== 0 || ((_a = childFs.hasOpenFileHandles) == null ? void 0 : _a.call(childFs))) { + continue; + } else if (now >= expiresAt) { + (_b = childFs.saveAndClose) == null ? void 0 : _b.call(childFs); + this.mountInstances.delete(path); + closeCount -= 1; + continue; + } else if (max === null || closeCount <= 0) { + nextExpiresAt = expiresAt; + break; + } + (_c = childFs.saveAndClose) == null ? void 0 : _c.call(childFs); + this.mountInstances.delete(path); + closeCount -= 1; + } + if (this.limitOpenFilesTimeout === null && (max === null && this.mountInstances.size > 0 || max !== null) && isFinite(nextExpiresAt)) { + this.limitOpenFilesTimeout = setTimeout(() => { + this.limitOpenFilesTimeout = null; + this.limitOpenFiles(null); + }, nextExpiresAt - now).unref(); + } + } + async getMountPromise(p, accept) { + var _a; + if (this.mountInstances) { + let cachedMountFs = this.mountInstances.get(p); + if (!cachedMountFs) { + const createFsInstance = await this.factoryPromise(this.baseFs, p); + cachedMountFs = this.mountInstances.get(p); + if (!cachedMountFs) { + cachedMountFs = { + childFs: createFsInstance(), + expiresAt: 0, + refCount: 0 + }; + } + } + this.mountInstances.delete(p); + this.limitOpenFiles(this.maxOpenFiles - 1); + this.mountInstances.set(p, cachedMountFs); + cachedMountFs.expiresAt = Date.now() + this.maxAge; + cachedMountFs.refCount += 1; + try { + return await accept(cachedMountFs.childFs); + } finally { + cachedMountFs.refCount -= 1; + } + } else { + const mountFs = (await this.factoryPromise(this.baseFs, p))(); + try { + return await accept(mountFs); + } finally { + (_a = mountFs.saveAndClose) == null ? void 0 : _a.call(mountFs); + } + } + } + getMountSync(p, accept) { + var _a; + if (this.mountInstances) { + let cachedMountFs = this.mountInstances.get(p); + if (!cachedMountFs) { + cachedMountFs = { + childFs: this.factorySync(this.baseFs, p), + expiresAt: 0, + refCount: 0 + }; + } + this.mountInstances.delete(p); + this.limitOpenFiles(this.maxOpenFiles - 1); + this.mountInstances.set(p, cachedMountFs); + cachedMountFs.expiresAt = Date.now() + this.maxAge; + return accept(cachedMountFs.childFs); + } else { + const childFs = this.factorySync(this.baseFs, p); + try { + return accept(childFs); + } finally { + (_a = childFs.saveAndClose) == null ? void 0 : _a.call(childFs); + } + } + } +} + +class PosixFS extends ProxiedFS { + constructor(baseFs) { + super(npath); + this.baseFs = baseFs; + } + mapFromBase(path) { + return npath.fromPortablePath(path); + } + mapToBase(path) { + return npath.toPortablePath(path); + } +} + +const NUMBER_REGEXP = /^[0-9]+$/; +const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; +const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; +class VirtualFS extends ProxiedFS { + constructor({ baseFs = new NodeFS() } = {}) { + super(ppath); + this.baseFs = baseFs; + } + static makeVirtualPath(base, component, to) { + if (ppath.basename(base) !== `__virtual__`) + throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); + if (!ppath.basename(component).match(VALID_COMPONENT)) + throw new Error(`Assertion failed: Virtual components must be ended by an hexadecimal hash`); + const target = ppath.relative(ppath.dirname(base), to); + const segments = target.split(`/`); + let depth = 0; + while (depth < segments.length && segments[depth] === `..`) + depth += 1; + const finalSegments = segments.slice(depth); + const fullVirtualPath = ppath.join(base, component, String(depth), ...finalSegments); + return fullVirtualPath; + } + static resolveVirtual(p) { + const match = p.match(VIRTUAL_REGEXP); + if (!match || !match[3] && match[5]) + return p; + const target = ppath.dirname(match[1]); + if (!match[3] || !match[4]) + return target; + const isnum = NUMBER_REGEXP.test(match[4]); + if (!isnum) + return p; + const depth = Number(match[4]); + const backstep = `../`.repeat(depth); + const subpath = match[5] || `.`; + return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); + } + getExtractHint(hints) { + return this.baseFs.getExtractHint(hints); + } + getRealPath() { + return this.baseFs.getRealPath(); + } + realpathSync(p) { + const match = p.match(VIRTUAL_REGEXP); + if (!match) + return this.baseFs.realpathSync(p); + if (!match[5]) + return p; + const realpath = this.baseFs.realpathSync(this.mapToBase(p)); + return VirtualFS.makeVirtualPath(match[1], match[3], realpath); + } + async realpathPromise(p) { + const match = p.match(VIRTUAL_REGEXP); + if (!match) + return await this.baseFs.realpathPromise(p); + if (!match[5]) + return p; + const realpath = await this.baseFs.realpathPromise(this.mapToBase(p)); + return VirtualFS.makeVirtualPath(match[1], match[3], realpath); + } + mapToBase(p) { + if (p === ``) + return p; + if (this.pathUtils.isAbsolute(p)) + return VirtualFS.resolveVirtual(p); + const resolvedRoot = VirtualFS.resolveVirtual(this.baseFs.resolve(PortablePath.dot)); + const resolvedP = VirtualFS.resolveVirtual(this.baseFs.resolve(p)); + return ppath.relative(resolvedRoot, resolvedP) || PortablePath.dot; + } + mapFromBase(p) { + return p; + } +} + +class NodePathFS extends ProxiedFS { + constructor(baseFs) { + super(npath); + this.baseFs = baseFs; + } + mapFromBase(path) { + return path; + } + mapToBase(path) { + if (typeof path === `string`) + return path; + if (path instanceof url.URL) + return url.fileURLToPath(path); + if (Buffer.isBuffer(path)) { + const str = path.toString(); + if (Buffer.byteLength(str) !== path.byteLength) + throw new Error(`Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942`); + return str; + } + throw new Error(`Unsupported path type: ${nodeUtils.inspect(path)}`); + } +} + +var _a, _b, _c, _d; +const kBaseFs = Symbol(`kBaseFs`); +const kFd = Symbol(`kFd`); +const kClosePromise = Symbol(`kClosePromise`); +const kCloseResolve = Symbol(`kCloseResolve`); +const kCloseReject = Symbol(`kCloseReject`); +const kRefs = Symbol(`kRefs`); +const kRef = Symbol(`kRef`); +const kUnref = Symbol(`kUnref`); +class FileHandle { + constructor(fd, baseFs) { + this[_a] = 1; + this[_b] = void 0; + this[_c] = void 0; + this[_d] = void 0; + this[kBaseFs] = baseFs; + this[kFd] = fd; + } + get fd() { + return this[kFd]; + } + async appendFile(data, options) { + try { + this[kRef](this.appendFile); + const encoding = (typeof options === `string` ? options : options == null ? void 0 : options.encoding) ?? void 0; + return await this[kBaseFs].appendFilePromise(this.fd, data, encoding ? { encoding } : void 0); + } finally { + this[kUnref](); + } + } + async chown(uid, gid) { + try { + this[kRef](this.chown); + return await this[kBaseFs].fchownPromise(this.fd, uid, gid); + } finally { + this[kUnref](); + } + } + async chmod(mode) { + try { + this[kRef](this.chmod); + return await this[kBaseFs].fchmodPromise(this.fd, mode); + } finally { + this[kUnref](); + } + } + createReadStream(options) { + return this[kBaseFs].createReadStream(null, { ...options, fd: this.fd }); + } + createWriteStream(options) { + return this[kBaseFs].createWriteStream(null, { ...options, fd: this.fd }); + } + datasync() { + throw new Error(`Method not implemented.`); + } + sync() { + throw new Error(`Method not implemented.`); + } + async read(bufferOrOptions, offset, length, position) { + try { + this[kRef](this.read); + let buffer; + if (!Buffer.isBuffer(bufferOrOptions)) { + bufferOrOptions ?? (bufferOrOptions = {}); + buffer = bufferOrOptions.buffer ?? Buffer.alloc(16384); + offset = bufferOrOptions.offset || 0; + length = bufferOrOptions.length ?? buffer.byteLength; + position = bufferOrOptions.position ?? null; + } else { + buffer = bufferOrOptions; + } + offset ?? (offset = 0); + length ?? (length = 0); + if (length === 0) { + return { + bytesRead: length, + buffer + }; + } + const bytesRead = await this[kBaseFs].readPromise(this.fd, buffer, offset, length, position); + return { + bytesRead, + buffer + }; + } finally { + this[kUnref](); + } + } + async readFile(options) { + try { + this[kRef](this.readFile); + const encoding = (typeof options === `string` ? options : options == null ? void 0 : options.encoding) ?? void 0; + return await this[kBaseFs].readFilePromise(this.fd, encoding); + } finally { + this[kUnref](); + } + } + readLines(options) { + return readline.createInterface({ + input: this.createReadStream(options), + crlfDelay: Infinity + }); + } + async stat(opts) { + try { + this[kRef](this.stat); + return await this[kBaseFs].fstatPromise(this.fd, opts); + } finally { + this[kUnref](); + } + } + async truncate(len) { + try { + this[kRef](this.truncate); + return await this[kBaseFs].ftruncatePromise(this.fd, len); + } finally { + this[kUnref](); + } + } + utimes(atime, mtime) { + throw new Error(`Method not implemented.`); + } + async writeFile(data, options) { + try { + this[kRef](this.writeFile); + const encoding = (typeof options === `string` ? options : options == null ? void 0 : options.encoding) ?? void 0; + await this[kBaseFs].writeFilePromise(this.fd, data, encoding); + } finally { + this[kUnref](); + } + } + async write(...args) { + try { + this[kRef](this.write); + if (ArrayBuffer.isView(args[0])) { + const [buffer, offset, length, position] = args; + const bytesWritten = await this[kBaseFs].writePromise(this.fd, buffer, offset ?? void 0, length ?? void 0, position ?? void 0); + return { bytesWritten, buffer }; + } else { + const [data, position, encoding] = args; + const bytesWritten = await this[kBaseFs].writePromise(this.fd, data, position, encoding); + return { bytesWritten, buffer: data }; + } + } finally { + this[kUnref](); + } + } + async writev(buffers, position) { + try { + this[kRef](this.writev); + let bytesWritten = 0; + if (typeof position !== `undefined`) { + for (const buffer of buffers) { + const writeResult = await this.write(buffer, void 0, void 0, position); + bytesWritten += writeResult.bytesWritten; + position += writeResult.bytesWritten; + } + } else { + for (const buffer of buffers) { + const writeResult = await this.write(buffer); + bytesWritten += writeResult.bytesWritten; + } + } + return { + buffers, + bytesWritten + }; + } finally { + this[kUnref](); + } + } + readv(buffers, position) { + throw new Error(`Method not implemented.`); + } + close() { + if (this[kFd] === -1) + return Promise.resolve(); + if (this[kClosePromise]) + return this[kClosePromise]; + this[kRefs]--; + if (this[kRefs] === 0) { + const fd = this[kFd]; + this[kFd] = -1; + this[kClosePromise] = this[kBaseFs].closePromise(fd).finally(() => { + this[kClosePromise] = void 0; + }); + } else { + this[kClosePromise] = new Promise((resolve, reject) => { + this[kCloseResolve] = resolve; + this[kCloseReject] = reject; + }).finally(() => { + this[kClosePromise] = void 0; + this[kCloseReject] = void 0; + this[kCloseResolve] = void 0; + }); + } + return this[kClosePromise]; + } + [(_a = kRefs, _b = kClosePromise, _c = kCloseResolve, _d = kCloseReject, kRef)](caller) { + if (this[kFd] === -1) { + const err = new Error(`file closed`); + err.code = `EBADF`; + err.syscall = caller.name; + throw err; + } + this[kRefs]++; + } + [kUnref]() { + this[kRefs]--; + if (this[kRefs] === 0) { + const fd = this[kFd]; + this[kFd] = -1; + this[kBaseFs].closePromise(fd).then(this[kCloseResolve], this[kCloseReject]); + } + } +} + +const SYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ + `accessSync`, + `appendFileSync`, + `createReadStream`, + `createWriteStream`, + `chmodSync`, + `fchmodSync`, + `chownSync`, + `fchownSync`, + `closeSync`, + `copyFileSync`, + `linkSync`, + `lstatSync`, + `fstatSync`, + `lutimesSync`, + `mkdirSync`, + `openSync`, + `opendirSync`, + `readlinkSync`, + `readFileSync`, + `readdirSync`, + `readlinkSync`, + `realpathSync`, + `renameSync`, + `rmdirSync`, + `statSync`, + `symlinkSync`, + `truncateSync`, + `ftruncateSync`, + `unlinkSync`, + `unwatchFile`, + `utimesSync`, + `watch`, + `watchFile`, + `writeFileSync`, + `writeSync` +]); +const ASYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ + `accessPromise`, + `appendFilePromise`, + `fchmodPromise`, + `chmodPromise`, + `fchownPromise`, + `chownPromise`, + `closePromise`, + `copyFilePromise`, + `linkPromise`, + `fstatPromise`, + `lstatPromise`, + `lutimesPromise`, + `mkdirPromise`, + `openPromise`, + `opendirPromise`, + `readdirPromise`, + `realpathPromise`, + `readFilePromise`, + `readdirPromise`, + `readlinkPromise`, + `renamePromise`, + `rmdirPromise`, + `statPromise`, + `symlinkPromise`, + `truncatePromise`, + `ftruncatePromise`, + `unlinkPromise`, + `utimesPromise`, + `writeFilePromise`, + `writeSync` +]); +function patchFs(patchedFs, fakeFs) { + fakeFs = new NodePathFS(fakeFs); + const setupFn = (target, name, replacement) => { + const orig = target[name]; + target[name] = replacement; + if (typeof (orig == null ? void 0 : orig[nodeUtils.promisify.custom]) !== `undefined`) { + replacement[nodeUtils.promisify.custom] = orig[nodeUtils.promisify.custom]; + } + }; + { + setupFn(patchedFs, `exists`, (p, ...args) => { + const hasCallback = typeof args[args.length - 1] === `function`; + const callback = hasCallback ? args.pop() : () => { + }; + process.nextTick(() => { + fakeFs.existsPromise(p).then((exists) => { + callback(exists); + }, () => { + callback(false); + }); + }); + }); + setupFn(patchedFs, `read`, (...args) => { + let [fd, buffer, offset, length, position, callback] = args; + if (args.length <= 3) { + let options = {}; + if (args.length < 3) { + callback = args[1]; + } else { + options = args[1]; + callback = args[2]; + } + ({ + buffer = Buffer.alloc(16384), + offset = 0, + length = buffer.byteLength, + position + } = options); + } + if (offset == null) + offset = 0; + length |= 0; + if (length === 0) { + process.nextTick(() => { + callback(null, 0, buffer); + }); + return; + } + if (position == null) + position = -1; + process.nextTick(() => { + fakeFs.readPromise(fd, buffer, offset, length, position).then((bytesRead) => { + callback(null, bytesRead, buffer); + }, (error) => { + callback(error, 0, buffer); + }); + }); + }); + for (const fnName of ASYNC_IMPLEMENTATIONS) { + const origName = fnName.replace(/Promise$/, ``); + if (typeof patchedFs[origName] === `undefined`) + continue; + const fakeImpl = fakeFs[fnName]; + if (typeof fakeImpl === `undefined`) + continue; + const wrapper = (...args) => { + const hasCallback = typeof args[args.length - 1] === `function`; + const callback = hasCallback ? args.pop() : () => { + }; + process.nextTick(() => { + fakeImpl.apply(fakeFs, args).then((result) => { + callback(null, result); + }, (error) => { + callback(error); + }); + }); + }; + setupFn(patchedFs, origName, wrapper); + } + patchedFs.realpath.native = patchedFs.realpath; + } + { + setupFn(patchedFs, `existsSync`, (p) => { + try { + return fakeFs.existsSync(p); + } catch (error) { + return false; + } + }); + setupFn(patchedFs, `readSync`, (...args) => { + let [fd, buffer, offset, length, position] = args; + if (args.length <= 3) { + const options = args[2] || {}; + ({ offset = 0, length = buffer.byteLength, position } = options); + } + if (offset == null) + offset = 0; + length |= 0; + if (length === 0) + return 0; + if (position == null) + position = -1; + return fakeFs.readSync(fd, buffer, offset, length, position); + }); + for (const fnName of SYNC_IMPLEMENTATIONS) { + const origName = fnName; + if (typeof patchedFs[origName] === `undefined`) + continue; + const fakeImpl = fakeFs[fnName]; + if (typeof fakeImpl === `undefined`) + continue; + setupFn(patchedFs, origName, fakeImpl.bind(fakeFs)); + } + patchedFs.realpathSync.native = patchedFs.realpathSync; + } + { + const patchedFsPromises = patchedFs.promises; + for (const fnName of ASYNC_IMPLEMENTATIONS) { + const origName = fnName.replace(/Promise$/, ``); + if (typeof patchedFsPromises[origName] === `undefined`) + continue; + const fakeImpl = fakeFs[fnName]; + if (typeof fakeImpl === `undefined`) + continue; + if (fnName === `open`) + continue; + setupFn(patchedFsPromises, origName, (pathLike, ...args) => { + if (pathLike instanceof FileHandle) { + return pathLike[origName].apply(pathLike, args); + } else { + return fakeImpl.call(fakeFs, pathLike, ...args); + } + }); + } + setupFn(patchedFsPromises, `open`, async (...args) => { + const fd = await fakeFs.openPromise(...args); + return new FileHandle(fd, fakeFs); + }); + } + { + patchedFs.read[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { + const res = fakeFs.readPromise(fd, buffer, ...args); + return { bytesRead: await res, buffer }; + }; + patchedFs.write[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { + const res = fakeFs.writePromise(fd, buffer, ...args); + return { bytesWritten: await res, buffer }; + }; + } +} + +let cachedInstance; +let registeredFactory = () => { + throw new Error(`Assertion failed: No libzip instance is available, and no factory was configured`); +}; +function setFactory(factory) { + registeredFactory = factory; +} +function getInstance() { + if (typeof cachedInstance === `undefined`) + cachedInstance = registeredFactory(); + return cachedInstance; +} + +var libzipSync = {exports: {}}; + +(function (module, exports) { +var frozenFs = Object.assign({}, fs__default.default); +var createModule = function() { + var _scriptDir = void 0; + if (typeof __filename !== "undefined") + _scriptDir = _scriptDir || __filename; + return function(createModule2) { + createModule2 = createModule2 || {}; + var Module = typeof createModule2 !== "undefined" ? createModule2 : {}; + var readyPromiseResolve, readyPromiseReject; + Module["ready"] = new Promise(function(resolve, reject) { + readyPromiseResolve = resolve; + readyPromiseReject = reject; + }); + var moduleOverrides = {}; + var key; + for (key in Module) { + if (Module.hasOwnProperty(key)) { + moduleOverrides[key] = Module[key]; + } + } + var scriptDirectory = ""; + function locateFile(path) { + if (Module["locateFile"]) { + return Module["locateFile"](path, scriptDirectory); + } + return scriptDirectory + path; + } + var read_, readBinary; + var nodeFS; + var nodePath; + { + { + scriptDirectory = __dirname + "/"; + } + read_ = function shell_read(filename, binary) { + var ret = tryParseAsDataURI(filename); + if (ret) { + return binary ? ret : ret.toString(); + } + if (!nodeFS) + nodeFS = frozenFs; + if (!nodePath) + nodePath = path__default.default; + filename = nodePath["normalize"](filename); + return nodeFS["readFileSync"](filename, binary ? null : "utf8"); + }; + readBinary = function readBinary2(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret); + } + assert(ret.buffer); + return ret; + }; + if (process["argv"].length > 1) { + process["argv"][1].replace(/\\/g, "/"); + } + process["argv"].slice(2); + Module["inspect"] = function() { + return "[Emscripten Module object]"; + }; + } + Module["print"] || console.log.bind(console); + var err = Module["printErr"] || console.warn.bind(console); + for (key in moduleOverrides) { + if (moduleOverrides.hasOwnProperty(key)) { + Module[key] = moduleOverrides[key]; + } + } + moduleOverrides = null; + if (Module["arguments"]) + ; + if (Module["thisProgram"]) + ; + if (Module["quit"]) + ; + var wasmBinary; + if (Module["wasmBinary"]) + wasmBinary = Module["wasmBinary"]; + Module["noExitRuntime"] || true; + if (typeof WebAssembly !== "object") { + abort("no native wasm support detected"); + } + function getValue(ptr, type, noSafe) { + type = type || "i8"; + if (type.charAt(type.length - 1) === "*") + type = "i32"; + switch (type) { + case "i1": + return HEAP8[ptr >> 0]; + case "i8": + return HEAP8[ptr >> 0]; + case "i16": + return LE_HEAP_LOAD_I16((ptr >> 1) * 2); + case "i32": + return LE_HEAP_LOAD_I32((ptr >> 2) * 4); + case "i64": + return LE_HEAP_LOAD_I32((ptr >> 2) * 4); + case "float": + return LE_HEAP_LOAD_F32((ptr >> 2) * 4); + case "double": + return LE_HEAP_LOAD_F64((ptr >> 3) * 8); + default: + abort("invalid type for getValue: " + type); + } + return null; + } + var wasmMemory; + var ABORT = false; + function assert(condition, text) { + if (!condition) { + abort("Assertion failed: " + text); + } + } + function getCFunc(ident) { + var func = Module["_" + ident]; + assert( + func, + "Cannot call unknown function " + ident + ", make sure it is exported" + ); + return func; + } + function ccall(ident, returnType, argTypes, args, opts) { + var toC = { + string: function(str) { + var ret2 = 0; + if (str !== null && str !== void 0 && str !== 0) { + var len = (str.length << 2) + 1; + ret2 = stackAlloc(len); + stringToUTF8(str, ret2, len); + } + return ret2; + }, + array: function(arr) { + var ret2 = stackAlloc(arr.length); + writeArrayToMemory(arr, ret2); + return ret2; + } + }; + function convertReturnValue(ret2) { + if (returnType === "string") + return UTF8ToString(ret2); + if (returnType === "boolean") + return Boolean(ret2); + return ret2; + } + var func = getCFunc(ident); + var cArgs = []; + var stack = 0; + if (args) { + for (var i = 0; i < args.length; i++) { + var converter = toC[argTypes[i]]; + if (converter) { + if (stack === 0) + stack = stackSave(); + cArgs[i] = converter(args[i]); + } else { + cArgs[i] = args[i]; + } + } + } + var ret = func.apply(null, cArgs); + ret = convertReturnValue(ret); + if (stack !== 0) + stackRestore(stack); + return ret; + } + function cwrap(ident, returnType, argTypes, opts) { + argTypes = argTypes || []; + var numericArgs = argTypes.every(function(type) { + return type === "number"; + }); + var numericRet = returnType !== "string"; + if (numericRet && numericArgs && !opts) { + return getCFunc(ident); + } + return function() { + return ccall(ident, returnType, argTypes, arguments); + }; + } + var UTF8Decoder = new TextDecoder("utf8"); + function UTF8ToString(ptr, maxBytesToRead) { + if (!ptr) + return ""; + var maxPtr = ptr + maxBytesToRead; + for (var end = ptr; !(end >= maxPtr) && HEAPU8[end]; ) + ++end; + return UTF8Decoder.decode(HEAPU8.subarray(ptr, end)); + } + function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { + if (!(maxBytesToWrite > 0)) + return 0; + var startIdx = outIdx; + var endIdx = outIdx + maxBytesToWrite - 1; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) { + var u1 = str.charCodeAt(++i); + u = 65536 + ((u & 1023) << 10) | u1 & 1023; + } + if (u <= 127) { + if (outIdx >= endIdx) + break; + heap[outIdx++] = u; + } else if (u <= 2047) { + if (outIdx + 1 >= endIdx) + break; + heap[outIdx++] = 192 | u >> 6; + heap[outIdx++] = 128 | u & 63; + } else if (u <= 65535) { + if (outIdx + 2 >= endIdx) + break; + heap[outIdx++] = 224 | u >> 12; + heap[outIdx++] = 128 | u >> 6 & 63; + heap[outIdx++] = 128 | u & 63; + } else { + if (outIdx + 3 >= endIdx) + break; + heap[outIdx++] = 240 | u >> 18; + heap[outIdx++] = 128 | u >> 12 & 63; + heap[outIdx++] = 128 | u >> 6 & 63; + heap[outIdx++] = 128 | u & 63; + } + } + heap[outIdx] = 0; + return outIdx - startIdx; + } + function stringToUTF8(str, outPtr, maxBytesToWrite) { + return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); + } + function lengthBytesUTF8(str) { + var len = 0; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) + u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; + if (u <= 127) + ++len; + else if (u <= 2047) + len += 2; + else if (u <= 65535) + len += 3; + else + len += 4; + } + return len; + } + function allocateUTF8(str) { + var size = lengthBytesUTF8(str) + 1; + var ret = _malloc(size); + if (ret) + stringToUTF8Array(str, HEAP8, ret, size); + return ret; + } + function writeArrayToMemory(array, buffer2) { + HEAP8.set(array, buffer2); + } + function alignUp(x, multiple) { + if (x % multiple > 0) { + x += multiple - x % multiple; + } + return x; + } + var buffer, HEAP8, HEAPU8; + var HEAP_DATA_VIEW; + function updateGlobalBufferAndViews(buf) { + buffer = buf; + Module["HEAP_DATA_VIEW"] = HEAP_DATA_VIEW = new DataView(buf); + Module["HEAP8"] = HEAP8 = new Int8Array(buf); + Module["HEAP16"] = new Int16Array(buf); + Module["HEAP32"] = new Int32Array(buf); + Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); + Module["HEAPU16"] = new Uint16Array(buf); + Module["HEAPU32"] = new Uint32Array(buf); + Module["HEAPF32"] = new Float32Array(buf); + Module["HEAPF64"] = new Float64Array(buf); + } + Module["INITIAL_MEMORY"] || 16777216; + var wasmTable; + var __ATPRERUN__ = []; + var __ATINIT__ = []; + var __ATPOSTRUN__ = []; + function preRun() { + if (Module["preRun"]) { + if (typeof Module["preRun"] == "function") + Module["preRun"] = [Module["preRun"]]; + while (Module["preRun"].length) { + addOnPreRun(Module["preRun"].shift()); + } + } + callRuntimeCallbacks(__ATPRERUN__); + } + function initRuntime() { + callRuntimeCallbacks(__ATINIT__); + } + function postRun() { + if (Module["postRun"]) { + if (typeof Module["postRun"] == "function") + Module["postRun"] = [Module["postRun"]]; + while (Module["postRun"].length) { + addOnPostRun(Module["postRun"].shift()); + } + } + callRuntimeCallbacks(__ATPOSTRUN__); + } + function addOnPreRun(cb) { + __ATPRERUN__.unshift(cb); + } + function addOnInit(cb) { + __ATINIT__.unshift(cb); + } + function addOnPostRun(cb) { + __ATPOSTRUN__.unshift(cb); + } + var runDependencies = 0; + var dependenciesFulfilled = null; + function addRunDependency(id) { + runDependencies++; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies); + } + } + function removeRunDependency(id) { + runDependencies--; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies); + } + if (runDependencies == 0) { + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback(); + } + } + } + Module["preloadedImages"] = {}; + Module["preloadedAudios"] = {}; + function abort(what) { + if (Module["onAbort"]) { + Module["onAbort"](what); + } + what += ""; + err(what); + ABORT = true; + what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; + var e = new WebAssembly.RuntimeError(what); + readyPromiseReject(e); + throw e; + } + var dataURIPrefix = "data:application/octet-stream;base64,"; + function isDataURI(filename) { + return filename.startsWith(dataURIPrefix); + } + var wasmBinaryFile = "data:application/octet-stream;base64,AGFzbQEAAAAB/wEkYAN/f38Bf2ACf38Bf2ABfwF/YAN/f34Bf2ABfwBgBH9/f38Bf2ACf38AYAN/f38AYAV/f39/fwF/YAABf2AFf39/fn8BfmAEf35/fwF/YAR/f35/AX5gAn9+AX9gA398fwBgAX8BfmAGf39/f39/AX9gBH9/f38AYAN/fn8Bf2ADf39/AX5gBH9/f38BfmAFf39+f38Bf2AEf39+fwF/YAN/f34BfmACf34AYAJ/fwF+YAV/f39/fwBgA39+fwF+YAV+fn9+fwF+YAZ/fH9/f38Bf2AAAGAHf35/f39+fwF/YAV/fn9/fwF/YAV/f39/fwF+YAJ+fwF/YAJ/fAACJQYBYQFhAAQBYQFiAAIBYQFjAAABYQFkAAIBYQFlAAEBYQFmAAID5AHiAQQEAgAEAgQGDBEEFwYNBBICBA0YBwIDBA8PBAECARkFCxoCBAQCBwsHBAECDwEGBQQAAQsEBgARBgYHBBsFBBwICAABEwIIBBQTFRAWCwsGAB4ABQAAAQYCBAMfAgEBAQIBCBYgACEAIgABAggBBgINCxQNBwIHAQAjBAALFQAACAsSAgcHBAQHAQEBBQkJAQEBAQIKBAICAgICCQgCCAgIAAUBBQUFCBAFBQAAEAAAAgQJCQUCAgAJCQkCAgIBCgoABgAEAwICAgQACggMAgYAAgEBAwUAAAUCAAkABAEHCQIEBQFwATQ0BQc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FQYSgASgCACIDQQFrIgAgAXEEQCACIAFrIAAgAWpBACADa3FqIQULIAUgCE0NBiAFQf7///8HSw0GQeCfASgCACIEBEBB2J8BKAIAIgMgBWoiACADTQ0HIAAgBEsNBwsgBRAoIgAgAUcNAQwICyAFIAZrIAdxIgVB/v///wdLDQUgBRAoIgEgACgCACAAKAIEakYNBCABIQALAkAgAEF/Rg0AIAhBMGogBU0NAEGIoAEoAgAiASAJIAVrakEAIAFrcSIBQf7///8HSwRAIAAhAQwICyABEChBf0cEQCABIAVqIQUgACEBDAgLQQAgBWsQKBoMBQsgACIBQX9HDQYMBAsAC0EAIQQMBwtBACEBDAULIAFBf0cNAgtB5J8BQeSfASgCAEEEcjYCAAsgAkH+////B0sNASACECghAUEAECghACABQX9GDQEgAEF/Rg0BIAAgAU0NASAAIAFrIgUgCEEoak0NAQtB2J8BQdifASgCACAFaiIANgIAQdyfASgCACAASQRAQdyfASAANgIACwJAAkACQEHAnAEoAgAiBwRAQeifASEAA0AgASAAKAIAIgMgACgCBCICakYNAiAAKAIIIgANAAsMAgtBuJwBKAIAIgBBACAAIAFNG0UEQEG4nAEgATYCAAtBACEAQeyfASAFNgIAQeifASABNgIAQcicAUF/NgIAQcycAUGAoAEoAgA2AgBB9J8BQQA2AgADQCAAQQN0IgNB2JwBaiADQdCcAWoiAjYCACADQdycAWogAjYCACAAQQFqIgBBIEcNAAtBtJwBIAVBKGsiA0F4IAFrQQdxQQAgAUEIakEHcRsiAGsiAjYCAEHAnAEgACABaiIANgIAIAAgAkEBcjYCBCABIANqQSg2AgRBxJwBQZCgASgCADYCAAwCCyAALQAMQQhxDQAgAyAHSw0AIAEgB00NACAAIAIgBWo2AgRBwJwBIAdBeCAHa0EHcUEAIAdBCGpBB3EbIgBqIgI2AgBBtJwBQbScASgCACAFaiIBIABrIgA2AgAgAiAAQQFyNgIEIAEgB2pBKDYCBEHEnAFBkKABKAIANgIADAELQbicASgCACABSwRAQbicASABNgIACyABIAVqIQJB6J8BIQACQA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CQAJAAkAgAEUEQCABpxAIIgNFDQJBGBAIIgJFDQEMAwsgACEDQRgQCCICDQJBAA8LIAMQBgtBAA8LIAJCADcDECACIAE3AwggAiADNgIEIAJBAToAACACIABFOgABIAILnQECAn4BfwJAAkAgAC0AAEUNACAAKQMQIgJCd1YNACACQgh8IgMgACkDCFgNAQsgAEEAOgAADwsgACgCBCIERQRADwsgACADNwMQIAQgAqdqIgAgAUI4iDwAByAAIAFCMIg8AAYgACABQiiIPAAFIAAgAUIgiDwABCAAIAFCGIg8AAMgACABQhCIPAACIAAgAUIIiDwAASAAIAE8AAAL8AICAn8BfgJAIAJFDQAgACACaiIDQQFrIAE6AAAgACABOgAAIAJBA0kNACADQQJrIAE6AAAgACABOgABIANBA2sgAToAACAAIAE6AAIgAkEHSQ0AIANBBGsgAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgA2AgAgAyACIARrQXxxIgJqIgFBBGsgADYCACACQQlJDQAgAyAANgIIIAMgADYCBCABQQhrIAA2AgAgAUEMayAANgIAIAJBGUkNACADIAA2AhggAyAANgIUIAMgADYCECADIAA2AgwgAUEQayAANgIAIAFBFGsgADYCACABQRhrIAA2AgAgAUEcayAANgIAIAIgA0EEcUEYciIBayICQSBJDQAgAK1CgYCAgBB+IQUgASADaiEBA0AgASAFNwMYIAEgBTcDECABIAU3AwggASAFNwMAIAFBIGohASACQSBrIgJBH0sNAAsLC28BA38gAEEMaiECAkACfyAAKAIgIgFFBEBBfyEBQRIMAQsgACABQQFrIgM2AiBBACEBIAMNASAAQQBCAEECEA4aIAAoAgAiAEUNASAAEBtBf0oNAUEUCyEAIAIEQCACQQA2AgQgAiAANgIACwsgAQufAQIBfwF+An8CQAJ+IAAoAgAiAygCJEEBRkEAIAJCf1UbRQRAIANBDGoiAQRAIAFBADYCBCABQRI2AgALQn8MAQsgAyABIAJBCxAOCyIEQn9XBEAgACgCACEBIABBCGoiAARAIAAgASgCDDYCACAAIAEo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ACfyAAKAI8IAAoAmRqIgEgA0sEQCAAKAJIIAFqQQAgAiABayIDQYICIANBggJJGyIDEBogASADagwBCyABQYICaiIBIANNDQEgACgCSCADakEAIAIgA2siAiABIANrIgMgAiADSRsiAxAaIAAoAkAgA2oLNgJACws3ACAAQn83AxAgAEEANgIIIABCADcDACAAQQA2AjAgAEL/////DzcDKCAAQgA3AxggAEIANwMgC6UBAQF/QdgAEAgiAUUEQEEADwsCQCAABEAgASAAQdgAEAkaDAELIAFCADcDICABQQA2AhggAUL/////DzcDECABQQA7AQwgAUG/hig2AgggAUEBOgAGIAFBADoABCABQgA3A0ggAUGAgNiNeDYCRCABQgA3AyggAUIANwMwIAFCADcDOCABQUBrQQA7AQAgAUIANwNQCyABQQE6AAUgAUEANgIAIAELWAICfgF/AkACQCAALQAARQ0AIAApAxAiAyACrXwiBCADVA0AIAQgACkDCFgNAQsgAEEAOgAADwsgACgCBCIFRQRADwsgACAENwMQIAUgA6dqIAEgAhAJGguWAQECfwJAAkAgAkUEQCABpxAIIgVFDQFBGBAIIgQNAiAFEAYMAQsgAiEFQRgQCCIEDQELIAMEQCADQQA2AgQgA0EONgIAC0EADwsgBEIANwMQIAQgATcDCCAEIAU2AgQgBEEBOgAAIAQgAkU6AAEgACAFIAEgAxBpQQBIBH8gBC0AAQRAIAQoAgQQBgsgBBAGQQAFIAQLC5sCAQN/IAAtAABBIHFFBEACQCABIQMCQCACIAAiASgCECIABH8gAAUCfyABIAEtAEoiAEEBayAAcjoASiABKAIAIgBBCHEEQCABIABBIHI2AgBBfwwBCyABQgA3AgQgASABKAIsIgA2AhwgASAANgIUIAEgACABKAIwajYCEEEACw0BIAEoAhALIAEoAhQiBWtLBEAgASADIAIgASgCJBEAABoMAgsCfyABLABLQX9KBEAgAiEAA0AgAiAAIgRFDQIaIAMgBEEBayIAai0AAEEKRw0ACyABIAMgBCABKAIkEQAAIARJDQIgAyAEaiEDIAEoAhQhBSACIARrDAELIAILIQAgBSADIAAQCRogASABKAIUI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LC7AJAgV/AX4gACABayEDAkACQCACQQdNBEAgAkUNASAAIAMtAAA6AAAgAkEBRw0CIABBAWoPCwJAAn8CQAJAAkACQCABQQFrDggDAgIAAgICAQILIAMoAAAMAwsgAykAACIIQiCIpyEEIAinIQEMAwsgAUEHTQRAIAAgAmpBAWshByABIAJJBEAgA0EEaiEGA0AgByAAa0EBaiIEIAEgASAESxsiBUEITwRAA0AgACADKQAANwAAIANBCGohAyAAQQhqIQAMAAsACyAFQQRJBH8gAwUgACADKAAANgAAIAVBBGshBSAAQQRqIQAgBgshBCAFQQJPBEAgACAELwAAOwAAIAVBAmshBSAEQQJqIQQgAEECaiEACyAFQQFGBEAgACAELQAAOgAAIABBAWohAAsgAiABayICIAFLDQALIAJFDQULAkAgByAAa0EBaiIBIAIgASACSRsiAkEISQ0AIAJBCGsiBEEDdkEBakEHcSIBBEADQCAAIAMpAAA3AAAgAkEIayECIANBCGohAyAAQQhqIQAgAUEBayIBDQALCyAEQThJDQADQCAAIAMpAAA3AAAgACADKQAINwAIIAAgAykAEDcAECAAIAMpABg3ABggACADKQAgNwAgIAAgAykAKDcAKCAAIAMpADA3ADAgACADKQA4NwA4IANBQGshAyAAQUBrIQAgAkFAaiICQQdLDQALCyACQQRPBEAgACADKAAANgAAIAJBBGshAiADQQRqIQMgAEEEaiEACyACQQJPBEAgACADLwAAOwAAIAJBAmshAiADQQJqIQMgAEECaiEACyACQQFHDQQgACADLQAAOgAAIABBAWoPCyAAIAMpAAA3AAAgACACQQFrIgFBB3FBAWoiAmohACABQQhJDQMgAiADaiEDIAFBA3YiAkEBayEEIAJBB3EiAQRAA0AgACADKQAANwAAIAJBAWshAiADQQhqIQMgAEEIaiEAIAFBAWsiAQ0ACwsgBEEHSQ0DA0AgACADKQAANwAAIAAgAykACDcACCAAIAMpABA3ABAgACADKQAYNwAYIAAgAykAIDcAICAAIAMpACg3ACggACADKQAwNwAwIAAgAykAODcAOCADQUBrIQMgAEFAayEAIAJBCGsiAg0ACwwDCyADLQAAQYGChAhsCyIBIQQLIAJBB3EhBgJAIAJBeHEiAkUNACABrSAErUIghoQhCCACQQhrIgRBA3ZBAWpBB3EiAQRAA0AgACAINwAAIAJBCGshAiAAQQhqIQAgAUEBayIBDQALCyAEQThJDQADQCAAIAg3ADggACAINwAwIAAgCDcAKCAAIAg3ACAgACAINwAYIAAgCDcAECAAIAg3AAggACAINwAAIABBQGshACACQUBqIgINAAsLIAZFDQAgACADIAYQCSAGaiEACyAADwsgACADLQABOgABIAJBAkYEQCAAQQJqDwsgACADLQACOgACIAJBA0YEQCAAQQNqDwsgACADLQADOgADIAJBBEYEQCAAQQRqDwsgACADLQAEOgAEIAJBBUYEQCAAQQVqDwsgACADLQAFOgAFIAJBBkYEQCAAQQZqDwsgACADLQAGOgAGIABBB2oLAwABC2wBA38CQCABKAIAIgNBB0sNACADIAIoAgBPDQAgACADayEEA0AgACAEKQAANwAAIAIgAigCACABKAIAIgVrNgIAIAEgASgCAEEBdCIDNgIAIAAgBWohACADQQdLDQEgAyACKAIASQ0ACwsgAAu8AgEBfwJAIAMgAGtBAWoiAyACIAIgA0sbIgJBCEkNACACQQhrIgRBA3ZBAWpBB3EiAwRAA0AgACABKQAANwAAIAJBCGshAiABQQhqIQEgAEEIaiEAIANBAWsiAw0ACwsgBEE4SQ0AA0AgACABKQAANwAAIAAgASkACDcACCAAIAEpABA3ABAgACABKQAYNwAYIAAgASkAIDcAICAAIAEpACg3ACggACABKQAwNwAwIAAgASkAODcAOCABQUBrIQEgAEFAayEAIAJBQGoiAkEHSw0ACwsgAkEETwRAIAAgASgAADYAACACQQRrIQIgAUEEaiEBIABBBGohAAsgAkECTwRAIAAgAS8AADsAACACQQJrIQIgAUECaiEBIABBAmohAAsgAkEBRgR/IAAgAS0AADoAACAAQQFqBSAACwvnAQECfyAAIAEpAAA3AAAgACACQQFrIgJBB3FBAWoiA2ohAAJAIAJBCEkNACABIANqIQEgAkEDdiICQQFrIQQgAkEHcSIDBEADQCAAIAEpAAA3AA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IAMQBwsgBEEQaiQAIAYL4AECAn8BfkEwEAgiAkUEQCABBEAgAUEANgIEIAFBDjYCAAtBAA8LIAJCADcDCCACQQA2AgAgAkIANwMQIAJCADcDGCACQgA3AyAgAkIANwAlIABQBEAgAg8LAkAgAEL/////AFYNACAAp0EEdBAIIgNFDQAgAiADNgIAQQAhAUIBIQQDQCADIAFBBHRqIgFCADcCACABQgA3AAUgACAEUgRAIASnIQEgBEIBfCEEDAELCyACIAA3AwggAiAANwMQIAIPCyABBEAgAUEANgIEIAFBDjYCAAtBABAQIAIQBkEAC+4BAgN/AX4jAEEQayIEJAACQCAEQQxqQgQQGCIDRQRAQX8hAgwBCwJAIAEEQCACQYAGcSEFA0ACQCAFIAEoAgRxRQ0AAkAgAykDCEIAVARAIANBADoAAAwBCyADQgA3AxAgA0EBOgAACyADIAEvAQgQDSADIAEvAQoQDSADLQAARQRAIABBCGoiAARAIABBADYCBCAAQRQ2AgALQX8hAgwEC0F/IQIgACAEQQxqQgQQHEEASA0DIAEzAQoiBlANACAAIAEoAgwgBhAcQQBIDQMLIAEoAgAiAQ0ACwtBACECCyADEAcLIARBEGokACACCzwBAX8gAARAIAFBgAZxIQEDQCABIAAoAgRxBEAgAiAALwEKakEEaiECCyAAKAIAIgANAAsLIAJB//8DcQucAQEDfyAARQRAQQAPCyAAIQMDQAJ/AkACQCAALwEIIgFB9OABTQRAIAFBAUYNASABQfXGAUYNAQwCCyABQYGyAkYNACABQfXgAUcNAQsgACgCACEBIABBADYCACAAKAIMEAYgABAGIAEgAyAAIANGGyEDAkAgAkUEQEEAIQIMAQsgAiABNgIACyABDAELIAAiAigCAAsiAA0ACyADC7IEAgV/AX4CQAJAAkAgACABrRAYIgEEQCABLQAADQFBACEADAILIAQEQCAEQQA2AgQgBEEONgIAC0EADwtBACEAA0AgAS0AAAR+IAEpAwggASkDEH0FQgALQgRUDQEgARALIQcgASABEAsiBq0QEyIIRQRAQQAhAiAEBEAgBEEANgIEIARBFTYCAAsgARAHIABFDQMDQCAAKAIAIQEgACgCDBAGIAAQBiABIgANAAsMAwsCQAJAQRAQCCIFBEAgBSAGOwEKIAUgBzsBCCAFIAI2AgQgBUEANgIAIAZFDQEgBSAIIAYQZyIGNgIMIAYNAiAFEAYLQQAhAiAEBEAgBEEANgIEIARBDjYCAAsgARAHIABFDQQDQCAAKAIAIQEgACgCDBAGIAAQBiABIgANAAsMBAsgBUEANgIMCwJAIABFBEAgBSEADAELIAkgBTYCAAsgBSEJIAEtAAANAAsLAkAgAS0AAAR/IAEpAxAgASkDCFEFQQALDQAgASABLQAABH4gASkDCCABKQMQfQVCAAsiCkL/////D4MQEyECAkAgCqciBUEDSw0AIAJFDQAgAkHBFCAFEDxFDQELQQAhAiAEBEAgBEEANgIEIARBFTYCAAsgARAHIABFDQEDQCAAKAIAIQEgACgCDBAGIAAQBiABIgANAAsMAQsgARAHIAMEQCADIAA2AgBBAQ8LQQEhAiAARQ0AA0AgACgCACEBIAAoAgwQBiAAEAYgASIADQALCyACC74BAQV/IAAEfyAAIQIDQCACIgQoAgAiAg0ACyABBEADQCABIgMvAQghBiADKAIAIQEgACECAkACQANAAkAgAi8BCCAGRw0AIAIvAQoiBSADLwEKRw0AIAVFDQIgAigCDCADKAIMIAUQPEUNAgsgAigCACICDQALIANBADYCACAEIAM2AgAgAyEEDAELIAIgAigCBCADKAIEQYAGcXI2AgQgA0EANgIAIAMoAgwQBiADEAYLIAENAAsLIAAFIAELC1UCAn4BfwJAAkAgAC0AAEUNACAAKQMQIgJCAXwiAyACVA0AIAMgACkDCFgNAQsgAEEAOgAADwsgACgCBCIERQRADwsgACADNwMQIAQgAqdqIAE6AAALWgICfgF/An8CQAJAIAAtAABFDQAgACkDECIBQgF8IgIgAVQNACACIAApAwhYDQELIABBADoAAEEADAELQQAgACgCBCIDRQ0AGiAAIAI3AxAgAyABp2otAAALC94BAQN/IAEgACkDMFoEQCAAQQhqBEAgAEEANgIMIABBEjYCCAtBfw8LIABBCGohAiAALQAYQQJxBEAg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E3AwAgACACQhBBDBAOQj+HpwshACACQRBqJAAgAAvaAwEGfyMAQRBrIgUkACAFIAI2AgwjAEGgAWsiBCQAIARBCGpBwIgBQZABEAkaIAQgADYCNCAEIAA2AhwgBEF+IABrIgNB/////wcgA0H/////B0kbIgY2AjggBCAAIAZqIgA2AiQgBCAANgIYIARBCGohACMAQdABayIDJAAgAyACNgLMASADQaABakEAQSgQGiADIAMoAswBNgLIAQJAQQAgASADQcgBaiADQdAAaiADQaABahBMQQBIDQAgACgCTEEATiEHIAAoAgAhAiAALABKQQBMBEAgACACQV9xNgIACyACQSBxIQgCfyAAKAIwBEAgACABIANByAFqIANB0ABqIANBoAFqEEwMAQsgAEHQADYCMCAAIANB0ABqNgIQIAAgAzYCHCAAIAM2AhQgACgCLCECIAAgAzYCLCAAIAEgA0HIAWogA0HQAGogA0GgAWoQTCACRQ0AGiAAQQBBACAAKAIkEQAAGiAAQQA2AjAgACACNgIsIABBADYCHCAAQQA2AhAgACgCFBogAEEANgIUQQALGiAAIAAoAgAgCHI2AgAgB0UNAAsgA0HQAWokACAGBEAgBCgCHCIAIAAgBCgCGEZrQQA6AAALIARBoAFqJAAgBUEQaiQAC1MBA38CQCAAKAIALAAAQTBrQQpPDQADQCAAKAIAIgIsAAAhAyAAIAJBAWo2AgAgASADakEwayEBIAIsAAFBMGtBCk8NASABQQpsIQEMAAsACyABC7sCAAJAIAFBFEsNAAJAAkACQAJAAkACQAJAAkACQAJAIAFBCWsOCgABAgMEBQYHCAkKCyACIAIoAgAiAUEEajYCACAAIAEoAgA2AgAPCyACIAIoAgAiAUEEajYCACAAIAE0AgA3AwAPCyACIAIoAgAiAUEEajYCACAAIAE1AgA3AwAPCyACIAIoAgBBB2pBeHEiAUEIajYCACAAIAEpAwA3AwAPCyACIAIoAgAiAUEEajYCACAAIAEyAQA3AwAPCyACIAIoAgAiAUEEajYCACAAIAEzAQA3AwAPCyACIAIoAgAiAUEEajYCACAAIAEwAAA3AwAPCyACIAIoAgAiAUEE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EBajYCECABIAAoAgRqIAApA7gtIgI8AAAgACAAKAIQIgFBAWo2AhAgASAAKAIEaiACQgiIPAAAIAAgACgCECIBQQFqNgIQIAEgACgCBGogAkIQiDwAACAAIAAoAhAiAUEBajYCECABIAAoAgRqIAJCGIg8AAAgACAAKAIQIgFBAWo2AhAgASAAKAIEaiACQiCIPAAAIAAgACgCECIBQQFqNgIQIAEgACgCBGogAkIoiDwAACAAIAAoAhAiAUEBajYCECABIAAoAgRqIAJCMIg8AAAgACAAKAIQIgFBAWo2AhAgASAAKAIEaiACQjiIPAAADAELIAFBGU4EQCAAIAAoAhAiAUEBajYCECABIAAoAgRqIAApA7gtIgI8AAAgACAAKAIQIgFBAWo2AhAgASAAKAIEaiACQgiIPAAAIAAgACgCECIBQQFqNgIQIAEgACgCBGogAkIQiDwAACAAIAAoAhAiAUEBajYCECABIAAoAgRqIAJCGIg8AAAgACAAQbwtajUCADcDuC0gACAAKALALUEgayIBNgLALQsgAUEJTgRAIAAgACgCECIBQQFqNgIQIAEgACgCBGogACkDuC0iAjwAACAAIAAoAhAiAUEBajYCECABIAAoAgRqIAJCCIg8AAAgACAAKQO4LUIQiDcDuC0gACAAKALALUEQayIBNgLALQsgAUEBSA0AIAAgACgCECIBQQFqNgIQIAEgACgCBGogACkDuC08AAALIABBADYCwC0gAEIANwO4LQvwBAEDfyAAQYgBaiECA0AgAiABQQJ0IgNqQQA7AQAgAiADQQRyakEAOwEAIAFBAmoiAUGeAkcNAAsgAEEAOwHwFCAAQQA7AfwSIABBuBVqQQA7AQAgAEG0FWpBADsBACAAQbAVakEAOwEAIABBrBVqQQA7AQAgAEGoFWpBADsBACAAQaQVakEAOwEAIABBoBVqQQA7AQAgAEGcFWpBADsBACAAQZgVakEAOwEAIABBlBVqQQA7AQAgAEGQFWpBADsBACAAQYwVakEAOwEAIABBiBVqQQA7AQAgAEGEFWpBADsBACAAQYAVakEAOwEAIABB/BRqQQA7AQAgAEH4FGpBADsBACAAQfQUakEAOwEAIABB8BNqQQA7AQAgAEHsE2pBADsBACAAQegTakEAOwEAIABB5BNqQQA7AQAgAEHgE2pBADsBACAAQdwTakEAOwEAIABB2BNqQQA7AQAgAEHUE2pBADsBACAAQdATakEAOwEAIABBzBNqQQA7AQAgAEHIE2pBADsBACAAQcQTakEAOwEAIABBwBNqQQA7AQAgAEG8E2pBADsBACAAQbgTakEAOwEAIABBtBNqQQA7AQAgAEGwE2pBADsBACAAQawTakEAOwEAIABBqBNqQQA7AQAgAEGkE2pBADsBACAAQaATakEAOwEAIABBnBNqQQA7AQAgAEGYE2pBADsBACAAQZQTakEAOwEAIABBkBNqQQA7AQAgAEGME2pBADsBACAAQYgTakEAOwEAIABBhBNqQQA7AQAgAEGAE2pBADsBACAAQgA3A6AtIABBiAlqQQE7AQAgAEEANgKcLSAAQQA2ApQtC4oBAQR/IAAoAkggAWoiAyACIANqQQFrIgJNBEAgACgCUCEFA0AgAygAACEEIANBAWohAyAFIARBsfPd8XlsQQ92Qf7/B3FqIgQvAQAiBiABQf//A3FHBEAgACgCTCABIAAoAjhxQf//A3FBAXRqIAY7AQAgBCABOwEACyABQQFqIQEgAiADTw0ACwsLUAECfyABIAAoAlAgACgCSCABaigAAEGx893xeWxBD3ZB/v8HcWoiAy8BACICRwRAIAAoAkwgACgCOCABcUEBdGogAjsBACADIAE7AQALIAILhQUBE38gACgCcCIDIANBAnYgACgCbCIDQQEgAxsiAyAAKAKAAUkbIQcgACgCZCIKIAAoAjBBhgJrIgVrQf//A3FBACAFIApJGyEMIAAoAkgiCCAKaiIJIANBAWsiAmoiBS0AASENIAUtAAAhDiAJQQJqIQUgAiAIaiELIAAoAoQBIRIgACgCPCEPIAAoAkwhECAAKAI4IREgACgCeEEFSCETA0ACQCAKIAFB//8DcU0NAANAAkACQCALIAFB//8DcSIGai0AACAORw0AIAsgBkEBaiIBai0AACANRw0AIAYgCGoiAi0AACAJLQAARw0AIAEgCGotAAAgCS0AAUYNAQsgB0EBayIHRQ0CIAwgECAGIBFxQQ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AgJ0L/////DyAnQv////8PVBs+AiAgAEEQaiEKAn8gAC0ABARAAn8gAC0ADEECdCENQX4hAQJAAkACQCAKRQ0AIAooAiBFDQAgCigCJEUNACAKKAIcIgNFDQAgAygCACAKRw0AAkACQCADKAIgIgVBOWsOOQECAgICAgICAgICAgECAgIBAgICAgICAgICAgICAgICAgIBAgICAgICAgICAgIBAgICAgICAgICAQALIAVBmgVGDQAgBUEqRw0BCyANQQVLDQACQAJAIAooAgxFDQAgCigCBCIEBEAgCigCAEUNAQsgBUGaBUcNASANQQRGDQELIApBkPEAKAIANgIYQX4MBAsgCigCEEUNASADKAIkIQEgAyANNgIkAkAgAygCEARAIAMQFAJAIAooAhAiBSADKAIQIgkgBSAJSRsiAUUNACAKKAIMIAMoAgggARAJGiAKIAooAgwgAWo2AgwgAyADKAIIIAFqNgIIIAogCigCFCABajYCFCAKIAooAhAgAWsiBTYCECADIAMoAhAgAWsiCTYCECAJDQAgAyADKAIENgIIQQAhCQsgBQRAIAMoAiAhBQwCCwwECyAEDQAgDUEBdEF3QQAgDUEESxtqIAFBAXRBd0EAIAFBBEobakoNACANQQRGDQAMAgsCQAJAAkACQAJAIAVBKkcEQCAFQZoFRw0BIAooAgRFDQMMBwsgAygCFEUEQCADQfEANgIgDAILIAMoAjRBDHRBgPABayEBAkAgAygCfEECTg0AIAMoAngiBEEBTA0AIARBBUwEQCABQcAAciEBDAELQYABQcABIARBBkYbIAFyIQELIAMgCUEBajYCECADKAIEIAlqIAFBIHIgASADKAJkGyIBQQh2OgAAIAMgAygCECIEQQFqNgIQIAQgAygCBGogAUEfcCABckEfczoAACADKAJkBEAgAyAKKAIwEF0LIApBATYCMCADQfEANgIgIAoQDCADKAIQDQcgAygCICEFCwJAAkACQAJAIAVBOUYEfyADKAIAQQA2AjAgAyADKAIQIgFBAWo2AhAgASADKAIEakEfOgAAIAMgAygCECIBQQFqNgIQIAEgAygCBGpBiwE6AAAgAyADKAIQIgFBAWo2AhAgASADKAIEakEIOgAAAk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AKKAIUIAVqNgIUIAogCigCECAFazYCECABIAEoAhAgBWsiBTYCECAFDQAgASABKAIENgIICyADKAIQDQwgAygCGCEHIAMoAhwoAhAhBUEAIQEgBCAJayIEIAMoAgwiCUsNAAsLIAMoAgQgAWogBSAHaiAEEAkaIAMgAygCECAEaiIENgIQAkAgAygCHCgCLEUNACABIARPDQAgCgJ/IAooAjAhBUEAIAMoAgQgAWoiB0UNABogBSAHIAQgAWutQcyYASgCABEDAAs2AjALIANBADYCGAsgA0HJADYCIAsgAygCHCgCHARAIAMoAhAiASEEA0ACQCABIAMoAgxHDQACQCADKAIcKAIsRQ0AIAEgBE0NACAKAn8gCigCMCEFQQAgAygCBCAEaiIHRQ0AGiAFIAcgASAEa61BzJgBKAIAEQMACzYCMAsgCigCHCIBEBQCQCAKKAIQIgQgASgCECIFIAQgBUkbIgRFDQAgCigCDCABKAIIIAQQCRogCiAKKAIMIARqNgIMIAEgASgCCCAEajYCCCAKIAooAhQgBGo2AhQgCiAKKAIQIARrNgIQIAEgASgCECAEayIENgIQIAQNACABIAEoAgQ2AggLQQAhAUEAIQQgAygCEEUNAAwLCyADKAIcKAIcIQUgAyADKAIYIgdBAWo2AhggBSAHai0AACEFIAMgAUEBajYCECADKAIEIAFqIAU6AAAgBQRAIAMoAhAhAQwBCwsCQCADKAIcKAIsRQ0AIAMoAhAiASAETQ0AIAoCfyAKKAIwIQVBACADKAIEIARqIgdFDQAaIAUgByABIARrrUHMmAEoAgARAwALNgIwCyADQQA2AhgLIANB2wA2AiALAkAgAygCHCgCJEUNACADKAIQIgEhBANAAkAgASADKAIMRw0AAkAgAygCHCgCLEUNACABIARNDQAgCgJ/IAooAjAhBUEAIAMoAgQgBGoiB0UNABogBSAHIAEgBGutQcyYASgCABEDAAs2AjALIAooAhwiARAUAkAgCigCECIEIAEoAhAiBSAEIAVJGyIERQ0AIAooAgwgASgCCCAEEAkaIAogCigCDCAEajYCDCABIAEoAgggBGo2AgggCiAKKAIUIARqNgIUIAogCigCECAEazYCECABIAEoAhAgBGsiBDYCECAEDQAgASABKAIENgIIC0EAIQFBACEEIAMoAhBFDQAMCgsgAygCHCgCJCEFIAMgAygCGCIHQQFqNgIYIAUgB2otAAAhBSADIAFBAWo2AhAgAygCBCABaiAFOgAAIAUEQCADKAIQIQEMAQsLIAMoAhwoAixFDQAgAygCECIBIARNDQAgCgJ/IAooAjAhBUEAIAMoAgQgBGoiB0UNABogBSAHIAEgBGutQcyYASgCABEDAAs2AjALIANB5wA2AiALAkAgAygCHCgCLARAIAMoAgwgAygCECIBQQJqSQRAIAoQDCADKAIQDQJBACEBCyAKKAIwIQQgAyABQQFqNgIQIAMoAgQgAWogBDoAACADIAMoAhAiAUEBajYCECABIAMoAgRqIARBCHY6AAAgAygCAEEANgIwCyADQfEANgIgIAoQDCADKAIQRQ0BDAcLDAYLIAooAgQNAQsgAygCPA0AIA1FDQEgAygCIEGaBUYNAQsCfyADKAJ4IgFFBEAgAyANEFwMAQsCQAJAAkAgAygCfEECaw4CAAECCwJ/AkADQAJAIAMoAjwNACADECkgAygCPA0AIA0NAkEADAMLIAMoAkggAygCZGotAAAhASADIAMoApQtIgRBAWo2ApQtIAQgAygCkC1qQQA6AAAgAyADKAKULSIEQQFqNgKULSAEIAMoApAtakEAOgAAIAMgAygClC0iBEEBajYClC0gBCADKAKQLWogAToAACADIAFBAnRqIgEgAS8BiAFBAWo7AYgBIAMgAygCPEEBazYCPCADIAMoAmRBAWoiBDYCZCADKAKULSADKAKYLUcNACADIAMoAlQiAUEATgR/IAMoAkggAWoFQQALIAQgAWtBABAPIAMgAygCZDYCVCADKAIAIgEoAhwiBBAUAkAgASgCECIFIAQoAhAiByAFIAdJGyIFRQ0AIAEoAgwgBCgCCCAFEAkaIAEgASgCDCAFajYCDCAEIAQoAgggBWo2AgggASABKAIUIAVqNgIUIAEgASgCECAFazYCECAEIAQoAhAgBWsiATYCECABDQAgBCAEKAIENgIICyADKAIAKAIQDQALQQAMAQsgA0EANgKoLSANQQRGBE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o2ApQtIAQgAygCkC1qQQA6AAAgAyADKAKULSIEQQFqNgKULSAEIAMoApAtakEAOgAAIAMgAygClC0iBEEBajYClC0gBCADKAKQLWogAToAACADIAFBAnRqIgEgAS8BiAFBAWo7AYgBIAMgAygCPEEBazYCPCADIAMoAmRBAWoiCzYCZAwBCyADIAMoApQtIgRBAWo2ApQtIAQgAygCkC1qQQE6AAAgAyADKAKULSIEQQFqNgKULSAEIAMoApAtakEAOgAAIAMgAygClC0iBEEBajYClC0gBCADKAKQLWogAUEDazoAACADIAMoAqQtQQFqNgKkLSABQc3pAGotAABBAnQgA2pBjAlqIgQgBC8BAEEBajsBACADQdDlAC0AAEECdGpB/BJqIgQgBC8BAEEBajsBACADIAMoAjwgAWs2AjwgAyADKAJkIAFqIgs2AmQLIAMoApQtIAMoApgtRw0AIAMgAygCVCIBQQBOBH8gAygCSCABagVBAAsgCyABa0EAEA8gAyADKAJkNgJUIAMoAgAiASgCHCIEEBQCQCABKAIQIgUgBCgCECIHIAUgB0kbIgVFDQAgASgCDCAEKAIIIAUQCRogASABKAIMIAVqNgIMIAQgBCgCCCAFajYCCCABIAEoAhQgBWo2AhQgASABKAIQIAVrNgIQIAQgBCgCECAFayIBNgIQIAENACAEIAQoAgQ2AggLIAMoAgAoAhANAAtBAAwBCyADQQA2AqgtIA1BBEYEQCADIAMoAlQiAUEATgR/IAMoAkggAWoFQQALIAMoAmQgAWtBARAPIAMgAygCZDYCVCADKAIAIgEoAhwiBBAUAkAgASgCECIFIAQoAhAiByAFIAdJGyIFRQ0AIAEoAgwgBCgCCCAFEAkaIAEgASgCDCAFajYCDCAEIAQoAgggBWo2AgggASABKAIUIAVqNgIUIAEgASgCECAFazYCECAEIAQoAhAgBWsiATYCECABDQAgBCAEKAIENgIIC0EDQQIgAygCACgCEBsMAQsCQCADKAKULUUNACADIAMoAlQiAUEATgR/IAMoAkggAWoFQQALIAMoAmQgAWtBABAPIAMgAygCZDYCVCADKAIAIgEoAhwiBBAUAkAgASgCEC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EFDAMLIAMgBUIBfCIEp0EDdGopAwAgAlYNAgsgBCEFIAQgB1QNAAsLAkAgAiADIAWnIgpBA3RqKQMAfSIEUEUEQCABKAIAIgMgCkEEdGopAwghBwwBCyABKAIAIgMgBUIBfSIFp0EEdGopAwgiByEECyACIAcgBH1UBEAgAARAIABBADYCBCAAQRw2AgALDBQLIAMgBUIBfCIFQQAgABCHASIDRQ0TIAMoAgAgAygCCCIKQQR0akEIayAENwMAIAMoAgQgCkEDdGogAjcDACADIAI3AzAgAyABKQMYIgYgAykDCCIEQgF9IgcgBiAHVBs3AxggASADNgIoIAMgATYCKCABIAQ3AyAgAyAFNwMgDAELIAFCADcDAAsgACADNgIUIAMgBDcDQCADIAI3AzhCACEEDBMLIAAoAhAiAQRAAkAgASgCKCIDRQRAIAEpAxghAgwBCyADQQA2AiggASgCKEIANwMgIAEgASkDGCICIAEpAyAiBSACIAVWGyICNwMYCyABKQMIIAJWBEADQCABKAIAIAKnQQR0aigCABAGIAJCAXwiAiABKQMIVA0ACwsgASgCABAGIAEoAgQQBiABEAYLIAAoAhQhASAAQQA2AhQgACABNgIQDBILIAJCCFoEfiABIAAoAgA2AgAgASAAKAIENgIEQggFQn8LIQQMEQsgACgCECIBBEACQCABKAIoIgNFBEAgASkDGCECDAELIANBADYCKCABKAIoQgA3AyAgASABKQMYIgIgASkDICIFIAIgBVYbIgI3AxgLIAEpAwggAlYEQANAIAEoAgAgAqdBBHRqKAIAEAYgAkIBfCICIAEpAwhUDQALCyABKAIAEAYgASgCBBAGIAEQBgsgACgCFCIBBEACQCABKAIoIgNFBEAgASkDGCECDAELIANBADYCKCABKAIoQgA3AyAgASABKQMYIgIgASkDICIFIAIgBVYbIgI3AxgLIAEpAwggAlYEQANAIAEoAgAgAqdBBHRqKAIAEAYgAkIBfCICIAEpAwhUDQALCyABKAIAEAYgASgCBBAGIAEQBgsgABAGDBALIAAoAhAiAEIANwM4IABBQGtCADcDAAwPCyACQn9XBEAgAARAIABBADYCBCAAQRI2AgALDA4LIAIgACgCECIDKQMwIAMpAzgiBn0iBSACIAVUGyIFUA0OIAEgAykDQCIHpyIAQQR0IgEgAygCAGoiCigCACAGIAMoAgQgAEEDdGopAwB9IgKnaiAFIAopAwggAn0iBiAFIAZUGyIEpxAJIQogByAEIAMoAgAiACABaikDCCACfVGtfCECIAUgBlYEQANAIAogBKdqIAAgAqdBBHQiAWoiACgCACAFIAR9IgYgACkDCCIHIAYgB1QbIganEAkaIAIgBiADKAIAIgAgAWopAwhRrXwhAiAFIAQgBnwiBFYNAAsLIAMgAjcDQCADIAMpAzggBHw3AzgMDgtCfyEEQcgAEAgiA0UNDSADQgA3AwAgA0IANwMwIANBADYCKCADQgA3AyAgA0IANwMYIANCADcDECADQgA3AwggA0IANwM4IANBCBAIIgE2AgQgAUUEQCADEAYgAARAIABBADYCBCAAQQ42AgALDA4LIAFCADcDACAAKAIQIgEEQAJAIAEoAigiCkUEQCABKQMYIQQMAQsgCkEANgIoIAEoAihCADcDICABIAEpAxgiAiABKQMgIgUgAiAFVhsiBDcDGAsgASkDCCAEVgRAA0AgASgCACAEp0EEdGooAgAQBiAEQgF8IgQgASkDCFQNAAsLIAEoAgAQBiABKAIEEAYgARAGCyAAIAM2AhBCACEEDA0LIAAoAhQiAQRAAkAgASgCKCIDRQRAIAEpAxghAgwBCyADQQA2AiggASgCKEIANwMgIAEgASkDGCICIAEpAyAiBSACIAVWGyICNwMYCyABKQMIIAJWBEADQCABKAIAIAKnQQR0aigCABAGIAJCAXwiAiABKQMIVA0ACwsgASgCABAGIAEoAgQQBiABEAYLIABBADYCFAwMCyAAKAIQIgMpAzggAykDMCABIAIgABBFIgdCAFMNCiADIAc3AzgCQCADKQMIIgZCAX0iAlANACADKAIEIQADQAJAIAcgACACIAR9QgGIIAR8IgWnQQN0aikDAFQEQCAFQgF9IQIMAQsgBSAGUQRAIAYhBQwDCyAAIAVCAXwiBKdBA3RqKQMAIAdWDQILIAQhBSACIARWDQALCyADIAU3A0BCACEEDAsL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TYuzhGKSasDP+ZFu4OBIOPgkXZbXPYTSelZ/fFVPphsggYh1D5hRMaLzqp+N6nP1n9BOG7DJl18domzxMru1lkd1m/hobEK8xQe5EuoeYETy2nXq3cOsrnCoVwBfsY5nKn+gCQVmeU2oDYLjhxRboZmFqc+2nHCLG/eLJTTuUkJBIHwsbjmlaMNSXsbsS4eQ9I+SPtuWS3p2/bDUWeRpsywqR90DM56ZrlhlN4FBvEAQfDYAAtNAQAAAAEAAAABAAAAAQAAAAIAAAACAAAAAgAAAAIAAAADAAAAAwAAAAMAAAADAAAABAAAAAQAAAAEAAAABAAAAAUAAAAFAAAABQAAAAUAQeDZAAtlAQAAAAEAAAACAAAAAgAAAAMAAAADAAAABAAAAAQAAAAFAAAABQAAAAYAAAAGAAAABwAAAAcAAAAIAAAACAAAAAkAAAAJAAAACgAAAAoAAAALAAAACwAAAAwAAAAMAAAADQAAAA0AQdjaAAttBAAAAAQABAAIAAQABQAAAAQABAAIAAQABgAAAAQABgAgACAABgAAAAQABAAQABAABwAAAAgAEAAgACAABwAAAAgAEACAAIAABwAAAAgAIACAAAABCAAAACAAgAACAQAECAAAACAAAgECAQAQCABB0NsAC/cJDAAIAIwACABMAAgAzAAIACwACACsAAgAbAAIAOwACAAcAAgAnAAIAFwACADcAAgAPAAIALwACAB8AAgA/AAIAAIACACCAAgAQgAIAMIACAAiAAgAogAIAGIACADiAAgAEgAIAJIACABSAAgA0gAIADIACACyAAgAcgAIAPIACAAKAAgAigAIAEoACADKAAgAKgAIAKoACABqAAgA6gAIABoACACaAAgAWgAIANoACAA6AAgAugAIAHoACAD6AAgABgAIAIYACABGAAgAxgAIACYACACmAAgAZgAIAOYACAAWAAgAlgAIAFYACADWAAgANgAIALYACAB2AAgA9gAIAA4ACACOAAgATgAIAM4ACAAuAAgArgAIAG4ACADuAAgAHgAIAJ4ACABeAAgA3gAIAD4ACAC+AAgAfgAIAP4ACAABAAgAgQAIAEEACADBAAgAIQAIAKEACABhAAgA4QAIABEACACRA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CBzdXBwb3J0ZWQATm90IHN1cHBvcnRlZABQcm90b2NvbCBmYW1pbHkgbm90IHN1cHBvcnRlZABBZGRyZXNzIGZhbWlseSBub3Qgc3VwcG9ydGVkIGJ5IHByb3RvY29sAEFkZHJlc3Mgbm90IGF2YWlsYWJsZQBOZXR3b3JrIGlzIGRvd24ATmV0d29yayB1bnJlYWNoYWJsZQBDb25uZWN0aW9uIHJlc2V0IGJ5IG5ldHdvcmsAQ29ubmVjdGlvbiBhYm9ydGVkAE5vIGJ1ZmZlciBzcGFjZSBhdmFpbGFibGUAU29ja2V0IGlzIGNvbm5lY3RlZABTb2NrZXQgbm90IGNvbm5lY3RlZABDYW5ub3Qgc2VuZCBhZnRlciBzb2NrZXQgc2h1dGRvd24AT3BlcmF0aW9uIGFscmVhZHkgaW4gcHJvZ3Jlc3MAT3BlcmF0aW9uIGluIHByb2dyZXNzAFN0YWxlIGZpbGUgaGFuZGxlAFJlbW90ZSBJL08gZXJyb3IAUXVvdGEgZXhjZWVkZWQATm8gbWVkaXVtIGZvdW5kAFdyb25nIG1lZGl1bSB0eXBlAE5vIGVycm9yIGluZm9ybWF0aW9uAEHAmAELdRYAAAAXAAAAGAAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAgAAAAIQAAACIAAABwUFAAJgAAACcAAAAoAAAAKQAAACoAAAArAAAALAAAAC0AAAAuAAAAJwAAACgAAAApAAAAKgAAACsAAAAsAAAALQBB5JoBCwJQUABBoJsBCxD/////////////////////"; + if (!isDataURI(wasmBinaryFile)) { + wasmBinaryFile = locateFile(wasmBinaryFile); + } + function getBinary(file) { + try { + if (file == wasmBinaryFile && wasmBinary) { + return new Uint8Array(wasmBinary); + } + var binary = tryParseAsDataURI(file); + if (binary) { + return binary; + } + if (readBinary) { + return readBinary(file); + } else { + throw "sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"; + } + } catch (err2) { + abort(err2); + } + } + function instantiateSync(file, info) { + var instance; + var module2; + var binary; + try { + binary = getBinary(file); + module2 = new WebAssembly.Module(binary); + instance = new WebAssembly.Instance(module2, info); + } catch (e) { + var str = e.toString(); + err("failed to compile wasm module: " + str); + if (str.includes("imported Memory") || str.includes("memory import")) { + err( + "Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)." + ); + } + throw e; + } + return [instance, module2]; + } + function createWasm() { + var info = { a: asmLibraryArg }; + function receiveInstance(instance, module2) { + var exports3 = instance.exports; + Module["asm"] = exports3; + wasmMemory = Module["asm"]["g"]; + updateGlobalBufferAndViews(wasmMemory.buffer); + wasmTable = Module["asm"]["$"]; + addOnInit(Module["asm"]["h"]); + removeRunDependency(); + } + addRunDependency(); + if (Module["instantiateWasm"]) { + try { + var exports2 = Module["instantiateWasm"](info, receiveInstance); + return exports2; + } catch (e) { + err("Module.instantiateWasm callback failed with error: " + e); + return false; + } + } + var result = instantiateSync(wasmBinaryFile, info); + receiveInstance(result[0]); + return Module["asm"]; + } + function LE_HEAP_LOAD_F32(byteOffset) { + return HEAP_DATA_VIEW.getFloat32(byteOffset, true); + } + function LE_HEAP_LOAD_F64(byteOffset) { + return HEAP_DATA_VIEW.getFloat64(byteOffset, true); + } + function LE_HEAP_LOAD_I16(byteOffset) { + return HEAP_DATA_VIEW.getInt16(byteOffset, true); + } + function LE_HEAP_LOAD_I32(byteOffset) { + return HEAP_DATA_VIEW.getInt32(byteOffset, true); + } + function LE_HEAP_STORE_I32(byteOffset, value) { + HEAP_DATA_VIEW.setInt32(byteOffset, value, true); + } + function callRuntimeCallbacks(callbacks) { + while (callbacks.length > 0) { + var callback = callbacks.shift(); + if (typeof callback == "function") { + callback(Module); + continue; + } + var func = callback.func; + if (typeof func === "number") { + if (callback.arg === void 0) { + wasmTable.get(func)(); + } else { + wasmTable.get(func)(callback.arg); + } + } else { + func(callback.arg === void 0 ? null : callback.arg); + } + } + } + function _gmtime_r(time, tmPtr) { + var date = new Date(LE_HEAP_LOAD_I32((time >> 2) * 4) * 1e3); + LE_HEAP_STORE_I32((tmPtr >> 2) * 4, date.getUTCSeconds()); + LE_HEAP_STORE_I32((tmPtr + 4 >> 2) * 4, date.getUTCMinutes()); + LE_HEAP_STORE_I32((tmPtr + 8 >> 2) * 4, date.getUTCHours()); + LE_HEAP_STORE_I32((tmPtr + 12 >> 2) * 4, date.getUTCDate()); + LE_HEAP_STORE_I32((tmPtr + 16 >> 2) * 4, date.getUTCMonth()); + LE_HEAP_STORE_I32((tmPtr + 20 >> 2) * 4, date.getUTCFullYear() - 1900); + LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); + LE_HEAP_STORE_I32((tmPtr + 36 >> 2) * 4, 0); + LE_HEAP_STORE_I32((tmPtr + 32 >> 2) * 4, 0); + var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); + var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; + LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); + if (!_gmtime_r.GMTString) + _gmtime_r.GMTString = allocateUTF8("GMT"); + LE_HEAP_STORE_I32((tmPtr + 40 >> 2) * 4, _gmtime_r.GMTString); + return tmPtr; + } + function ___gmtime_r(a0, a1) { + return _gmtime_r(a0, a1); + } + function _emscripten_memcpy_big(dest, src, num) { + HEAPU8.copyWithin(dest, src, src + num); + } + function emscripten_realloc_buffer(size) { + try { + wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); + updateGlobalBufferAndViews(wasmMemory.buffer); + return 1; + } catch (e) { + } + } + function _emscripten_resize_heap(requestedSize) { + var oldSize = HEAPU8.length; + requestedSize = requestedSize >>> 0; + var maxHeapSize = 2147483648; + if (requestedSize > maxHeapSize) { + return false; + } + for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { + var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); + overGrownHeapSize = Math.min( + overGrownHeapSize, + requestedSize + 100663296 + ); + var newSize = Math.min( + maxHeapSize, + alignUp(Math.max(requestedSize, overGrownHeapSize), 65536) + ); + var replacement = emscripten_realloc_buffer(newSize); + if (replacement) { + return true; + } + } + return false; + } + function _setTempRet0(val) { + } + function _time(ptr) { + var ret = Date.now() / 1e3 | 0; + if (ptr) { + LE_HEAP_STORE_I32((ptr >> 2) * 4, ret); + } + return ret; + } + function _tzset() { + if (_tzset.called) + return; + _tzset.called = true; + var currentYear = new Date().getFullYear(); + var winter = new Date(currentYear, 0, 1); + var summer = new Date(currentYear, 6, 1); + var winterOffset = winter.getTimezoneOffset(); + var summerOffset = summer.getTimezoneOffset(); + var stdTimezoneOffset = Math.max(winterOffset, summerOffset); + LE_HEAP_STORE_I32((__get_timezone() >> 2) * 4, stdTimezoneOffset * 60); + LE_HEAP_STORE_I32( + (__get_daylight() >> 2) * 4, + Number(winterOffset != summerOffset) + ); + function extractZone(date) { + var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/); + return match ? match[1] : "GMT"; + } + var winterName = extractZone(winter); + var summerName = extractZone(summer); + var winterNamePtr = allocateUTF8(winterName); + var summerNamePtr = allocateUTF8(summerName); + if (summerOffset < winterOffset) { + LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, winterNamePtr); + LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, summerNamePtr); + } else { + LE_HEAP_STORE_I32((__get_tzname() >> 2) * 4, summerNamePtr); + LE_HEAP_STORE_I32((__get_tzname() + 4 >> 2) * 4, winterNamePtr); + } + } + function _timegm(tmPtr) { + _tzset(); + var time = Date.UTC( + LE_HEAP_LOAD_I32((tmPtr + 20 >> 2) * 4) + 1900, + LE_HEAP_LOAD_I32((tmPtr + 16 >> 2) * 4), + LE_HEAP_LOAD_I32((tmPtr + 12 >> 2) * 4), + LE_HEAP_LOAD_I32((tmPtr + 8 >> 2) * 4), + LE_HEAP_LOAD_I32((tmPtr + 4 >> 2) * 4), + LE_HEAP_LOAD_I32((tmPtr >> 2) * 4), + 0 + ); + var date = new Date(time); + LE_HEAP_STORE_I32((tmPtr + 24 >> 2) * 4, date.getUTCDay()); + var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); + var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; + LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); + return date.getTime() / 1e3 | 0; + } + function intArrayFromBase64(s) { + { + var buf; + try { + buf = Buffer.from(s, "base64"); + } catch (_) { + buf = new Buffer(s, "base64"); + } + return new Uint8Array( + buf["buffer"], + buf["byteOffset"], + buf["byteLength"] + ); + } + } + function tryParseAsDataURI(filename) { + if (!isDataURI(filename)) { + return; + } + return intArrayFromBase64(filename.slice(dataURIPrefix.length)); + } + var asmLibraryArg = { + e: ___gmtime_r, + c: _emscripten_memcpy_big, + d: _emscripten_resize_heap, + a: _setTempRet0, + b: _time, + f: _timegm + }; + var asm = createWasm(); + Module["___wasm_call_ctors"] = asm["h"]; + Module["_zip_ext_count_symlinks"] = asm["i"]; + Module["_zip_file_get_external_attributes"] = asm["j"]; + Module["_zipstruct_stat"] = asm["k"]; + Module["_zipstruct_statS"] = asm["l"]; + Module["_zipstruct_stat_name"] = asm["m"]; + Module["_zipstruct_stat_index"] = asm["n"]; + Module["_zipstruct_stat_size"] = asm["o"]; + Module["_zipstruct_stat_mtime"] = asm["p"]; + Module["_zipstruct_stat_crc"] = asm["q"]; + Module["_zipstruct_error"] = asm["r"]; + Module["_zipstruct_errorS"] = asm["s"]; + Module["_zipstruct_error_code_zip"] = asm["t"]; + Module["_zipstruct_stat_comp_size"] = asm["u"]; + Module["_zipstruct_stat_comp_method"] = asm["v"]; + Module["_zip_close"] = asm["w"]; + Module["_zip_delete"] = asm["x"]; + Module["_zip_dir_add"] = asm["y"]; + Module["_zip_discard"] = asm["z"]; + Module["_zip_error_init_with_code"] = asm["A"]; + Module["_zip_get_error"] = asm["B"]; + Module["_zip_file_get_error"] = asm["C"]; + Module["_zip_error_strerror"] = asm["D"]; + Module["_zip_fclose"] = asm["E"]; + Module["_zip_file_add"] = asm["F"]; + Module["_free"] = asm["G"]; + var _malloc = Module["_malloc"] = asm["H"]; + Module["_zip_source_error"] = asm["I"]; + Module["_zip_source_seek"] = asm["J"]; + Module["_zip_file_set_external_attributes"] = asm["K"]; + Module["_zip_file_set_mtime"] = asm["L"]; + Module["_zip_fopen"] = asm["M"]; + Module["_zip_fopen_index"] = asm["N"]; + Module["_zip_fread"] = asm["O"]; + Module["_zip_get_name"] = asm["P"]; + Module["_zip_get_num_entries"] = asm["Q"]; + Module["_zip_source_read"] = asm["R"]; + Module["_zip_name_locate"] = asm["S"]; + Module["_zip_open_from_source"] = asm["T"]; + Module["_zip_set_file_compression"] = asm["U"]; + Module["_zip_source_buffer"] = asm["V"]; + Module["_zip_source_buffer_create"] = asm["W"]; + Module["_zip_source_close"] = asm["X"]; + Module["_zip_source_free"] = asm["Y"]; + Module["_zip_source_keep"] = asm["Z"]; + Module["_zip_source_open"] = asm["_"]; + Module["_zip_source_set_mtime"] = asm["aa"]; + Module["_zip_source_tell"] = asm["ba"]; + Module["_zip_stat"] = asm["ca"]; + Module["_zip_stat_index"] = asm["da"]; + var __get_tzname = Module["__get_tzname"] = asm["ea"]; + var __get_daylight = Module["__get_daylight"] = asm["fa"]; + var __get_timezone = Module["__get_timezone"] = asm["ga"]; + var stackSave = Module["stackSave"] = asm["ha"]; + var stackRestore = Module["stackRestore"] = asm["ia"]; + var stackAlloc = Module["stackAlloc"] = asm["ja"]; + Module["cwrap"] = cwrap; + Module["getValue"] = getValue; + var calledRun; + dependenciesFulfilled = function runCaller() { + if (!calledRun) + run(); + if (!calledRun) + dependenciesFulfilled = runCaller; + }; + function run(args) { + if (runDependencies > 0) { + return; + } + preRun(); + if (runDependencies > 0) { + return; + } + function doRun() { + if (calledRun) + return; + calledRun = true; + Module["calledRun"] = true; + if (ABORT) + return; + initRuntime(); + readyPromiseResolve(Module); + if (Module["onRuntimeInitialized"]) + Module["onRuntimeInitialized"](); + postRun(); + } + if (Module["setStatus"]) { + Module["setStatus"]("Running..."); + setTimeout(function() { + setTimeout(function() { + Module["setStatus"](""); + }, 1); + doRun(); + }, 1); + } else { + doRun(); + } + } + Module["run"] = run; + if (Module["preInit"]) { + if (typeof Module["preInit"] == "function") + Module["preInit"] = [Module["preInit"]]; + while (Module["preInit"].length > 0) { + Module["preInit"].pop()(); + } + } + run(); + return createModule2; + }; +}(); +module.exports = createModule; +}(libzipSync)); + +const createModule = libzipSync.exports; + +const number64 = [ + `number`, + `number` +]; +var Errors = /* @__PURE__ */ ((Errors2) => { + Errors2[Errors2["ZIP_ER_OK"] = 0] = "ZIP_ER_OK"; + Errors2[Errors2["ZIP_ER_MULTIDISK"] = 1] = "ZIP_ER_MULTIDISK"; + Errors2[Errors2["ZIP_ER_RENAME"] = 2] = "ZIP_ER_RENAME"; + Errors2[Errors2["ZIP_ER_CLOSE"] = 3] = "ZIP_ER_CLOSE"; + Errors2[Errors2["ZIP_ER_SEEK"] = 4] = "ZIP_ER_SEEK"; + Errors2[Errors2["ZIP_ER_READ"] = 5] = "ZIP_ER_READ"; + Errors2[Errors2["ZIP_ER_WRITE"] = 6] = "ZIP_ER_WRITE"; + Errors2[Errors2["ZIP_ER_CRC"] = 7] = "ZIP_ER_CRC"; + Errors2[Errors2["ZIP_ER_ZIPCLOSED"] = 8] = "ZIP_ER_ZIPCLOSED"; + Errors2[Errors2["ZIP_ER_NOENT"] = 9] = "ZIP_ER_NOENT"; + Errors2[Errors2["ZIP_ER_EXISTS"] = 10] = "ZIP_ER_EXISTS"; + Errors2[Errors2["ZIP_ER_OPEN"] = 11] = "ZIP_ER_OPEN"; + Errors2[Errors2["ZIP_ER_TMPOPEN"] = 12] = "ZIP_ER_TMPOPEN"; + Errors2[Errors2["ZIP_ER_ZLIB"] = 13] = "ZIP_ER_ZLIB"; + Errors2[Errors2["ZIP_ER_MEMORY"] = 14] = "ZIP_ER_MEMORY"; + Errors2[Errors2["ZIP_ER_CHANGED"] = 15] = "ZIP_ER_CHANGED"; + Errors2[Errors2["ZIP_ER_COMPNOTSUPP"] = 16] = "ZIP_ER_COMPNOTSUPP"; + Errors2[Errors2["ZIP_ER_EOF"] = 17] = "ZIP_ER_EOF"; + Errors2[Errors2["ZIP_ER_INVAL"] = 18] = "ZIP_ER_INVAL"; + Errors2[Errors2["ZIP_ER_NOZIP"] = 19] = "ZIP_ER_NOZIP"; + Errors2[Errors2["ZIP_ER_INTERNAL"] = 20] = "ZIP_ER_INTERNAL"; + Errors2[Errors2["ZIP_ER_INCONS"] = 21] = "ZIP_ER_INCONS"; + Errors2[Errors2["ZIP_ER_REMOVE"] = 22] = "ZIP_ER_REMOVE"; + Errors2[Errors2["ZIP_ER_DELETED"] = 23] = "ZIP_ER_DELETED"; + Errors2[Errors2["ZIP_ER_ENCRNOTSUPP"] = 24] = "ZIP_ER_ENCRNOTSUPP"; + Errors2[Errors2["ZIP_ER_RDONLY"] = 25] = "ZIP_ER_RDONLY"; + Errors2[Errors2["ZIP_ER_NOPASSWD"] = 26] = "ZIP_ER_NOPASSWD"; + Errors2[Errors2["ZIP_ER_WRONGPASSWD"] = 27] = "ZIP_ER_WRONGPASSWD"; + Errors2[Errors2["ZIP_ER_OPNOTSUPP"] = 28] = "ZIP_ER_OPNOTSUPP"; + Errors2[Errors2["ZIP_ER_INUSE"] = 29] = "ZIP_ER_INUSE"; + Errors2[Errors2["ZIP_ER_TELL"] = 30] = "ZIP_ER_TELL"; + Errors2[Errors2["ZIP_ER_COMPRESSED_DATA"] = 31] = "ZIP_ER_COMPRESSED_DATA"; + return Errors2; +})(Errors || {}); +const makeInterface = (emZip) => ({ + get HEAP8() { + return emZip.HEAP8; + }, + get HEAPU8() { + return emZip.HEAPU8; + }, + errors: Errors, + SEEK_SET: 0, + SEEK_CUR: 1, + SEEK_END: 2, + ZIP_CHECKCONS: 4, + ZIP_EXCL: 2, + ZIP_RDONLY: 16, + ZIP_FL_OVERWRITE: 8192, + ZIP_FL_COMPRESSED: 4, + ZIP_OPSYS_DOS: 0, + ZIP_OPSYS_AMIGA: 1, + ZIP_OPSYS_OPENVMS: 2, + ZIP_OPSYS_UNIX: 3, + ZIP_OPSYS_VM_CMS: 4, + ZIP_OPSYS_ATARI_ST: 5, + ZIP_OPSYS_OS_2: 6, + ZIP_OPSYS_MACINTOSH: 7, + ZIP_OPSYS_Z_SYSTEM: 8, + ZIP_OPSYS_CPM: 9, + ZIP_OPSYS_WINDOWS_NTFS: 10, + ZIP_OPSYS_MVS: 11, + ZIP_OPSYS_VSE: 12, + ZIP_OPSYS_ACORN_RISC: 13, + ZIP_OPSYS_VFAT: 14, + ZIP_OPSYS_ALTERNATE_MVS: 15, + ZIP_OPSYS_BEOS: 16, + ZIP_OPSYS_TANDEM: 17, + ZIP_OPSYS_OS_400: 18, + ZIP_OPSYS_OS_X: 19, + ZIP_CM_DEFAULT: -1, + ZIP_CM_STORE: 0, + ZIP_CM_DEFLATE: 8, + uint08S: emZip._malloc(1), + uint16S: emZip._malloc(2), + uint32S: emZip._malloc(4), + uint64S: emZip._malloc(8), + malloc: emZip._malloc, + free: emZip._free, + getValue: emZip.getValue, + openFromSource: emZip.cwrap(`zip_open_from_source`, `number`, [`number`, `number`, `number`]), + close: emZip.cwrap(`zip_close`, `number`, [`number`]), + discard: emZip.cwrap(`zip_discard`, null, [`number`]), + getError: emZip.cwrap(`zip_get_error`, `number`, [`number`]), + getName: emZip.cwrap(`zip_get_name`, `string`, [`number`, `number`, `number`]), + getNumEntries: emZip.cwrap(`zip_get_num_entries`, `number`, [`number`, `number`]), + delete: emZip.cwrap(`zip_delete`, `number`, [`number`, `number`]), + stat: emZip.cwrap(`zip_stat`, `number`, [`number`, `string`, `number`, `number`]), + statIndex: emZip.cwrap(`zip_stat_index`, `number`, [`number`, ...number64, `number`, `number`]), + fopen: emZip.cwrap(`zip_fopen`, `number`, [`number`, `string`, `number`]), + fopenIndex: emZip.cwrap(`zip_fopen_index`, `number`, [`number`, ...number64, `number`]), + fread: emZip.cwrap(`zip_fread`, `number`, [`number`, `number`, `number`, `number`]), + fclose: emZip.cwrap(`zip_fclose`, `number`, [`number`]), + dir: { + add: emZip.cwrap(`zip_dir_add`, `number`, [`number`, `string`]) + }, + file: { + add: emZip.cwrap(`zip_file_add`, `number`, [`number`, `string`, `number`, `number`]), + getError: emZip.cwrap(`zip_file_get_error`, `number`, [`number`]), + getExternalAttributes: emZip.cwrap(`zip_file_get_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), + setExternalAttributes: emZip.cwrap(`zip_file_set_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), + setMtime: emZip.cwrap(`zip_file_set_mtime`, `number`, [`number`, ...number64, `number`, `number`]), + setCompression: emZip.cwrap(`zip_set_file_compression`, `number`, [`number`, ...number64, `number`, `number`]) + }, + ext: { + countSymlinks: emZip.cwrap(`zip_ext_count_symlinks`, `number`, [`number`]) + }, + error: { + initWithCode: emZip.cwrap(`zip_error_init_with_code`, null, [`number`, `number`]), + strerror: emZip.cwrap(`zip_error_strerror`, `string`, [`number`]) + }, + name: { + locate: emZip.cwrap(`zip_name_locate`, `number`, [`number`, `string`, `number`]) + }, + source: { + fromUnattachedBuffer: emZip.cwrap(`zip_source_buffer_create`, `number`, [`number`, ...number64, `number`, `number`]), + fromBuffer: emZip.cwrap(`zip_source_buffer`, `number`, [`number`, `number`, ...number64, `number`]), + free: emZip.cwrap(`zip_source_free`, null, [`number`]), + keep: emZip.cwrap(`zip_source_keep`, null, [`number`]), + open: emZip.cwrap(`zip_source_open`, `number`, [`number`]), + close: emZip.cwrap(`zip_source_close`, `number`, [`number`]), + seek: emZip.cwrap(`zip_source_seek`, `number`, [`number`, ...number64, `number`]), + tell: emZip.cwrap(`zip_source_tell`, `number`, [`number`]), + read: emZip.cwrap(`zip_source_read`, `number`, [`number`, `number`, `number`]), + error: emZip.cwrap(`zip_source_error`, `number`, [`number`]), + setMtime: emZip.cwrap(`zip_source_set_mtime`, `number`, [`number`, `number`]) + }, + struct: { + stat: emZip.cwrap(`zipstruct_stat`, `number`, []), + statS: emZip.cwrap(`zipstruct_statS`, `number`, []), + statName: emZip.cwrap(`zipstruct_stat_name`, `string`, [`number`]), + statIndex: emZip.cwrap(`zipstruct_stat_index`, `number`, [`number`]), + statSize: emZip.cwrap(`zipstruct_stat_size`, `number`, [`number`]), + statCompSize: emZip.cwrap(`zipstruct_stat_comp_size`, `number`, [`number`]), + statCompMethod: emZip.cwrap(`zipstruct_stat_comp_method`, `number`, [`number`]), + statMtime: emZip.cwrap(`zipstruct_stat_mtime`, `number`, [`number`]), + statCrc: emZip.cwrap(`zipstruct_stat_crc`, `number`, [`number`]), + error: emZip.cwrap(`zipstruct_error`, `number`, []), + errorS: emZip.cwrap(`zipstruct_errorS`, `number`, []), + errorCodeZip: emZip.cwrap(`zipstruct_error_code_zip`, `number`, [`number`]) + } +}); + +function getArchivePart(path, extension) { + let idx = path.indexOf(extension); + if (idx <= 0) + return null; + let nextCharIdx = idx; + while (idx >= 0) { + nextCharIdx = idx + extension.length; + if (path[nextCharIdx] === ppath.sep) + break; + if (path[idx - 1] === ppath.sep) + return null; + idx = path.indexOf(extension, nextCharIdx); + } + if (path.length > nextCharIdx && path[nextCharIdx] !== ppath.sep) + return null; + return path.slice(0, nextCharIdx); +} +class ZipOpenFS extends MountFS { + static async openPromise(fn, opts) { + const zipOpenFs = new ZipOpenFS(opts); + try { + return await fn(zipOpenFs); + } finally { + zipOpenFs.saveAndClose(); + } + } + constructor(opts = {}) { + const fileExtensions = opts.fileExtensions; + const readOnlyArchives = opts.readOnlyArchives; + const getMountPoint = typeof fileExtensions === `undefined` ? (path) => getArchivePart(path, `.zip`) : (path) => { + for (const extension of fileExtensions) { + const result = getArchivePart(path, extension); + if (result) { + return result; + } + } + return null; + }; + const factorySync = (baseFs, p) => { + return new ZipFS(p, { + baseFs, + readOnly: readOnlyArchives, + stats: baseFs.statSync(p) + }); + }; + const factoryPromise = async (baseFs, p) => { + const zipOptions = { + baseFs, + readOnly: readOnlyArchives, + stats: await baseFs.statPromise(p) + }; + return () => { + return new ZipFS(p, zipOptions); + }; + }; + super({ + ...opts, + factorySync, + factoryPromise, + getMountPoint + }); + } +} + +const DEFAULT_COMPRESSION_LEVEL = `mixed`; +function toUnixTimestamp(time) { + if (typeof time === `string` && String(+time) === time) + return +time; + if (typeof time === `number` && Number.isFinite(time)) { + if (time < 0) { + return Date.now() / 1e3; + } else { + return time; + } + } + if (nodeUtils.types.isDate(time)) + return time.getTime() / 1e3; + throw new Error(`Invalid time`); +} +function makeEmptyArchive() { + return Buffer.from([ + 80, + 75, + 5, + 6, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ]); +} +class LibzipError extends Error { + constructor(message, code) { + super(message); + this.name = `Libzip Error`; + this.code = code; + } +} +class ZipFS extends BasePortableFakeFS { + constructor(source, opts = {}) { + super(); + this.listings = /* @__PURE__ */ new Map(); + this.entries = /* @__PURE__ */ new Map(); + this.fileSources = /* @__PURE__ */ new Map(); + this.fds = /* @__PURE__ */ new Map(); + this.nextFd = 0; + this.ready = false; + this.readOnly = false; + const pathOptions = opts; + this.level = typeof pathOptions.level !== `undefined` ? pathOptions.level : DEFAULT_COMPRESSION_LEVEL; + source ?? (source = makeEmptyArchive()); + if (typeof source === `string`) { + const { baseFs = new NodeFS() } = pathOptions; + this.baseFs = baseFs; + this.path = source; + } else { + this.path = null; + this.baseFs = null; + } + if (opts.stats) { + this.stats = opts.stats; + } else { + if (typeof source === `string`) { + try { + this.stats = this.baseFs.statSync(source); + } catch (error) { + if (error.code === `ENOENT` && pathOptions.create) { + this.stats = makeDefaultStats(); + } else { + throw error; + } + } + } else { + this.stats = makeDefaultStats(); + } + } + this.libzip = getInstance(); + const errPtr = this.libzip.malloc(4); + try { + let flags = 0; + if (opts.readOnly) { + flags |= this.libzip.ZIP_RDONLY; + this.readOnly = true; + } + if (typeof source === `string`) + source = pathOptions.create ? makeEmptyArchive() : this.baseFs.readFileSync(source); + const lzSource = this.allocateUnattachedSource(source); + try { + this.zip = this.libzip.openFromSource(lzSource, flags, errPtr); + this.lzSource = lzSource; + } catch (error) { + this.libzip.source.free(lzSource); + throw error; + } + if (this.zip === 0) { + const error = this.libzip.struct.errorS(); + this.libzip.error.initWithCode(error, this.libzip.getValue(errPtr, `i32`)); + throw this.makeLibzipError(error); + } + } finally { + this.libzip.free(errPtr); + } + this.listings.set(PortablePath.root, /* @__PURE__ */ new Set()); + const entryCount = this.libzip.getNumEntries(this.zip, 0); + for (let t = 0; t < entryCount; ++t) { + const raw = this.libzip.getName(this.zip, t, 0); + if (ppath.isAbsolute(raw)) + continue; + const p = ppath.resolve(PortablePath.root, raw); + this.registerEntry(p, t); + if (raw.endsWith(`/`)) { + this.registerListing(p); + } + } + this.symlinkCount = this.libzip.ext.countSymlinks(this.zip); + if (this.symlinkCount === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + this.ready = true; + } + makeLibzipError(error) { + const errorCode = this.libzip.struct.errorCodeZip(error); + const strerror = this.libzip.error.strerror(error); + const libzipError = new LibzipError(strerror, this.libzip.errors[errorCode]); + if (errorCode === this.libzip.errors.ZIP_ER_CHANGED) + throw new Error(`Assertion failed: Unexpected libzip error: ${libzipError.message}`); + return libzipError; + } + getExtractHint(hints) { + for (const fileName of this.entries.keys()) { + const ext = this.pathUtils.extname(fileName); + if (hints.relevantExtensions.has(ext)) { + return true; + } + } + return false; + } + getAllFiles() { + return Array.from(this.entries.keys()); + } + getRealPath() { + if (!this.path) + throw new Error(`ZipFS don't have real paths when loaded from a buffer`); + return this.path; + } + prepareClose() { + if (!this.ready) + throw EBUSY(`archive closed, close`); + unwatchAllFiles(this); + } + getBufferAndClose() { + this.prepareClose(); + if (this.entries.size === 0) { + this.discardAndClose(); + return makeEmptyArchive(); + } + try { + this.libzip.source.keep(this.lzSource); + if (this.libzip.close(this.zip) === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + if (this.libzip.source.open(this.lzSource) === -1) + throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); + if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_END) === -1) + throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); + const size = this.libzip.source.tell(this.lzSource); + if (size === -1) + throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); + if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_SET) === -1) + throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); + const buffer = this.libzip.malloc(size); + if (!buffer) + throw new Error(`Couldn't allocate enough memory`); + try { + const rc = this.libzip.source.read(this.lzSource, buffer, size); + if (rc === -1) + throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); + else if (rc < size) + throw new Error(`Incomplete read`); + else if (rc > size) + throw new Error(`Overread`); + const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); + return Buffer.from(memory); + } finally { + this.libzip.free(buffer); + } + } finally { + this.libzip.source.close(this.lzSource); + this.libzip.source.free(this.lzSource); + this.ready = false; + } + } + discardAndClose() { + this.prepareClose(); + this.libzip.discard(this.zip); + this.ready = false; + } + saveAndClose() { + if (!this.path || !this.baseFs) + throw new Error(`ZipFS cannot be saved and must be discarded when loaded from a buffer`); + if (this.readOnly) { + this.discardAndClose(); + return; + } + const newMode = this.baseFs.existsSync(this.path) || this.stats.mode === DEFAULT_MODE ? void 0 : this.stats.mode; + this.baseFs.writeFileSync(this.path, this.getBufferAndClose(), { mode: newMode }); + this.ready = false; + } + resolve(p) { + return ppath.resolve(PortablePath.root, p); + } + async openPromise(p, flags, mode) { + return this.openSync(p, flags, mode); + } + openSync(p, flags, mode) { + const fd = this.nextFd++; + this.fds.set(fd, { cursor: 0, p }); + return fd; + } + hasOpenFileHandles() { + return !!this.fds.size; + } + async opendirPromise(p, opts) { + return this.opendirSync(p, opts); + } + opendirSync(p, opts = {}) { + const resolvedP = this.resolveFilename(`opendir '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) + throw ENOENT(`opendir '${p}'`); + const directoryListing = this.listings.get(resolvedP); + if (!directoryListing) + throw ENOTDIR(`opendir '${p}'`); + const entries = [...directoryListing]; + const fd = this.openSync(resolvedP, `r`); + const onClose = () => { + this.closeSync(fd); + }; + return opendir(this, resolvedP, entries, { onClose }); + } + async readPromise(fd, buffer, offset, length, position) { + return this.readSync(fd, buffer, offset, length, position); + } + readSync(fd, buffer, offset = 0, length = buffer.byteLength, position = -1) { + const entry = this.fds.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`read`); + const realPosition = position === -1 || position === null ? entry.cursor : position; + const source = this.readFileSync(entry.p); + source.copy(buffer, offset, realPosition, realPosition + length); + const bytesRead = Math.max(0, Math.min(source.length - realPosition, length)); + if (position === -1 || position === null) + entry.cursor += bytesRead; + return bytesRead; + } + async writePromise(fd, buffer, offset, length, position) { + if (typeof buffer === `string`) { + return this.writeSync(fd, buffer, position); + } else { + return this.writeSync(fd, buffer, offset, length, position); + } + } + writeSync(fd, buffer, offset, length, position) { + const entry = this.fds.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`read`); + throw new Error(`Unimplemented`); + } + async closePromise(fd) { + return this.closeSync(fd); + } + closeSync(fd) { + const entry = this.fds.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`read`); + this.fds.delete(fd); + } + createReadStream(p, { encoding } = {}) { + if (p === null) + throw new Error(`Unimplemented`); + const fd = this.openSync(p, `r`); + const stream$1 = Object.assign( + new stream.PassThrough({ + emitClose: true, + autoDestroy: true, + destroy: (error, callback) => { + clearImmediate(immediate); + this.closeSync(fd); + callback(error); + } + }), + { + close() { + stream$1.destroy(); + }, + bytesRead: 0, + path: p, + pending: false + } + ); + const immediate = setImmediate(async () => { + try { + const data = await this.readFilePromise(p, encoding); + stream$1.bytesRead = data.length; + stream$1.end(data); + } catch (error) { + stream$1.destroy(error); + } + }); + return stream$1; + } + createWriteStream(p, { encoding } = {}) { + if (this.readOnly) + throw EROFS(`open '${p}'`); + if (p === null) + throw new Error(`Unimplemented`); + const chunks = []; + const fd = this.openSync(p, `w`); + const stream$1 = Object.assign( + new stream.PassThrough({ + autoDestroy: true, + emitClose: true, + destroy: (error, callback) => { + try { + if (error) { + callback(error); + } else { + this.writeFileSync(p, Buffer.concat(chunks), encoding); + callback(null); + } + } catch (err) { + callback(err); + } finally { + this.closeSync(fd); + } + } + }), + { + close() { + stream$1.destroy(); + }, + bytesWritten: 0, + path: p, + pending: false + } + ); + stream$1.on(`data`, (chunk) => { + const chunkBuffer = Buffer.from(chunk); + stream$1.bytesWritten += chunkBuffer.length; + chunks.push(chunkBuffer); + }); + return stream$1; + } + async realpathPromise(p) { + return this.realpathSync(p); + } + realpathSync(p) { + const resolvedP = this.resolveFilename(`lstat '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) + throw ENOENT(`lstat '${p}'`); + return resolvedP; + } + async existsPromise(p) { + return this.existsSync(p); + } + existsSync(p) { + if (!this.ready) + throw EBUSY(`archive closed, existsSync '${p}'`); + if (this.symlinkCount === 0) { + const resolvedP2 = ppath.resolve(PortablePath.root, p); + return this.entries.has(resolvedP2) || this.listings.has(resolvedP2); + } + let resolvedP; + try { + resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, false); + } catch (error) { + return false; + } + if (resolvedP === void 0) + return false; + return this.entries.has(resolvedP) || this.listings.has(resolvedP); + } + async accessPromise(p, mode) { + return this.accessSync(p, mode); + } + accessSync(p, mode = fs.constants.F_OK) { + const resolvedP = this.resolveFilename(`access '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) + throw ENOENT(`access '${p}'`); + if (this.readOnly && mode & fs.constants.W_OK) { + throw EROFS(`access '${p}'`); + } + } + async statPromise(p, opts = { bigint: false }) { + if (opts.bigint) + return this.statSync(p, { bigint: true }); + return this.statSync(p); + } + statSync(p, opts = { bigint: false, throwIfNoEntry: true }) { + const resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, opts.throwIfNoEntry); + if (resolvedP === void 0) + return void 0; + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { + if (opts.throwIfNoEntry === false) + return void 0; + throw ENOENT(`stat '${p}'`); + } + if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) + throw ENOTDIR(`stat '${p}'`); + return this.statImpl(`stat '${p}'`, resolvedP, opts); + } + async fstatPromise(fd, opts) { + return this.fstatSync(fd, opts); + } + fstatSync(fd, opts) { + const entry = this.fds.get(fd); + if (typeof entry === `undefined`) + throw EBADF(`fstatSync`); + const { p } = entry; + const resolvedP = this.resolveFilename(`stat '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) + throw ENOENT(`stat '${p}'`); + if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) + throw ENOTDIR(`stat '${p}'`); + return this.statImpl(`fstat '${p}'`, resolvedP, opts); + } + async lstatPromise(p, opts = { bigint: false }) { + if (opts.bigint) + return this.lstatSync(p, { bigint: true }); + return this.lstatSync(p); + } + lstatSync(p, opts = { bigint: false, throwIfNoEntry: true }) { + const resolvedP = this.resolveFilename(`lstat '${p}'`, p, false, opts.throwIfNoEntry); + if (resolvedP === void 0) + return void 0; + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) { + if (opts.throwIfNoEntry === false) + return void 0; + throw ENOENT(`lstat '${p}'`); + } + if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) + throw ENOTDIR(`lstat '${p}'`); + return this.statImpl(`lstat '${p}'`, resolvedP, opts); + } + statImpl(reason, p, opts = {}) { + const entry = this.entries.get(p); + if (typeof entry !== `undefined`) { + const stat = this.libzip.struct.statS(); + const rc = this.libzip.statIndex(this.zip, entry, 0, 0, stat); + if (rc === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + const uid = this.stats.uid; + const gid = this.stats.gid; + const size = this.libzip.struct.statSize(stat) >>> 0; + const blksize = 512; + const blocks = Math.ceil(size / blksize); + const mtimeMs = (this.libzip.struct.statMtime(stat) >>> 0) * 1e3; + const atimeMs = mtimeMs; + const birthtimeMs = mtimeMs; + const ctimeMs = mtimeMs; + const atime = new Date(atimeMs); + const birthtime = new Date(birthtimeMs); + const ctime = new Date(ctimeMs); + const mtime = new Date(mtimeMs); + const type = this.listings.has(p) ? fs.constants.S_IFDIR : this.isSymbolicLink(entry) ? fs.constants.S_IFLNK : fs.constants.S_IFREG; + const defaultMode = type === fs.constants.S_IFDIR ? 493 : 420; + const mode = type | this.getUnixMode(entry, defaultMode) & 511; + const crc = this.libzip.struct.statCrc(stat); + const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); + return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; + } + if (this.listings.has(p)) { + const uid = this.stats.uid; + const gid = this.stats.gid; + const size = 0; + const blksize = 512; + const blocks = 0; + const atimeMs = this.stats.mtimeMs; + const birthtimeMs = this.stats.mtimeMs; + const ctimeMs = this.stats.mtimeMs; + const mtimeMs = this.stats.mtimeMs; + const atime = new Date(atimeMs); + const birthtime = new Date(birthtimeMs); + const ctime = new Date(ctimeMs); + const mtime = new Date(mtimeMs); + const mode = fs.constants.S_IFDIR | 493; + const crc = 0; + const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); + return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; + } + throw new Error(`Unreachable`); + } + getUnixMode(index, defaultMode) { + const rc = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); + if (rc === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; + if (opsys !== this.libzip.ZIP_OPSYS_UNIX) + return defaultMode; + return this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; + } + registerListing(p) { + const existingListing = this.listings.get(p); + if (existingListing) + return existingListing; + const parentListing = this.registerListing(ppath.dirname(p)); + parentListing.add(ppath.basename(p)); + const newListing = /* @__PURE__ */ new Set(); + this.listings.set(p, newListing); + return newListing; + } + registerEntry(p, index) { + const parentListing = this.registerListing(ppath.dirname(p)); + parentListing.add(ppath.basename(p)); + this.entries.set(p, index); + } + unregisterListing(p) { + this.listings.delete(p); + const parentListing = this.listings.get(ppath.dirname(p)); + parentListing == null ? void 0 : parentListing.delete(ppath.basename(p)); + } + unregisterEntry(p) { + this.unregisterListing(p); + const entry = this.entries.get(p); + this.entries.delete(p); + if (typeof entry === `undefined`) + return; + this.fileSources.delete(entry); + if (this.isSymbolicLink(entry)) { + this.symlinkCount--; + } + } + deleteEntry(p, index) { + this.unregisterEntry(p); + const rc = this.libzip.delete(this.zip, index); + if (rc === -1) { + throw this.makeLibzipError(this.libzip.getError(this.zip)); + } + } + resolveFilename(reason, p, resolveLastComponent = true, throwIfNoEntry = true) { + if (!this.ready) + throw EBUSY(`archive closed, ${reason}`); + let resolvedP = ppath.resolve(PortablePath.root, p); + if (resolvedP === `/`) + return PortablePath.root; + const fileIndex = this.entries.get(resolvedP); + if (resolveLastComponent && fileIndex !== void 0) { + if (this.symlinkCount !== 0 && this.isSymbolicLink(fileIndex)) { + const target = this.getFileSource(fileIndex).toString(); + return this.resolveFilename(reason, ppath.resolve(ppath.dirname(resolvedP), target), true, throwIfNoEntry); + } else { + return resolvedP; + } + } + while (true) { + const parentP = this.resolveFilename(reason, ppath.dirname(resolvedP), true, throwIfNoEntry); + if (parentP === void 0) + return parentP; + const isDir = this.listings.has(parentP); + const doesExist = this.entries.has(parentP); + if (!isDir && !doesExist) { + if (throwIfNoEntry === false) + return void 0; + throw ENOENT(reason); + } + if (!isDir) + throw ENOTDIR(reason); + resolvedP = ppath.resolve(parentP, ppath.basename(resolvedP)); + if (!resolveLastComponent || this.symlinkCount === 0) + break; + const index = this.libzip.name.locate(this.zip, resolvedP.slice(1), 0); + if (index === -1) + break; + if (this.isSymbolicLink(index)) { + const target = this.getFileSource(index).toString(); + resolvedP = ppath.resolve(ppath.dirname(resolvedP), target); + } else { + break; + } + } + return resolvedP; + } + allocateBuffer(content) { + if (!Buffer.isBuffer(content)) + content = Buffer.from(content); + const buffer = this.libzip.malloc(content.byteLength); + if (!buffer) + throw new Error(`Couldn't allocate enough memory`); + const heap = new Uint8Array(this.libzip.HEAPU8.buffer, buffer, content.byteLength); + heap.set(content); + return { buffer, byteLength: content.byteLength }; + } + allocateUnattachedSource(content) { + const error = this.libzip.struct.errorS(); + const { buffer, byteLength } = this.allocateBuffer(content); + const source = this.libzip.source.fromUnattachedBuffer(buffer, byteLength, 0, 1, error); + if (source === 0) { + this.libzip.free(error); + throw this.makeLibzipError(error); + } + return source; + } + allocateSource(content) { + const { buffer, byteLength } = this.allocateBuffer(content); + const source = this.libzip.source.fromBuffer(this.zip, buffer, byteLength, 0, 1); + if (source === 0) { + this.libzip.free(buffer); + throw this.makeLibzipError(this.libzip.getError(this.zip)); + } + return source; + } + setFileSource(p, content) { + const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content); + const target = ppath.relative(PortablePath.root, p); + const lzSource = this.allocateSource(content); + try { + const newIndex = this.libzip.file.add(this.zip, target, lzSource, this.libzip.ZIP_FL_OVERWRITE); + if (newIndex === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + if (this.level !== `mixed`) { + const method = this.level === 0 ? this.libzip.ZIP_CM_STORE : this.libzip.ZIP_CM_DEFLATE; + const rc = this.libzip.file.setCompression(this.zip, newIndex, 0, method, this.level); + if (rc === -1) { + throw this.makeLibzipError(this.libzip.getError(this.zip)); + } + } + this.fileSources.set(newIndex, buffer); + return newIndex; + } catch (error) { + this.libzip.source.free(lzSource); + throw error; + } + } + isSymbolicLink(index) { + if (this.symlinkCount === 0) + return false; + const attrs = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); + if (attrs === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; + if (opsys !== this.libzip.ZIP_OPSYS_UNIX) + return false; + const attributes = this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; + return (attributes & fs.constants.S_IFMT) === fs.constants.S_IFLNK; + } + getFileSource(index, opts = { asyncDecompress: false }) { + const cachedFileSource = this.fileSources.get(index); + if (typeof cachedFileSource !== `undefined`) + return cachedFileSource; + const stat = this.libzip.struct.statS(); + const rc = this.libzip.statIndex(this.zip, index, 0, 0, stat); + if (rc === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + const size = this.libzip.struct.statCompSize(stat); + const compressionMethod = this.libzip.struct.statCompMethod(stat); + const buffer = this.libzip.malloc(size); + try { + const file = this.libzip.fopenIndex(this.zip, index, 0, this.libzip.ZIP_FL_COMPRESSED); + if (file === 0) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + try { + const rc2 = this.libzip.fread(file, buffer, size, 0); + if (rc2 === -1) + throw this.makeLibzipError(this.libzip.file.getError(file)); + else if (rc2 < size) + throw new Error(`Incomplete read`); + else if (rc2 > size) + throw new Error(`Overread`); + const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); + const data = Buffer.from(memory); + if (compressionMethod === 0) { + this.fileSources.set(index, data); + return data; + } else if (opts.asyncDecompress) { + return new Promise((resolve, reject) => { + zlib__default.default.inflateRaw(data, (error, result) => { + if (error) { + reject(error); + } else { + this.fileSources.set(index, result); + resolve(result); + } + }); + }); + } else { + const decompressedData = zlib__default.default.inflateRawSync(data); + this.fileSources.set(index, decompressedData); + return decompressedData; + } + } finally { + this.libzip.fclose(file); + } + } finally { + this.libzip.free(buffer); + } + } + async fchmodPromise(fd, mask) { + return this.chmodPromise(this.fdToPath(fd, `fchmod`), mask); + } + fchmodSync(fd, mask) { + return this.chmodSync(this.fdToPath(fd, `fchmodSync`), mask); + } + async chmodPromise(p, mask) { + return this.chmodSync(p, mask); + } + chmodSync(p, mask) { + if (this.readOnly) + throw EROFS(`chmod '${p}'`); + mask &= 493; + const resolvedP = this.resolveFilename(`chmod '${p}'`, p, false); + const entry = this.entries.get(resolvedP); + if (typeof entry === `undefined`) + throw new Error(`Assertion failed: The entry should have been registered (${resolvedP})`); + const oldMod = this.getUnixMode(entry, fs.constants.S_IFREG | 0); + const newMod = oldMod & ~511 | mask; + const rc = this.libzip.file.setExternalAttributes(this.zip, entry, 0, 0, this.libzip.ZIP_OPSYS_UNIX, newMod << 16); + if (rc === -1) { + throw this.makeLibzipError(this.libzip.getError(this.zip)); + } + } + async fchownPromise(fd, uid, gid) { + return this.chownPromise(this.fdToPath(fd, `fchown`), uid, gid); + } + fchownSync(fd, uid, gid) { + return this.chownSync(this.fdToPath(fd, `fchownSync`), uid, gid); + } + async chownPromise(p, uid, gid) { + return this.chownSync(p, uid, gid); + } + chownSync(p, uid, gid) { + throw new Error(`Unimplemented`); + } + async renamePromise(oldP, newP) { + return this.renameSync(oldP, newP); + } + renameSync(oldP, newP) { + throw new Error(`Unimplemented`); + } + async copyFilePromise(sourceP, destP, flags) { + const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); + const source = await this.getFileSource(indexSource, { asyncDecompress: true }); + const newIndex = this.setFileSource(resolvedDestP, source); + if (newIndex !== indexDest) { + this.registerEntry(resolvedDestP, newIndex); + } + } + copyFileSync(sourceP, destP, flags = 0) { + const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); + const source = this.getFileSource(indexSource); + const newIndex = this.setFileSource(resolvedDestP, source); + if (newIndex !== indexDest) { + this.registerEntry(resolvedDestP, newIndex); + } + } + prepareCopyFile(sourceP, destP, flags = 0) { + if (this.readOnly) + throw EROFS(`copyfile '${sourceP} -> '${destP}'`); + if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) + throw ENOSYS(`unsupported clone operation`, `copyfile '${sourceP}' -> ${destP}'`); + const resolvedSourceP = this.resolveFilename(`copyfile '${sourceP} -> ${destP}'`, sourceP); + const indexSource = this.entries.get(resolvedSourceP); + if (typeof indexSource === `undefined`) + throw EINVAL(`copyfile '${sourceP}' -> '${destP}'`); + const resolvedDestP = this.resolveFilename(`copyfile '${sourceP}' -> ${destP}'`, destP); + const indexDest = this.entries.get(resolvedDestP); + if ((flags & (fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE_FORCE)) !== 0 && typeof indexDest !== `undefined`) + throw EEXIST(`copyfile '${sourceP}' -> '${destP}'`); + return { + indexSource, + resolvedDestP, + indexDest + }; + } + async appendFilePromise(p, content, opts) { + if (this.readOnly) + throw EROFS(`open '${p}'`); + if (typeof opts === `undefined`) + opts = { flag: `a` }; + else if (typeof opts === `string`) + opts = { flag: `a`, encoding: opts }; + else if (typeof opts.flag === `undefined`) + opts = { flag: `a`, ...opts }; + return this.writeFilePromise(p, content, opts); + } + appendFileSync(p, content, opts = {}) { + if (this.readOnly) + throw EROFS(`open '${p}'`); + if (typeof opts === `undefined`) + opts = { flag: `a` }; + else if (typeof opts === `string`) + opts = { flag: `a`, encoding: opts }; + else if (typeof opts.flag === `undefined`) + opts = { flag: `a`, ...opts }; + return this.writeFileSync(p, content, opts); + } + fdToPath(fd, reason) { + var _a; + const path = (_a = this.fds.get(fd)) == null ? void 0 : _a.p; + if (typeof path === `undefined`) + throw EBADF(reason); + return path; + } + async writeFilePromise(p, content, opts) { + const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); + if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) + content = Buffer.concat([await this.getFileSource(index, { asyncDecompress: true }), Buffer.from(content)]); + if (encoding !== null) + content = content.toString(encoding); + const newIndex = this.setFileSource(resolvedP, content); + if (newIndex !== index) + this.registerEntry(resolvedP, newIndex); + if (mode !== null) { + await this.chmodPromise(resolvedP, mode); + } + } + writeFileSync(p, content, opts) { + const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); + if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) + content = Buffer.concat([this.getFileSource(index), Buffer.from(content)]); + if (encoding !== null) + content = content.toString(encoding); + const newIndex = this.setFileSource(resolvedP, content); + if (newIndex !== index) + this.registerEntry(resolvedP, newIndex); + if (mode !== null) { + this.chmodSync(resolvedP, mode); + } + } + prepareWriteFile(p, opts) { + if (typeof p === `number`) + p = this.fdToPath(p, `read`); + if (this.readOnly) + throw EROFS(`open '${p}'`); + const resolvedP = this.resolveFilename(`open '${p}'`, p); + if (this.listings.has(resolvedP)) + throw EISDIR(`open '${p}'`); + let encoding = null, mode = null; + if (typeof opts === `string`) { + encoding = opts; + } else if (typeof opts === `object`) { + ({ + encoding = null, + mode = null + } = opts); + } + const index = this.entries.get(resolvedP); + return { + encoding, + mode, + resolvedP, + index + }; + } + async unlinkPromise(p) { + return this.unlinkSync(p); + } + unlinkSync(p) { + if (this.readOnly) + throw EROFS(`unlink '${p}'`); + const resolvedP = this.resolveFilename(`unlink '${p}'`, p); + if (this.listings.has(resolvedP)) + throw EISDIR(`unlink '${p}'`); + const index = this.entries.get(resolvedP); + if (typeof index === `undefined`) + throw EINVAL(`unlink '${p}'`); + this.deleteEntry(resolvedP, index); + } + async utimesPromise(p, atime, mtime) { + return this.utimesSync(p, atime, mtime); + } + utimesSync(p, atime, mtime) { + if (this.readOnly) + throw EROFS(`utimes '${p}'`); + const resolvedP = this.resolveFilename(`utimes '${p}'`, p); + this.utimesImpl(resolvedP, mtime); + } + async lutimesPromise(p, atime, mtime) { + return this.lutimesSync(p, atime, mtime); + } + lutimesSync(p, atime, mtime) { + if (this.readOnly) + throw EROFS(`lutimes '${p}'`); + const resolvedP = this.resolveFilename(`utimes '${p}'`, p, false); + this.utimesImpl(resolvedP, mtime); + } + utimesImpl(resolvedP, mtime) { + if (this.listings.has(resolvedP)) { + if (!this.entries.has(resolvedP)) + this.hydrateDirectory(resolvedP); + } + const entry = this.entries.get(resolvedP); + if (entry === void 0) + throw new Error(`Unreachable`); + const rc = this.libzip.file.setMtime(this.zip, entry, 0, toUnixTimestamp(mtime), 0); + if (rc === -1) { + throw this.makeLibzipError(this.libzip.getError(this.zip)); + } + } + async mkdirPromise(p, opts) { + return this.mkdirSync(p, opts); + } + mkdirSync(p, { mode = 493, recursive = false } = {}) { + if (recursive) + return this.mkdirpSync(p, { chmod: mode }); + if (this.readOnly) + throw EROFS(`mkdir '${p}'`); + const resolvedP = this.resolveFilename(`mkdir '${p}'`, p); + if (this.entries.has(resolvedP) || this.listings.has(resolvedP)) + throw EEXIST(`mkdir '${p}'`); + this.hydrateDirectory(resolvedP); + this.chmodSync(resolvedP, mode); + return void 0; + } + async rmdirPromise(p, opts) { + return this.rmdirSync(p, opts); + } + rmdirSync(p, { recursive = false } = {}) { + if (this.readOnly) + throw EROFS(`rmdir '${p}'`); + if (recursive) { + this.removeSync(p); + return; + } + const resolvedP = this.resolveFilename(`rmdir '${p}'`, p); + const directoryListing = this.listings.get(resolvedP); + if (!directoryListing) + throw ENOTDIR(`rmdir '${p}'`); + if (directoryListing.size > 0) + throw ENOTEMPTY(`rmdir '${p}'`); + const index = this.entries.get(resolvedP); + if (typeof index === `undefined`) + throw EINVAL(`rmdir '${p}'`); + this.deleteEntry(p, index); + } + hydrateDirectory(resolvedP) { + const index = this.libzip.dir.add(this.zip, ppath.relative(PortablePath.root, resolvedP)); + if (index === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + this.registerListing(resolvedP); + this.registerEntry(resolvedP, index); + return index; + } + async linkPromise(existingP, newP) { + return this.linkSync(existingP, newP); + } + linkSync(existingP, newP) { + throw EOPNOTSUPP(`link '${existingP}' -> '${newP}'`); + } + async symlinkPromise(target, p) { + return this.symlinkSync(target, p); + } + symlinkSync(target, p) { + if (this.readOnly) + throw EROFS(`symlink '${target}' -> '${p}'`); + const resolvedP = this.resolveFilename(`symlink '${target}' -> '${p}'`, p); + if (this.listings.has(resolvedP)) + throw EISDIR(`symlink '${target}' -> '${p}'`); + if (this.entries.has(resolvedP)) + throw EEXIST(`symlink '${target}' -> '${p}'`); + const index = this.setFileSource(resolvedP, target); + this.registerEntry(resolvedP, index); + const rc = this.libzip.file.setExternalAttributes(this.zip, index, 0, 0, this.libzip.ZIP_OPSYS_UNIX, (fs.constants.S_IFLNK | 511) << 16); + if (rc === -1) + throw this.makeLibzipError(this.libzip.getError(this.zip)); + this.symlinkCount += 1; + } + async readFilePromise(p, encoding) { + if (typeof encoding === `object`) + encoding = encoding ? encoding.encoding : void 0; + const data = await this.readFileBuffer(p, { asyncDecompress: true }); + return encoding ? data.toString(encoding) : data; + } + readFileSync(p, encoding) { + if (typeof encoding === `object`) + encoding = encoding ? encoding.encoding : void 0; + const data = this.readFileBuffer(p); + return encoding ? data.toString(encoding) : data; + } + readFileBuffer(p, opts = { asyncDecompress: false }) { + if (typeof p === `number`) + p = this.fdToPath(p, `read`); + const resolvedP = this.resolveFilename(`open '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) + throw ENOENT(`open '${p}'`); + if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) + throw ENOTDIR(`open '${p}'`); + if (this.listings.has(resolvedP)) + throw EISDIR(`read`); + const entry = this.entries.get(resolvedP); + if (entry === void 0) + throw new Error(`Unreachable`); + return this.getFileSource(entry, opts); + } + async readdirPromise(p, opts) { + return this.readdirSync(p, opts); + } + readdirSync(p, opts) { + const resolvedP = this.resolveFilename(`scandir '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) + throw ENOENT(`scandir '${p}'`); + const directoryListing = this.listings.get(resolvedP); + if (!directoryListing) + throw ENOTDIR(`scandir '${p}'`); + const entries = [...directoryListing]; + if (!(opts == null ? void 0 : opts.withFileTypes)) + return entries; + return entries.map((name) => { + return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { + name + }); + }); + } + async readlinkPromise(p) { + const entry = this.prepareReadlink(p); + return (await this.getFileSource(entry, { asyncDecompress: true })).toString(); + } + readlinkSync(p) { + const entry = this.prepareReadlink(p); + return this.getFileSource(entry).toString(); + } + prepareReadlink(p) { + const resolvedP = this.resolveFilename(`readlink '${p}'`, p, false); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) + throw ENOENT(`readlink '${p}'`); + if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) + throw ENOTDIR(`open '${p}'`); + if (this.listings.has(resolvedP)) + throw EINVAL(`readlink '${p}'`); + const entry = this.entries.get(resolvedP); + if (entry === void 0) + throw new Error(`Unreachable`); + if (!this.isSymbolicLink(entry)) + throw EINVAL(`readlink '${p}'`); + return entry; + } + async truncatePromise(p, len = 0) { + const resolvedP = this.resolveFilename(`open '${p}'`, p); + const index = this.entries.get(resolvedP); + if (typeof index === `undefined`) + throw EINVAL(`open '${p}'`); + const source = await this.getFileSource(index, { asyncDecompress: true }); + const truncated = Buffer.alloc(len, 0); + source.copy(truncated); + return await this.writeFilePromise(p, truncated); + } + truncateSync(p, len = 0) { + const resolvedP = this.resolveFilename(`open '${p}'`, p); + const index = this.entries.get(resolvedP); + if (typeof index === `undefined`) + throw EINVAL(`open '${p}'`); + const source = this.getFileSource(index); + const truncated = Buffer.alloc(len, 0); + source.copy(truncated); + return this.writeFileSync(p, truncated); + } + async ftruncatePromise(fd, len) { + return this.truncatePromise(this.fdToPath(fd, `ftruncate`), len); + } + ftruncateSync(fd, len) { + return this.truncateSync(this.fdToPath(fd, `ftruncateSync`), len); + } + watch(p, a, b) { + let persistent; + switch (typeof a) { + case `function`: + case `string`: + case `undefined`: + { + persistent = true; + } + break; + default: + { + ({ persistent = true } = a); + } + break; + } + if (!persistent) + return { on: () => { + }, close: () => { + } }; + const interval = setInterval(() => { + }, 24 * 60 * 60 * 1e3); + return { on: () => { + }, close: () => { + clearInterval(interval); + } }; + } + watchFile(p, a, b) { + const resolvedP = ppath.resolve(PortablePath.root, p); + return watchFile(this, resolvedP, a, b); + } + unwatchFile(p, cb) { + const resolvedP = ppath.resolve(PortablePath.root, p); + return unwatchFile(this, resolvedP, cb); + } +} + +setFactory(() => { + const emZip = createModule(); + return makeInterface(emZip); +}); + +var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => { + ErrorCode2["API_ERROR"] = `API_ERROR`; + ErrorCode2["BUILTIN_NODE_RESOLUTION_FAILED"] = `BUILTIN_NODE_RESOLUTION_FAILED`; + ErrorCode2["EXPORTS_RESOLUTION_FAILED"] = `EXPORTS_RESOLUTION_FAILED`; + ErrorCode2["MISSING_DEPENDENCY"] = `MISSING_DEPENDENCY`; + ErrorCode2["MISSING_PEER_DEPENDENCY"] = `MISSING_PEER_DEPENDENCY`; + ErrorCode2["QUALIFIED_PATH_RESOLUTION_FAILED"] = `QUALIFIED_PATH_RESOLUTION_FAILED`; + ErrorCode2["INTERNAL"] = `INTERNAL`; + ErrorCode2["UNDECLARED_DEPENDENCY"] = `UNDECLARED_DEPENDENCY`; + ErrorCode2["UNSUPPORTED"] = `UNSUPPORTED`; + return ErrorCode2; +})(ErrorCode || {}); +const MODULE_NOT_FOUND_ERRORS = /* @__PURE__ */ new Set([ + "BUILTIN_NODE_RESOLUTION_FAILED" /* BUILTIN_NODE_RESOLUTION_FAILED */, + "MISSING_DEPENDENCY" /* MISSING_DEPENDENCY */, + "MISSING_PEER_DEPENDENCY" /* MISSING_PEER_DEPENDENCY */, + "QUALIFIED_PATH_RESOLUTION_FAILED" /* QUALIFIED_PATH_RESOLUTION_FAILED */, + "UNDECLARED_DEPENDENCY" /* UNDECLARED_DEPENDENCY */ +]); +function makeError(pnpCode, message, data = {}, code) { + code ?? (code = MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode); + const propertySpec = { + configurable: true, + writable: true, + enumerable: false + }; + return Object.defineProperties(new Error(message), { + code: { + ...propertySpec, + value: code + }, + pnpCode: { + ...propertySpec, + value: pnpCode + }, + data: { + ...propertySpec, + value: data + } + }); +} +function getIssuerModule(parent) { + let issuer = parent; + while (issuer && (issuer.id === `[eval]` || issuer.id === `` || !issuer.filename)) + issuer = issuer.parent; + return issuer || null; +} +function getPathForDisplay(p) { + return npath.normalize(npath.fromPortablePath(p)); +} + +const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10)); +const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13; + +const builtinModules = new Set(require$$0.Module.builtinModules || Object.keys(process.binding(`natives`))); +const isBuiltinModule = (request) => request.startsWith(`node:`) || builtinModules.has(request); +function readPackageScope(checkPath) { + const rootSeparatorIndex = checkPath.indexOf(npath.sep); + let separatorIndex; + do { + separatorIndex = checkPath.lastIndexOf(npath.sep); + checkPath = checkPath.slice(0, separatorIndex); + if (checkPath.endsWith(`${npath.sep}node_modules`)) + return false; + const pjson = readPackage(checkPath + npath.sep); + if (pjson) { + return { + data: pjson, + path: checkPath + }; + } + } while (separatorIndex > rootSeparatorIndex); + return false; +} +function readPackage(requestPath) { + const jsonPath = npath.resolve(requestPath, `package.json`); + if (!fs__default.default.existsSync(jsonPath)) + return null; + return JSON.parse(fs__default.default.readFileSync(jsonPath, `utf8`)); +} +function ERR_REQUIRE_ESM(filename, parentPath = null) { + const basename = parentPath && path__default.default.basename(filename) === path__default.default.basename(parentPath) ? filename : path__default.default.basename(filename); + const msg = `require() of ES Module ${filename}${parentPath ? ` from ${parentPath}` : ``} not supported. +Instead change the require of ${basename} in ${parentPath} to a dynamic import() which is available in all CommonJS modules.`; + const err = new Error(msg); + err.code = `ERR_REQUIRE_ESM`; + return err; +} +function reportRequiredFilesToWatchMode(files) { + if (process.env.WATCH_REPORT_DEPENDENCIES && process.send) { + files = files.map((filename) => npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename)))); + if (WATCH_MODE_MESSAGE_USES_ARRAYS) { + process.send({ "watch:require": files }); + } else { + for (const filename of files) { + process.send({ "watch:require": filename }); + } + } + } +} + +function applyPatch(pnpapi, opts) { + const defaultCache = {}; + let enableNativeHooks = true; + process.versions.pnp = String(pnpapi.VERSIONS.std); + const moduleExports = require$$0__default.default; + moduleExports.findPnpApi = (lookupSource) => { + const lookupPath = lookupSource instanceof url.URL ? url.fileURLToPath(lookupSource) : lookupSource; + const apiPath = opts.manager.findApiPathFor(lookupPath); + if (apiPath === null) + return null; + const apiEntry = opts.manager.getApiEntry(apiPath, true); + return apiEntry.instance.findPackageLocator(lookupPath) ? apiEntry.instance : null; + }; + function getRequireStack(parent) { + const requireStack = []; + for (let cursor = parent; cursor; cursor = cursor.parent) + requireStack.push(cursor.filename || cursor.id); + return requireStack; + } + const originalModuleLoad = require$$0.Module._load; + require$$0.Module._load = function(request, parent, isMain) { + if (!enableNativeHooks) + return originalModuleLoad.call(require$$0.Module, request, parent, isMain); + if (isBuiltinModule(request)) { + try { + enableNativeHooks = false; + return originalModuleLoad.call(require$$0.Module, request, parent, isMain); + } finally { + enableNativeHooks = true; + } + } + const parentApiPath = opts.manager.getApiPathFromParent(parent); + const parentApi = parentApiPath !== null ? opts.manager.getApiEntry(parentApiPath, true).instance : null; + if (parentApi === null) + return originalModuleLoad(request, parent, isMain); + if (request === `pnpapi`) + return parentApi; + const modulePath = require$$0.Module._resolveFilename(request, parent, isMain); + const isOwnedByRuntime = parentApi !== null ? parentApi.findPackageLocator(modulePath) !== null : false; + const moduleApiPath = isOwnedByRuntime ? parentApiPath : opts.manager.findApiPathFor(npath.dirname(modulePath)); + const entry = moduleApiPath !== null ? opts.manager.getApiEntry(moduleApiPath) : { instance: null, cache: defaultCache }; + const cacheEntry = entry.cache[modulePath]; + if (cacheEntry) { + if (cacheEntry.loaded === false && cacheEntry.isLoading !== true) { + try { + cacheEntry.isLoading = true; + if (isMain) { + process.mainModule = cacheEntry; + cacheEntry.id = `.`; + } + cacheEntry.load(modulePath); + } finally { + cacheEntry.isLoading = false; + } + } + return cacheEntry.exports; + } + const module = new require$$0.Module(modulePath, parent ?? void 0); + module.pnpApiPath = moduleApiPath; + reportRequiredFilesToWatchMode([modulePath]); + entry.cache[modulePath] = module; + if (isMain) { + process.mainModule = module; + module.id = `.`; + } + let hasThrown = true; + try { + module.isLoading = true; + module.load(modulePath); + hasThrown = false; + } finally { + module.isLoading = false; + if (hasThrown) { + delete require$$0.Module._cache[modulePath]; + } + } + return module.exports; + }; + function getIssuerSpecsFromPaths(paths) { + return paths.map((path) => ({ + apiPath: opts.manager.findApiPathFor(path), + path, + module: null + })); + } + function getIssuerSpecsFromModule(module) { + if (module && module.id !== `` && module.id !== `internal/preload` && !module.parent && !module.filename && module.paths.length > 0) { + return [{ + apiPath: opts.manager.findApiPathFor(module.paths[0]), + path: module.paths[0], + module + }]; + } + const issuer = getIssuerModule(module); + if (issuer !== null) { + const path = npath.dirname(issuer.filename); + const apiPath = opts.manager.getApiPathFromParent(issuer); + return [{ apiPath, path, module }]; + } else { + const path = process.cwd(); + const apiPath = opts.manager.findApiPathFor(npath.join(path, `[file]`)) ?? opts.manager.getApiPathFromParent(null); + return [{ apiPath, path, module }]; + } + } + function makeFakeParent(path) { + const fakeParent = new require$$0.Module(``); + const fakeFilePath = npath.join(path, `[file]`); + fakeParent.paths = require$$0.Module._nodeModulePaths(fakeFilePath); + return fakeParent; + } + const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:@[^/]+\/)?[^/]+)\/*(.*|)$/; + const originalModuleResolveFilename = require$$0.Module._resolveFilename; + require$$0.Module._resolveFilename = function(request, parent, isMain, options) { + if (isBuiltinModule(request)) + return request; + if (!enableNativeHooks) + return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, options); + if (options && options.plugnplay === false) { + const { plugnplay, ...rest } = options; + const forwardedOptions = Object.keys(rest).length > 0 ? rest : void 0; + try { + enableNativeHooks = false; + return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, forwardedOptions); + } finally { + enableNativeHooks = true; + } + } + if (options) { + const optionNames = new Set(Object.keys(options)); + optionNames.delete(`paths`); + optionNames.delete(`plugnplay`); + if (optionNames.size > 0) { + throw makeError( + ErrorCode.UNSUPPORTED, + `Some options passed to require() aren't supported by PnP yet (${Array.from(optionNames).join(`, `)})` + ); + } + } + const issuerSpecs = options && options.paths ? getIssuerSpecsFromPaths(options.paths) : getIssuerSpecsFromModule(parent); + if (request.match(pathRegExp) === null) { + const parentDirectory = (parent == null ? void 0 : parent.filename) != null ? npath.dirname(parent.filename) : null; + const absoluteRequest = npath.isAbsolute(request) ? request : parentDirectory !== null ? npath.resolve(parentDirectory, request) : null; + if (absoluteRequest !== null) { + const apiPath = parentDirectory === npath.dirname(absoluteRequest) && (parent == null ? void 0 : parent.pnpApiPath) ? parent.pnpApiPath : opts.manager.findApiPathFor(absoluteRequest); + if (apiPath !== null) { + issuerSpecs.unshift({ + apiPath, + path: parentDirectory, + module: null + }); + } + } + } + let firstError; + for (const { apiPath, path, module } of issuerSpecs) { + let resolution; + const issuerApi = apiPath !== null ? opts.manager.getApiEntry(apiPath, true).instance : null; + try { + if (issuerApi !== null) { + resolution = issuerApi.resolveRequest(request, path !== null ? `${path}/` : null); + } else { + if (path === null) + throw new Error(`Assertion failed: Expected the path to be set`); + resolution = originalModuleResolveFilename.call(require$$0.Module, request, module || makeFakeParent(path), isMain); + } + } catch (error) { + firstError = firstError || error; + continue; + } + if (resolution !== null) { + return resolution; + } + } + const requireStack = getRequireStack(parent); + Object.defineProperty(firstError, `requireStack`, { + configurable: true, + writable: true, + enumerable: false, + value: requireStack + }); + if (requireStack.length > 0) + firstError.message += ` +Require stack: +- ${requireStack.join(` +- `)}`; + if (typeof firstError.pnpCode === `string`) + Error.captureStackTrace(firstError); + throw firstError; + }; + const originalFindPath = require$$0.Module._findPath; + require$$0.Module._findPath = function(request, paths, isMain) { + if (request === `pnpapi`) + return false; + if (!enableNativeHooks) + return originalFindPath.call(require$$0.Module, request, paths, isMain); + const isAbsolute = npath.isAbsolute(request); + if (isAbsolute) + paths = [``]; + else if (!paths || paths.length === 0) + return false; + for (const path of paths) { + let resolution; + try { + const pnpApiPath = opts.manager.findApiPathFor(isAbsolute ? request : path); + if (pnpApiPath !== null) { + const api = opts.manager.getApiEntry(pnpApiPath, true).instance; + resolution = api.resolveRequest(request, path) || false; + } else { + resolution = originalFindPath.call(require$$0.Module, request, [path], isMain); + } + } catch (error) { + continue; + } + if (resolution) { + return resolution; + } + } + return false; + }; + const originalExtensionJSFunction = require$$0.Module._extensions[`.js`]; + require$$0.Module._extensions[`.js`] = function(module, filename) { + var _a, _b; + if (filename.endsWith(`.js`)) { + const pkg = readPackageScope(filename); + if (pkg && ((_a = pkg.data) == null ? void 0 : _a.type) === `module`) { + const err = ERR_REQUIRE_ESM(filename, (_b = module.parent) == null ? void 0 : _b.filename); + Error.captureStackTrace(err); + throw err; + } + } + originalExtensionJSFunction.call(this, module, filename); + }; + const originalDlopen = process.dlopen; + process.dlopen = function(...args) { + const [module, filename, ...rest] = args; + return originalDlopen.call( + this, + module, + npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))), + ...rest + ); + }; + const originalEmit = process.emit; + process.emit = function(name, data, ...args) { + if (name === `warning` && typeof data === `object` && data.name === `ExperimentalWarning` && (data.message.includes(`--experimental-loader`) || data.message.includes(`Custom ESM Loaders is an experimental feature`))) + return false; + return originalEmit.apply(process, arguments); + }; + patchFs(fs__default.default, new PosixFS(opts.fakeFs)); +} + +function hydrateRuntimeState(data, { basePath }) { + const portablePath = npath.toPortablePath(basePath); + const absolutePortablePath = ppath.resolve(portablePath); + const ignorePattern = data.ignorePatternData !== null ? new RegExp(data.ignorePatternData) : null; + const packageLocatorsByLocations = /* @__PURE__ */ new Map(); + const packageRegistry = new Map(data.packageRegistryData.map(([packageName, packageStoreData]) => { + return [packageName, new Map(packageStoreData.map(([packageReference, packageInformationData]) => { + if (packageName === null !== (packageReference === null)) + throw new Error(`Assertion failed: The name and reference should be null, or neither should`); + const discardFromLookup = packageInformationData.discardFromLookup ?? false; + const packageLocator = { name: packageName, reference: packageReference }; + const entry = packageLocatorsByLocations.get(packageInformationData.packageLocation); + if (!entry) { + packageLocatorsByLocations.set(packageInformationData.packageLocation, { locator: packageLocator, discardFromLookup }); + } else { + entry.discardFromLookup = entry.discardFromLookup && discardFromLookup; + if (!discardFromLookup) { + entry.locator = packageLocator; + } + } + let resolvedPackageLocation = null; + return [packageReference, { + packageDependencies: new Map(packageInformationData.packageDependencies), + packagePeers: new Set(packageInformationData.packagePeers), + linkType: packageInformationData.linkType, + discardFromLookup, + get packageLocation() { + return resolvedPackageLocation || (resolvedPackageLocation = ppath.join(absolutePortablePath, packageInformationData.packageLocation)); + } + }]; + }))]; + })); + const fallbackExclusionList = new Map(data.fallbackExclusionList.map(([packageName, packageReferences]) => { + return [packageName, new Set(packageReferences)]; + })); + const fallbackPool = new Map(data.fallbackPool); + const dependencyTreeRoots = data.dependencyTreeRoots; + const enableTopLevelFallback = data.enableTopLevelFallback; + return { + basePath: portablePath, + dependencyTreeRoots, + enableTopLevelFallback, + fallbackExclusionList, + fallbackPool, + ignorePattern, + packageLocatorsByLocations, + packageRegistry + }; +} + +/** + * @param {object} exports + * @param {Set} keys + */ +function loop(exports, keys) { + if (typeof exports === 'string') { + return exports; + } + + if (exports) { + let idx, tmp; + if (Array.isArray(exports)) { + for (idx=0; idx < exports.length; idx++) { + if (tmp = loop(exports[idx], keys)) return tmp; + } + } else { + for (idx in exports) { + if (keys.has(idx)) { + return loop(exports[idx], keys); + } + } + } + } +} + +/** + * @param {string} name The package name + * @param {string} entry The target entry, eg "." + * @param {number} [condition] Unmatched condition? + */ +function bail(name, entry, condition) { + throw new Error( + condition + ? `No known conditions for "${entry}" entry in "${name}" package` + : `Missing "${entry}" export in "${name}" package` + ); +} + +/** + * @param {string} name the package name + * @param {string} entry the target path/import + */ +function toName(name, entry) { + return entry === name ? '.' + : entry[0] === '.' ? entry + : entry.replace(new RegExp('^' + name + '\/'), './'); +} + +/** + * @param {object} pkg package.json contents + * @param {string} [entry] entry name or import path + * @param {object} [options] + * @param {boolean} [options.browser] + * @param {boolean} [options.require] + * @param {string[]} [options.conditions] + * @param {boolean} [options.unsafe] + */ +function resolve(pkg, entry='.', options={}) { + let { name, exports } = pkg; + + if (exports) { + let { browser, require, unsafe, conditions=[] } = options; + + let target = toName(name, entry); + if (target[0] !== '.') target = './' + target; + + if (typeof exports === 'string') { + return target === '.' ? exports : bail(name, target); + } + + let allows = new Set(['default', ...conditions]); + unsafe || allows.add(require ? 'require' : 'import'); + unsafe || allows.add(browser ? 'browser' : 'node'); + + let key, tmp, isSingle=false; + + for (key in exports) { + isSingle = key[0] !== '.'; + break; + } + + if (isSingle) { + return target === '.' + ? loop(exports, allows) || bail(name, target, 1) + : bail(name, target); + } + + if (tmp = exports[target]) { + return loop(tmp, allows) || bail(name, target, 1); + } + + for (key in exports) { + tmp = key[key.length - 1]; + if (tmp === '/' && target.startsWith(key)) { + return (tmp = loop(exports[key], allows)) + ? (tmp + target.substring(key.length)) + : bail(name, target, 1); + } + if (tmp === '*' && target.startsWith(key.slice(0, -1))) { + // do not trigger if no *content* to inject + if (target.substring(key.length - 1).length > 0) { + return (tmp = loop(exports[key], allows)) + ? tmp.replace('*', target.substring(key.length - 1)) + : bail(name, target, 1); + } + } + } + + return bail(name, target); + } +} + +const ArrayIsArray = Array.isArray; +const JSONStringify = JSON.stringify; +const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames; +const ObjectPrototypeHasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); +const RegExpPrototypeExec = (obj, string) => RegExp.prototype.exec.call(obj, string); +const RegExpPrototypeSymbolReplace = (obj, ...rest) => RegExp.prototype[Symbol.replace].apply(obj, rest); +const StringPrototypeEndsWith = (str, ...rest) => String.prototype.endsWith.apply(str, rest); +const StringPrototypeIncludes = (str, ...rest) => String.prototype.includes.apply(str, rest); +const StringPrototypeLastIndexOf = (str, ...rest) => String.prototype.lastIndexOf.apply(str, rest); +const StringPrototypeIndexOf = (str, ...rest) => String.prototype.indexOf.apply(str, rest); +const StringPrototypeReplace = (str, ...rest) => String.prototype.replace.apply(str, rest); +const StringPrototypeSlice = (str, ...rest) => String.prototype.slice.apply(str, rest); +const StringPrototypeStartsWith = (str, ...rest) => String.prototype.startsWith.apply(str, rest); +const SafeMap = Map; +const JSONParse = JSON.parse; + +function createErrorType(code, messageCreator, errorType) { + return class extends errorType { + constructor(...args) { + super(messageCreator(...args)); + this.code = code; + this.name = `${errorType.name} [${code}]`; + } + }; +} +const ERR_PACKAGE_IMPORT_NOT_DEFINED = createErrorType( + `ERR_PACKAGE_IMPORT_NOT_DEFINED`, + (specifier, packagePath, base) => { + return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ``} imported from ${base}`; + }, + TypeError +); +const ERR_INVALID_MODULE_SPECIFIER = createErrorType( + `ERR_INVALID_MODULE_SPECIFIER`, + (request, reason, base = void 0) => { + return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ``}`; + }, + TypeError +); +const ERR_INVALID_PACKAGE_TARGET = createErrorType( + `ERR_INVALID_PACKAGE_TARGET`, + (pkgPath, key, target, isImport = false, base = void 0) => { + const relError = typeof target === `string` && !isImport && target.length && !StringPrototypeStartsWith(target, `./`); + if (key === `.`) { + assert__default.default(isImport === false); + return `Invalid "exports" main target ${JSONStringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; + } + return `Invalid "${isImport ? `imports` : `exports`}" target ${JSONStringify( + target + )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; + }, + Error +); +const ERR_INVALID_PACKAGE_CONFIG = createErrorType( + `ERR_INVALID_PACKAGE_CONFIG`, + (path, base, message) => { + return `Invalid package config ${path}${base ? ` while importing ${base}` : ``}${message ? `. ${message}` : ``}`; + }, + Error +); + +function filterOwnProperties(source, keys) { + const filtered = /* @__PURE__ */ Object.create(null); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if (ObjectPrototypeHasOwnProperty(source, key)) { + filtered[key] = source[key]; + } + } + return filtered; +} + +const packageJSONCache = new SafeMap(); +function getPackageConfig(path, specifier, base, readFileSyncFn) { + const existing = packageJSONCache.get(path); + if (existing !== void 0) { + return existing; + } + const source = readFileSyncFn(path); + if (source === void 0) { + const packageConfig2 = { + pjsonPath: path, + exists: false, + main: void 0, + name: void 0, + type: "none", + exports: void 0, + imports: void 0 + }; + packageJSONCache.set(path, packageConfig2); + return packageConfig2; + } + let packageJSON; + try { + packageJSON = JSONParse(source); + } catch (error) { + throw new ERR_INVALID_PACKAGE_CONFIG( + path, + (base ? `"${specifier}" from ` : "") + url.fileURLToPath(base || specifier), + error.message + ); + } + let { imports, main, name, type } = filterOwnProperties(packageJSON, [ + "imports", + "main", + "name", + "type" + ]); + const exports = ObjectPrototypeHasOwnProperty(packageJSON, "exports") ? packageJSON.exports : void 0; + if (typeof imports !== "object" || imports === null) { + imports = void 0; + } + if (typeof main !== "string") { + main = void 0; + } + if (typeof name !== "string") { + name = void 0; + } + if (type !== "module" && type !== "commonjs") { + type = "none"; + } + const packageConfig = { + pjsonPath: path, + exists: true, + main, + name, + type, + exports, + imports + }; + packageJSONCache.set(path, packageConfig); + return packageConfig; +} +function getPackageScopeConfig(resolved, readFileSyncFn) { + let packageJSONUrl = new URL("./package.json", resolved); + while (true) { + const packageJSONPath2 = packageJSONUrl.pathname; + if (StringPrototypeEndsWith(packageJSONPath2, "node_modules/package.json")) { + break; + } + const packageConfig2 = getPackageConfig( + url.fileURLToPath(packageJSONUrl), + resolved, + void 0, + readFileSyncFn + ); + if (packageConfig2.exists) { + return packageConfig2; + } + const lastPackageJSONUrl = packageJSONUrl; + packageJSONUrl = new URL("../package.json", packageJSONUrl); + if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { + break; + } + } + const packageJSONPath = url.fileURLToPath(packageJSONUrl); + const packageConfig = { + pjsonPath: packageJSONPath, + exists: false, + main: void 0, + name: void 0, + type: "none", + exports: void 0, + imports: void 0 + }; + packageJSONCache.set(packageJSONPath, packageConfig); + return packageConfig; +} + +/** + @license + Copyright Node.js contributors. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. +*/ +function throwImportNotDefined(specifier, packageJSONUrl, base) { + throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( + specifier, + packageJSONUrl && url.fileURLToPath(new URL(".", packageJSONUrl)), + url.fileURLToPath(base) + ); +} +function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { + const reason = `request is not a valid subpath for the "${internal ? "imports" : "exports"}" resolution of ${url.fileURLToPath(packageJSONUrl)}`; + throw new ERR_INVALID_MODULE_SPECIFIER( + subpath, + reason, + base && url.fileURLToPath(base) + ); +} +function throwInvalidPackageTarget(subpath, target, packageJSONUrl, internal, base) { + if (typeof target === "object" && target !== null) { + target = JSONStringify(target, null, ""); + } else { + target = `${target}`; + } + throw new ERR_INVALID_PACKAGE_TARGET( + url.fileURLToPath(new URL(".", packageJSONUrl)), + subpath, + target, + internal, + base && url.fileURLToPath(base) + ); +} +const invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i; +const patternRegEx = /\*/g; +function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base, pattern, internal, conditions) { + if (subpath !== "" && !pattern && target[target.length - 1] !== "/") + throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); + if (!StringPrototypeStartsWith(target, "./")) { + if (internal && !StringPrototypeStartsWith(target, "../") && !StringPrototypeStartsWith(target, "/")) { + let isURL = false; + try { + new URL(target); + isURL = true; + } catch { + } + if (!isURL) { + const exportTarget = pattern ? RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) : target + subpath; + return exportTarget; + } + } + throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); + } + if (RegExpPrototypeExec( + invalidSegmentRegEx, + StringPrototypeSlice(target, 2) + ) !== null) + throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); + const resolved = new URL(target, packageJSONUrl); + const resolvedPath = resolved.pathname; + const packagePath = new URL(".", packageJSONUrl).pathname; + if (!StringPrototypeStartsWith(resolvedPath, packagePath)) + throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); + if (subpath === "") + return resolved; + if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { + const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; + throwInvalidSubpath(request, packageJSONUrl, internal, base); + } + if (pattern) { + return new URL( + RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath) + ); + } + return new URL(subpath, resolved); +} +function isArrayIndex(key) { + const keyNum = +key; + if (`${keyNum}` !== key) + return false; + return keyNum >= 0 && keyNum < 4294967295; +} +function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { + if (typeof target === "string") { + return resolvePackageTargetString( + target, + subpath, + packageSubpath, + packageJSONUrl, + base, + pattern, + internal); + } else if (ArrayIsArray(target)) { + if (target.length === 0) { + return null; + } + let lastException; + for (let i = 0; i < target.length; i++) { + const targetItem = target[i]; + let resolveResult; + try { + resolveResult = resolvePackageTarget( + packageJSONUrl, + targetItem, + subpath, + packageSubpath, + base, + pattern, + internal, + conditions + ); + } catch (e) { + lastException = e; + if (e.code === "ERR_INVALID_PACKAGE_TARGET") { + continue; + } + throw e; + } + if (resolveResult === void 0) { + continue; + } + if (resolveResult === null) { + lastException = null; + continue; + } + return resolveResult; + } + if (lastException === void 0 || lastException === null) + return lastException; + throw lastException; + } else if (typeof target === "object" && target !== null) { + const keys = ObjectGetOwnPropertyNames(target); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if (isArrayIndex(key)) { + throw new ERR_INVALID_PACKAGE_CONFIG( + url.fileURLToPath(packageJSONUrl), + base, + '"exports" cannot contain numeric property keys.' + ); + } + } + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + if (key === "default" || conditions.has(key)) { + const conditionalTarget = target[key]; + const resolveResult = resolvePackageTarget( + packageJSONUrl, + conditionalTarget, + subpath, + packageSubpath, + base, + pattern, + internal, + conditions + ); + if (resolveResult === void 0) + continue; + return resolveResult; + } + } + return void 0; + } else if (target === null) { + return null; + } + throwInvalidPackageTarget( + packageSubpath, + target, + packageJSONUrl, + internal, + base + ); +} +function patternKeyCompare(a, b) { + const aPatternIndex = StringPrototypeIndexOf(a, "*"); + const bPatternIndex = StringPrototypeIndexOf(b, "*"); + const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; + const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; + if (baseLenA > baseLenB) + return -1; + if (baseLenB > baseLenA) + return 1; + if (aPatternIndex === -1) + return 1; + if (bPatternIndex === -1) + return -1; + if (a.length > b.length) + return -1; + if (b.length > a.length) + return 1; + return 0; +} +function packageImportsResolve({ + name, + base, + conditions, + readFileSyncFn +}) { + if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { + const reason = "is not a valid internal imports specifier name"; + throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, url.fileURLToPath(base)); + } + let packageJSONUrl; + const packageConfig = getPackageScopeConfig(base, readFileSyncFn); + if (packageConfig.exists) { + packageJSONUrl = url.pathToFileURL(packageConfig.pjsonPath); + const imports = packageConfig.imports; + if (imports) { + if (ObjectPrototypeHasOwnProperty(imports, name) && !StringPrototypeIncludes(name, "*")) { + const resolveResult = resolvePackageTarget( + packageJSONUrl, + imports[name], + "", + name, + base, + false, + true, + conditions + ); + if (resolveResult != null) { + return resolveResult; + } + } else { + let bestMatch = ""; + let bestMatchSubpath; + const keys = ObjectGetOwnPropertyNames(imports); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const patternIndex = StringPrototypeIndexOf(key, "*"); + if (patternIndex !== -1 && StringPrototypeStartsWith( + name, + StringPrototypeSlice(key, 0, patternIndex) + )) { + const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); + if (name.length >= key.length && StringPrototypeEndsWith(name, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { + bestMatch = key; + bestMatchSubpath = StringPrototypeSlice( + name, + patternIndex, + name.length - patternTrailer.length + ); + } + } + } + if (bestMatch) { + const target = imports[bestMatch]; + const resolveResult = resolvePackageTarget( + packageJSONUrl, + target, + bestMatchSubpath, + bestMatch, + base, + true, + true, + conditions + ); + if (resolveResult != null) { + return resolveResult; + } + } + } + } + } + throwImportNotDefined(name, packageJSONUrl, base); +} + +const flagSymbol = Symbol('arg flag'); + +class ArgError extends Error { + constructor(msg, code) { + super(msg); + this.name = 'ArgError'; + this.code = code; + + Object.setPrototypeOf(this, ArgError.prototype); + } +} + +function arg( + opts, + { + argv = process.argv.slice(2), + permissive = false, + stopAtPositional = false + } = {} +) { + if (!opts) { + throw new ArgError( + 'argument specification object is required', + 'ARG_CONFIG_NO_SPEC' + ); + } + + const result = { _: [] }; + + const aliases = {}; + const handlers = {}; + + for (const key of Object.keys(opts)) { + if (!key) { + throw new ArgError( + 'argument key cannot be an empty string', + 'ARG_CONFIG_EMPTY_KEY' + ); + } + + if (key[0] !== '-') { + throw new ArgError( + `argument key must start with '-' but found: '${key}'`, + 'ARG_CONFIG_NONOPT_KEY' + ); + } + + if (key.length === 1) { + throw new ArgError( + `argument key must have a name; singular '-' keys are not allowed: ${key}`, + 'ARG_CONFIG_NONAME_KEY' + ); + } + + if (typeof opts[key] === 'string') { + aliases[key] = opts[key]; + continue; + } + + let type = opts[key]; + let isFlag = false; + + if ( + Array.isArray(type) && + type.length === 1 && + typeof type[0] === 'function' + ) { + const [fn] = type; + type = (value, name, prev = []) => { + prev.push(fn(value, name, prev[prev.length - 1])); + return prev; + }; + isFlag = fn === Boolean || fn[flagSymbol] === true; + } else if (typeof type === 'function') { + isFlag = type === Boolean || type[flagSymbol] === true; + } else { + throw new ArgError( + `type missing or not a function or valid array type: ${key}`, + 'ARG_CONFIG_VAD_TYPE' + ); + } + + if (key[1] !== '-' && key.length > 2) { + throw new ArgError( + `short argument keys (with a single hyphen) must have only one character: ${key}`, + 'ARG_CONFIG_SHORTOPT_TOOLONG' + ); + } + + handlers[key] = [type, isFlag]; + } + + for (let i = 0, len = argv.length; i < len; i++) { + const wholeArg = argv[i]; + + if (stopAtPositional && result._.length > 0) { + result._ = result._.concat(argv.slice(i)); + break; + } + + if (wholeArg === '--') { + result._ = result._.concat(argv.slice(i + 1)); + break; + } + + if (wholeArg.length > 1 && wholeArg[0] === '-') { + /* eslint-disable operator-linebreak */ + const separatedArguments = + wholeArg[1] === '-' || wholeArg.length === 2 + ? [wholeArg] + : wholeArg + .slice(1) + .split('') + .map((a) => `-${a}`); + /* eslint-enable operator-linebreak */ + + for (let j = 0; j < separatedArguments.length; j++) { + const arg = separatedArguments[j]; + const [originalArgName, argStr] = + arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined]; + + let argName = originalArgName; + while (argName in aliases) { + argName = aliases[argName]; + } + + if (!(argName in handlers)) { + if (permissive) { + result._.push(arg); + continue; + } else { + throw new ArgError( + `unknown or unexpected option: ${originalArgName}`, + 'ARG_UNKNOWN_OPTION' + ); + } + } + + const [type, isFlag] = handlers[argName]; + + if (!isFlag && j + 1 < separatedArguments.length) { + throw new ArgError( + `option requires argument (but was followed by another short argument): ${originalArgName}`, + 'ARG_MISSING_REQUIRED_SHORTARG' + ); + } + + if (isFlag) { + result[argName] = type(true, argName, result[argName]); + } else if (argStr === undefined) { + if ( + argv.length < i + 2 || + (argv[i + 1].length > 1 && + argv[i + 1][0] === '-' && + !( + argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && + (type === Number || + // eslint-disable-next-line no-undef + (typeof BigInt !== 'undefined' && type === BigInt)) + )) + ) { + const extended = + originalArgName === argName ? '' : ` (alias for ${argName})`; + throw new ArgError( + `option requires argument: ${originalArgName}${extended}`, + 'ARG_MISSING_REQUIRED_LONGARG' + ); + } + + result[argName] = type(argv[i + 1], argName, result[argName]); + ++i; + } else { + result[argName] = type(argStr, argName, result[argName]); + } + } + } else { + result._.push(wholeArg); + } + } + + return result; +} + +arg.flag = (fn) => { + fn[flagSymbol] = true; + return fn; +}; + +// Utility types +arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1); + +// Expose error class +arg.ArgError = ArgError; + +var arg_1 = arg; + +/** + @license + The MIT License (MIT) + + Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ +function getOptionValue(opt) { + parseOptions(); + return options[opt]; +} +let options; +function parseOptions() { + if (!options) { + options = { + "--conditions": [], + ...parseArgv(getNodeOptionsEnvArgv()), + ...parseArgv(process.execArgv) + }; + } +} +function parseArgv(argv) { + return arg_1( + { + "--conditions": [String], + "-C": "--conditions" + }, + { + argv, + permissive: true + } + ); +} +function getNodeOptionsEnvArgv() { + const errors = []; + const envArgv = ParseNodeOptionsEnvVar(process.env.NODE_OPTIONS || "", errors); + if (errors.length !== 0) ; + return envArgv; +} +function ParseNodeOptionsEnvVar(node_options, errors) { + const env_argv = []; + let is_in_string = false; + let will_start_new_arg = true; + for (let index = 0; index < node_options.length; ++index) { + let c = node_options[index]; + if (c === "\\" && is_in_string) { + if (index + 1 === node_options.length) { + errors.push("invalid value for NODE_OPTIONS (invalid escape)\n"); + return env_argv; + } else { + c = node_options[++index]; + } + } else if (c === " " && !is_in_string) { + will_start_new_arg = true; + continue; + } else if (c === '"') { + is_in_string = !is_in_string; + continue; + } + if (will_start_new_arg) { + env_argv.push(c); + will_start_new_arg = false; + } else { + env_argv[env_argv.length - 1] += c; + } + } + if (is_in_string) { + errors.push("invalid value for NODE_OPTIONS (unterminated string)\n"); + } + return env_argv; +} + +function makeApi(runtimeState, opts) { + const alwaysWarnOnFallback = Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK) > 0; + const debugLevel = Number(process.env.PNP_DEBUG_LEVEL); + const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/; + const isStrictRegExp = /^(\/|\.{1,2}(\/|$))/; + const isDirRegExp = /\/$/; + const isRelativeRegexp = /^\.{0,2}\//; + const topLevelLocator = { name: null, reference: null }; + const fallbackLocators = []; + const emittedWarnings = /* @__PURE__ */ new Set(); + if (runtimeState.enableTopLevelFallback === true) + fallbackLocators.push(topLevelLocator); + if (opts.compatibilityMode !== false) { + for (const name of [`react-scripts`, `gatsby`]) { + const packageStore = runtimeState.packageRegistry.get(name); + if (packageStore) { + for (const reference of packageStore.keys()) { + if (reference === null) { + throw new Error(`Assertion failed: This reference shouldn't be null`); + } else { + fallbackLocators.push({ name, reference }); + } + } + } + } + } + const { + ignorePattern, + packageRegistry, + packageLocatorsByLocations + } = runtimeState; + function makeLogEntry(name, args) { + return { + fn: name, + args, + error: null, + result: null + }; + } + function trace(entry) { + var _a, _b, _c, _d; + const colors = ((_b = (_a = process.stderr) == null ? void 0 : _a.hasColors) == null ? void 0 : _b.call(_a)) ?? process.stdout.isTTY; + const c = (n, str) => `\x1B[${n}m${str}\x1B[0m`; + const error = entry.error; + if (error) + console.error(c(`31;1`, `\u2716 ${(_c = entry.error) == null ? void 0 : _c.message.replace(/\n.*/s, ``)}`)); + else + console.error(c(`33;1`, `\u203C Resolution`)); + if (entry.args.length > 0) + console.error(); + for (const arg of entry.args) + console.error(` ${c(`37;1`, `In \u2190`)} ${nodeUtils.inspect(arg, { colors, compact: true })}`); + if (entry.result) { + console.error(); + console.error(` ${c(`37;1`, `Out \u2192`)} ${nodeUtils.inspect(entry.result, { colors, compact: true })}`); + } + const stack = ((_d = new Error().stack.match(/(?<=^ +)at.*/gm)) == null ? void 0 : _d.slice(2)) ?? []; + if (stack.length > 0) { + console.error(); + for (const line of stack) { + console.error(` ${c(`38;5;244`, line)}`); + } + } + console.error(); + } + function maybeLog(name, fn) { + if (opts.allowDebug === false) + return fn; + if (Number.isFinite(debugLevel)) { + if (debugLevel >= 2) { + return (...args) => { + const logEntry = makeLogEntry(name, args); + try { + return logEntry.result = fn(...args); + } catch (error) { + throw logEntry.error = error; + } finally { + trace(logEntry); + } + }; + } else if (debugLevel >= 1) { + return (...args) => { + try { + return fn(...args); + } catch (error) { + const logEntry = makeLogEntry(name, args); + logEntry.error = error; + trace(logEntry); + throw error; + } + }; + } + } + return fn; + } + function getPackageInformationSafe(packageLocator) { + const packageInformation = getPackageInformation(packageLocator); + if (!packageInformation) { + throw makeError( + ErrorCode.INTERNAL, + `Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)` + ); + } + return packageInformation; + } + function isDependencyTreeRoot(packageLocator) { + if (packageLocator.name === null) + return true; + for (const dependencyTreeRoot of runtimeState.dependencyTreeRoots) + if (dependencyTreeRoot.name === packageLocator.name && dependencyTreeRoot.reference === packageLocator.reference) + return true; + return false; + } + const defaultExportsConditions = /* @__PURE__ */ new Set([ + `default`, + `node`, + `require`, + ...getOptionValue(`--conditions`) + ]); + function applyNodeExportsResolution(unqualifiedPath, conditions = defaultExportsConditions) { + const locator = findPackageLocator(ppath.join(unqualifiedPath, `internal.js`), { + resolveIgnored: true, + includeDiscardFromLookup: true + }); + if (locator === null) { + throw makeError( + ErrorCode.INTERNAL, + `The locator that owns the "${unqualifiedPath}" path can't be found inside the dependency tree (this is probably an internal error)` + ); + } + const { packageLocation } = getPackageInformationSafe(locator); + const manifestPath = ppath.join(packageLocation, Filename.manifest); + if (!opts.fakeFs.existsSync(manifestPath)) + return null; + const pkgJson = JSON.parse(opts.fakeFs.readFileSync(manifestPath, `utf8`)); + let subpath = ppath.contains(packageLocation, unqualifiedPath); + if (subpath === null) { + throw makeError( + ErrorCode.INTERNAL, + `unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)` + ); + } + if (!isRelativeRegexp.test(subpath)) + subpath = `./${subpath}`; + let resolvedExport; + try { + resolvedExport = resolve(pkgJson, ppath.normalize(subpath), { + conditions, + unsafe: true + }); + } catch (error) { + throw makeError( + ErrorCode.EXPORTS_RESOLUTION_FAILED, + error.message, + { unqualifiedPath: getPathForDisplay(unqualifiedPath), locator, pkgJson, subpath: getPathForDisplay(subpath), conditions }, + `ERR_PACKAGE_PATH_NOT_EXPORTED` + ); + } + if (typeof resolvedExport === `string`) + return ppath.join(packageLocation, resolvedExport); + return null; + } + function applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }) { + let stat; + try { + candidates.push(unqualifiedPath); + stat = opts.fakeFs.statSync(unqualifiedPath); + } catch (error) { + } + if (stat && !stat.isDirectory()) + return opts.fakeFs.realpathSync(unqualifiedPath); + if (stat && stat.isDirectory()) { + let pkgJson; + try { + pkgJson = JSON.parse(opts.fakeFs.readFileSync(ppath.join(unqualifiedPath, Filename.manifest), `utf8`)); + } catch (error) { + } + let nextUnqualifiedPath; + if (pkgJson && pkgJson.main) + nextUnqualifiedPath = ppath.resolve(unqualifiedPath, pkgJson.main); + if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) { + const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, { extensions }); + if (resolution !== null) { + return resolution; + } + } + } + for (let i = 0, length = extensions.length; i < length; i++) { + const candidateFile = `${unqualifiedPath}${extensions[i]}`; + candidates.push(candidateFile); + if (opts.fakeFs.existsSync(candidateFile)) { + return candidateFile; + } + } + if (stat && stat.isDirectory()) { + for (let i = 0, length = extensions.length; i < length; i++) { + const candidateFile = ppath.format({ dir: unqualifiedPath, name: `index`, ext: extensions[i] }); + candidates.push(candidateFile); + if (opts.fakeFs.existsSync(candidateFile)) { + return candidateFile; + } + } + } + return null; + } + function makeFakeModule(path) { + const fakeModule = new require$$0.Module(path, null); + fakeModule.filename = path; + fakeModule.paths = require$$0.Module._nodeModulePaths(path); + return fakeModule; + } + function callNativeResolution(request, issuer) { + if (issuer.endsWith(`/`)) + issuer = ppath.join(issuer, `internal.js`); + return require$$0.Module._resolveFilename(npath.fromPortablePath(request), makeFakeModule(npath.fromPortablePath(issuer)), false, { plugnplay: false }); + } + function isPathIgnored(path) { + if (ignorePattern === null) + return false; + const subPath = ppath.contains(runtimeState.basePath, path); + if (subPath === null) + return false; + if (ignorePattern.test(subPath.replace(/\/$/, ``))) { + return true; + } else { + return false; + } + } + const VERSIONS = { std: 3, resolveVirtual: 1, getAllLocators: 1 }; + const topLevel = topLevelLocator; + function getPackageInformation({ name, reference }) { + const packageInformationStore = packageRegistry.get(name); + if (!packageInformationStore) + return null; + const packageInformation = packageInformationStore.get(reference); + if (!packageInformation) + return null; + return packageInformation; + } + function findPackageDependents({ name, reference }) { + const dependents = []; + for (const [dependentName, packageInformationStore] of packageRegistry) { + if (dependentName === null) + continue; + for (const [dependentReference, packageInformation] of packageInformationStore) { + if (dependentReference === null) + continue; + const dependencyReference = packageInformation.packageDependencies.get(name); + if (dependencyReference !== reference) + continue; + if (dependentName === name && dependentReference === reference) + continue; + dependents.push({ + name: dependentName, + reference: dependentReference + }); + } + } + return dependents; + } + function findBrokenPeerDependencies(dependency, initialPackage) { + const brokenPackages = /* @__PURE__ */ new Map(); + const alreadyVisited = /* @__PURE__ */ new Set(); + const traversal = (currentPackage) => { + const identifier = JSON.stringify(currentPackage.name); + if (alreadyVisited.has(identifier)) + return; + alreadyVisited.add(identifier); + const dependents = findPackageDependents(currentPackage); + for (const dependent of dependents) { + const dependentInformation = getPackageInformationSafe(dependent); + if (dependentInformation.packagePeers.has(dependency)) { + traversal(dependent); + } else { + let brokenSet = brokenPackages.get(dependent.name); + if (typeof brokenSet === `undefined`) + brokenPackages.set(dependent.name, brokenSet = /* @__PURE__ */ new Set()); + brokenSet.add(dependent.reference); + } + } + }; + traversal(initialPackage); + const brokenList = []; + for (const name of [...brokenPackages.keys()].sort()) + for (const reference of [...brokenPackages.get(name)].sort()) + brokenList.push({ name, reference }); + return brokenList; + } + function findPackageLocator(location, { resolveIgnored = false, includeDiscardFromLookup = false } = {}) { + if (isPathIgnored(location) && !resolveIgnored) + return null; + let relativeLocation = ppath.relative(runtimeState.basePath, location); + if (!relativeLocation.match(isStrictRegExp)) + relativeLocation = `./${relativeLocation}`; + if (!relativeLocation.endsWith(`/`)) + relativeLocation = `${relativeLocation}/`; + do { + const entry = packageLocatorsByLocations.get(relativeLocation); + if (typeof entry === `undefined` || entry.discardFromLookup && !includeDiscardFromLookup) { + relativeLocation = relativeLocation.substring(0, relativeLocation.lastIndexOf(`/`, relativeLocation.length - 2) + 1); + continue; + } + return entry.locator; + } while (relativeLocation !== ``); + return null; + } + function tryReadFile(filePath) { + try { + return opts.fakeFs.readFileSync(npath.toPortablePath(filePath), `utf8`); + } catch (err) { + if (err.code === `ENOENT`) + return void 0; + throw err; + } + } + function resolveToUnqualified(request, issuer, { considerBuiltins = true } = {}) { + if (request.startsWith(`#`)) + throw new Error(`resolveToUnqualified can not handle private import mappings`); + if (request === `pnpapi`) + return npath.toPortablePath(opts.pnpapiResolution); + if (considerBuiltins && isBuiltinModule(request)) + return null; + const requestForDisplay = getPathForDisplay(request); + const issuerForDisplay = issuer && getPathForDisplay(issuer); + if (issuer && isPathIgnored(issuer)) { + if (!ppath.isAbsolute(request) || findPackageLocator(request) === null) { + const result = callNativeResolution(request, issuer); + if (result === false) { + throw makeError( + ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, + `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) + +Require request: "${requestForDisplay}" +Required by: ${issuerForDisplay} +`, + { request: requestForDisplay, issuer: issuerForDisplay } + ); + } + return npath.toPortablePath(result); + } + } + let unqualifiedPath; + const dependencyNameMatch = request.match(pathRegExp); + if (!dependencyNameMatch) { + if (ppath.isAbsolute(request)) { + unqualifiedPath = ppath.normalize(request); + } else { + if (!issuer) { + throw makeError( + ErrorCode.API_ERROR, + `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, + { request: requestForDisplay, issuer: issuerForDisplay } + ); + } + const absoluteIssuer = ppath.resolve(issuer); + if (issuer.match(isDirRegExp)) { + unqualifiedPath = ppath.normalize(ppath.join(absoluteIssuer, request)); + } else { + unqualifiedPath = ppath.normalize(ppath.join(ppath.dirname(absoluteIssuer), request)); + } + } + } else { + if (!issuer) { + throw makeError( + ErrorCode.API_ERROR, + `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, + { request: requestForDisplay, issuer: issuerForDisplay } + ); + } + const [, dependencyName, subPath] = dependencyNameMatch; + const issuerLocator = findPackageLocator(issuer); + if (!issuerLocator) { + const result = callNativeResolution(request, issuer); + if (result === false) { + throw makeError( + ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, + `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). + +Require path: "${requestForDisplay}" +Required by: ${issuerForDisplay} +`, + { request: requestForDisplay, issuer: issuerForDisplay } + ); + } + return npath.toPortablePath(result); + } + const issuerInformation = getPackageInformationSafe(issuerLocator); + let dependencyReference = issuerInformation.packageDependencies.get(dependencyName); + let fallbackReference = null; + if (dependencyReference == null) { + if (issuerLocator.name !== null) { + const exclusionEntry = runtimeState.fallbackExclusionList.get(issuerLocator.name); + const canUseFallbacks = !exclusionEntry || !exclusionEntry.has(issuerLocator.reference); + if (canUseFallbacks) { + for (let t = 0, T = fallbackLocators.length; t < T; ++t) { + const fallbackInformation = getPackageInformationSafe(fallbackLocators[t]); + const reference = fallbackInformation.packageDependencies.get(dependencyName); + if (reference == null) + continue; + if (alwaysWarnOnFallback) + fallbackReference = reference; + else + dependencyReference = reference; + break; + } + if (runtimeState.enableTopLevelFallback) { + if (dependencyReference == null && fallbackReference === null) { + const reference = runtimeState.fallbackPool.get(dependencyName); + if (reference != null) { + fallbackReference = reference; + } + } + } + } + } + } + let error = null; + if (dependencyReference === null) { + if (isDependencyTreeRoot(issuerLocator)) { + error = makeError( + ErrorCode.MISSING_PEER_DEPENDENCY, + `Your application tried to access ${dependencyName} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed. + +Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} +Required by: ${issuerForDisplay} +`, + { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } + ); + } else { + const brokenAncestors = findBrokenPeerDependencies(dependencyName, issuerLocator); + if (brokenAncestors.every((ancestor) => isDependencyTreeRoot(ancestor))) { + error = makeError( + ErrorCode.MISSING_PEER_DEPENDENCY, + `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. + +Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} +Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) +${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} +`).join(``)} +`, + { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } + ); + } else { + error = makeError( + ErrorCode.MISSING_PEER_DEPENDENCY, + `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. + +Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} +Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) + +${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} +`).join(``)} +`, + { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } + ); + } + } + } else if (dependencyReference === void 0) { + if (!considerBuiltins && isBuiltinModule(request)) { + if (isDependencyTreeRoot(issuerLocator)) { + error = makeError( + ErrorCode.UNDECLARED_DEPENDENCY, + `Your application tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. + +Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} +Required by: ${issuerForDisplay} +`, + { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } + ); + } else { + error = makeError( + ErrorCode.UNDECLARED_DEPENDENCY, + `${issuerLocator.name} tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in ${issuerLocator.name}'s dependencies, this makes the require call ambiguous and unsound. + +Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} +Required by: ${issuerForDisplay} +`, + { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } + ); + } + } else { + if (isDependencyTreeRoot(issuerLocator)) { + error = makeError( + ErrorCode.UNDECLARED_DEPENDENCY, + `Your application tried to access ${dependencyName}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. + +Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} +Required by: ${issuerForDisplay} +`, + { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } + ); + } else { + error = makeError( + ErrorCode.UNDECLARED_DEPENDENCY, + `${issuerLocator.name} tried to access ${dependencyName}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. + +Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} +Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) +`, + { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } + ); + } + } + } + if (dependencyReference == null) { + if (fallbackReference === null || error === null) + throw error || new Error(`Assertion failed: Expected an error to have been set`); + dependencyReference = fallbackReference; + const message = error.message.replace(/\n.*/g, ``); + error.message = message; + if (!emittedWarnings.has(message) && debugLevel !== 0) { + emittedWarnings.add(message); + process.emitWarning(error); + } + } + const dependencyLocator = Array.isArray(dependencyReference) ? { name: dependencyReference[0], reference: dependencyReference[1] } : { name: dependencyName, reference: dependencyReference }; + const dependencyInformation = getPackageInformationSafe(dependencyLocator); + if (!dependencyInformation.packageLocation) { + throw makeError( + ErrorCode.MISSING_DEPENDENCY, + `A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. + +Required package: ${dependencyLocator.name}@${dependencyLocator.reference}${dependencyLocator.name !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} +Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) +`, + { request: requestForDisplay, issuer: issuerForDisplay, dependencyLocator: Object.assign({}, dependencyLocator) } + ); + } + const dependencyLocation = dependencyInformation.packageLocation; + if (subPath) { + unqualifiedPath = ppath.join(dependencyLocation, subPath); + } else { + unqualifiedPath = dependencyLocation; + } + } + return ppath.normalize(unqualifiedPath); + } + function resolveUnqualifiedExport(request, unqualifiedPath, conditions = defaultExportsConditions) { + if (isStrictRegExp.test(request)) + return unqualifiedPath; + const unqualifiedExportPath = applyNodeExportsResolution(unqualifiedPath, conditions); + if (unqualifiedExportPath) { + return ppath.normalize(unqualifiedExportPath); + } else { + return unqualifiedPath; + } + } + function resolveUnqualified(unqualifiedPath, { extensions = Object.keys(require$$0.Module._extensions) } = {}) { + const candidates = []; + const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }); + if (qualifiedPath) { + return ppath.normalize(qualifiedPath); + } else { + reportRequiredFilesToWatchMode(candidates.map((candidate) => npath.fromPortablePath(candidate))); + const unqualifiedPathForDisplay = getPathForDisplay(unqualifiedPath); + const containingPackage = findPackageLocator(unqualifiedPath); + if (containingPackage) { + const { packageLocation } = getPackageInformationSafe(containingPackage); + let exists = true; + try { + opts.fakeFs.accessSync(packageLocation); + } catch (err) { + if ((err == null ? void 0 : err.code) === `ENOENT`) { + exists = false; + } else { + const readableError = ((err == null ? void 0 : err.message) ?? err ?? `empty exception thrown`).replace(/^[A-Z]/, ($0) => $0.toLowerCase()); + throw makeError(ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, `Required package exists but could not be accessed (${readableError}). + +Missing package: ${containingPackage.name}@${containingPackage.reference} +Expected package location: ${getPathForDisplay(packageLocation)} +`, { unqualifiedPath: unqualifiedPathForDisplay, extensions }); + } + } + if (!exists) { + const errorMessage = packageLocation.includes(`/unplugged/`) ? `Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).` : `Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.`; + throw makeError( + ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, + `${errorMessage} + +Missing package: ${containingPackage.name}@${containingPackage.reference} +Expected package location: ${getPathForDisplay(packageLocation)} +`, + { unqualifiedPath: unqualifiedPathForDisplay, extensions } + ); + } + } + throw makeError( + ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, + `Qualified path resolution failed: we looked for the following paths, but none could be accessed. + +Source path: ${unqualifiedPathForDisplay} +${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} +`).join(``)}`, + { unqualifiedPath: unqualifiedPathForDisplay, extensions } + ); + } + } + function resolvePrivateRequest(request, issuer, opts2) { + if (!issuer) + throw new Error(`Assertion failed: An issuer is required to resolve private import mappings`); + const resolved = packageImportsResolve({ + name: request, + base: url.pathToFileURL(npath.fromPortablePath(issuer)), + conditions: opts2.conditions ?? defaultExportsConditions, + readFileSyncFn: tryReadFile + }); + if (resolved instanceof URL) { + return resolveUnqualified(npath.toPortablePath(url.fileURLToPath(resolved)), { extensions: opts2.extensions }); + } else { + if (resolved.startsWith(`#`)) + throw new Error(`Mapping from one private import to another isn't allowed`); + return resolveRequest(resolved, issuer, opts2); + } + } + function resolveRequest(request, issuer, opts2 = {}) { + try { + if (request.startsWith(`#`)) + return resolvePrivateRequest(request, issuer, opts2); + const { considerBuiltins, extensions, conditions } = opts2; + const unqualifiedPath = resolveToUnqualified(request, issuer, { considerBuiltins }); + if (request === `pnpapi`) + return unqualifiedPath; + if (unqualifiedPath === null) + return null; + const isIssuerIgnored = () => issuer !== null ? isPathIgnored(issuer) : false; + const remappedPath = (!considerBuiltins || !isBuiltinModule(request)) && !isIssuerIgnored() ? resolveUnqualifiedExport(request, unqualifiedPath, conditions) : unqualifiedPath; + return resolveUnqualified(remappedPath, { extensions }); + } catch (error) { + if (Object.prototype.hasOwnProperty.call(error, `pnpCode`)) + Object.assign(error.data, { request: getPathForDisplay(request), issuer: issuer && getPathForDisplay(issuer) }); + throw error; + } + } + function resolveVirtual(request) { + const normalized = ppath.normalize(request); + const resolved = VirtualFS.resolveVirtual(normalized); + return resolved !== normalized ? resolved : null; + } + return { + VERSIONS, + topLevel, + getLocator: (name, referencish) => { + if (Array.isArray(referencish)) { + return { name: referencish[0], reference: referencish[1] }; + } else { + return { name, reference: referencish }; + } + }, + getDependencyTreeRoots: () => { + return [...runtimeState.dependencyTreeRoots]; + }, + getAllLocators() { + const locators = []; + for (const [name, entry] of packageRegistry) + for (const reference of entry.keys()) + if (name !== null && reference !== null) + locators.push({ name, reference }); + return locators; + }, + getPackageInformation: (locator) => { + const info = getPackageInformation(locator); + if (info === null) + return null; + const packageLocation = npath.fromPortablePath(info.packageLocation); + const nativeInfo = { ...info, packageLocation }; + return nativeInfo; + }, + findPackageLocator: (path) => { + return findPackageLocator(npath.toPortablePath(path)); + }, + resolveToUnqualified: maybeLog(`resolveToUnqualified`, (request, issuer, opts2) => { + const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; + const resolution = resolveToUnqualified(npath.toPortablePath(request), portableIssuer, opts2); + if (resolution === null) + return null; + return npath.fromPortablePath(resolution); + }), + resolveUnqualified: maybeLog(`resolveUnqualified`, (unqualifiedPath, opts2) => { + return npath.fromPortablePath(resolveUnqualified(npath.toPortablePath(unqualifiedPath), opts2)); + }), + resolveRequest: maybeLog(`resolveRequest`, (request, issuer, opts2) => { + const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; + const resolution = resolveRequest(npath.toPortablePath(request), portableIssuer, opts2); + if (resolution === null) + return null; + return npath.fromPortablePath(resolution); + }), + resolveVirtual: maybeLog(`resolveVirtual`, (path) => { + const result = resolveVirtual(npath.toPortablePath(path)); + if (result !== null) { + return npath.fromPortablePath(result); + } else { + return null; + } + }) + }; +} + +function makeManager(pnpapi, opts) { + const initialApiPath = npath.toPortablePath(pnpapi.resolveToUnqualified(`pnpapi`, null)); + const initialApiStats = opts.fakeFs.statSync(npath.toPortablePath(initialApiPath)); + const apiMetadata = /* @__PURE__ */ new Map([ + [initialApiPath, { + cache: require$$0.Module._cache, + instance: pnpapi, + stats: initialApiStats, + lastRefreshCheck: Date.now() + }] + ]); + function loadApiInstance(pnpApiPath) { + const nativePath = npath.fromPortablePath(pnpApiPath); + const module = new require$$0.Module(nativePath, null); + module.load(nativePath); + return module.exports; + } + function refreshApiEntry(pnpApiPath, apiEntry) { + const timeNow = Date.now(); + if (timeNow - apiEntry.lastRefreshCheck < 500) + return; + apiEntry.lastRefreshCheck = timeNow; + const stats = opts.fakeFs.statSync(pnpApiPath); + if (stats.mtime > apiEntry.stats.mtime) { + process.emitWarning(`[Warning] The runtime detected new information in a PnP file; reloading the API instance (${npath.fromPortablePath(pnpApiPath)})`); + apiEntry.stats = stats; + apiEntry.instance = loadApiInstance(pnpApiPath); + } + } + function getApiEntry(pnpApiPath, refresh = false) { + let apiEntry = apiMetadata.get(pnpApiPath); + if (typeof apiEntry !== `undefined`) { + if (refresh) { + refreshApiEntry(pnpApiPath, apiEntry); + } + } else { + apiMetadata.set(pnpApiPath, apiEntry = { + cache: {}, + instance: loadApiInstance(pnpApiPath), + stats: opts.fakeFs.statSync(pnpApiPath), + lastRefreshCheck: Date.now() + }); + } + return apiEntry; + } + const findApiPathCache = /* @__PURE__ */ new Map(); + function addToCacheAndReturn(start, end, target) { + if (target !== null) + target = VirtualFS.resolveVirtual(target); + let curr; + let next = start; + do { + curr = next; + findApiPathCache.set(curr, target); + next = ppath.dirname(curr); + } while (curr !== end); + return target; + } + function findApiPathFor(modulePath) { + let bestCandidate = null; + for (const [apiPath, apiEntry] of apiMetadata) { + const locator = apiEntry.instance.findPackageLocator(modulePath); + if (!locator) + continue; + if (apiMetadata.size === 1) + return apiPath; + const packageInformation = apiEntry.instance.getPackageInformation(locator); + if (!packageInformation) + throw new Error(`Assertion failed: Couldn't get package information for '${modulePath}'`); + if (!bestCandidate) + bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [] }; + if (packageInformation.packageLocation === bestCandidate.packageLocation) { + bestCandidate.apiPaths.push(apiPath); + } else if (packageInformation.packageLocation.length > bestCandidate.packageLocation.length) { + bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [apiPath] }; + } + } + if (bestCandidate) { + if (bestCandidate.apiPaths.length === 1) + return bestCandidate.apiPaths[0]; + const controlSegment = bestCandidate.apiPaths.map((apiPath) => ` ${npath.fromPortablePath(apiPath)}`).join(` +`); + throw new Error(`Unable to locate pnpapi, the module '${modulePath}' is controlled by multiple pnpapi instances. +This is usually caused by using the global cache (enableGlobalCache: true) + +Controlled by: +${controlSegment} +`); + } + const start = ppath.resolve(npath.toPortablePath(modulePath)); + let curr; + let next = start; + do { + curr = next; + const cached = findApiPathCache.get(curr); + if (cached !== void 0) + return addToCacheAndReturn(start, curr, cached); + const cjsCandidate = ppath.join(curr, Filename.pnpCjs); + if (opts.fakeFs.existsSync(cjsCandidate) && opts.fakeFs.statSync(cjsCandidate).isFile()) + return addToCacheAndReturn(start, curr, cjsCandidate); + const legacyCjsCandidate = ppath.join(curr, Filename.pnpJs); + if (opts.fakeFs.existsSync(legacyCjsCandidate) && opts.fakeFs.statSync(legacyCjsCandidate).isFile()) + return addToCacheAndReturn(start, curr, legacyCjsCandidate); + next = ppath.dirname(curr); + } while (curr !== PortablePath.root); + return addToCacheAndReturn(start, curr, null); + } + function getApiPathFromParent(parent) { + if (parent == null) + return initialApiPath; + if (typeof parent.pnpApiPath === `undefined`) { + if (parent.filename !== null) { + return parent.pnpApiPath = findApiPathFor(parent.filename); + } else { + return initialApiPath; + } + } + if (parent.pnpApiPath !== null) + return parent.pnpApiPath; + return null; + } + return { + getApiPathFromParent, + findApiPathFor, + getApiEntry + }; +} + +const localFs = { ...fs__default.default }; +const nodeFs = new NodeFS(localFs); +const defaultRuntimeState = $$SETUP_STATE(hydrateRuntimeState); +const defaultPnpapiResolution = __filename; +const defaultFsLayer = new VirtualFS({ + baseFs: new ZipOpenFS({ + baseFs: nodeFs, + maxOpenFiles: 80, + readOnlyArchives: true + }) +}); +class DynamicFS extends ProxiedFS { + constructor() { + super(ppath); + this.baseFs = defaultFsLayer; + } + mapToBase(p) { + return p; + } + mapFromBase(p) { + return p; + } +} +const dynamicFsLayer = new DynamicFS(); +let manager; +const defaultApi = Object.assign(makeApi(defaultRuntimeState, { + fakeFs: dynamicFsLayer, + pnpapiResolution: defaultPnpapiResolution +}), { + makeApi: ({ + basePath = void 0, + fakeFs = dynamicFsLayer, + pnpapiResolution = defaultPnpapiResolution, + ...rest + }) => { + const apiRuntimeState = typeof basePath !== `undefined` ? $$SETUP_STATE(hydrateRuntimeState, basePath) : defaultRuntimeState; + return makeApi(apiRuntimeState, { + fakeFs, + pnpapiResolution, + ...rest + }); + }, + setup: (api) => { + applyPatch(api || defaultApi, { + fakeFs: defaultFsLayer, + manager + }); + dynamicFsLayer.baseFs = new NodeFS(fs__default.default); + } +}); +manager = makeManager(defaultApi, { + fakeFs: dynamicFsLayer +}); +if (module.parent && module.parent.id === `internal/preload`) { + defaultApi.setup(); + if (module.filename) { + delete require$$0__default.default._cache[module.filename]; + } +} +if (process.mainModule === module) { + const reportError = (code, message, data) => { + process.stdout.write(`${JSON.stringify([{ code, message, data }, null])} +`); + }; + const reportSuccess = (resolution) => { + process.stdout.write(`${JSON.stringify([null, resolution])} +`); + }; + const processResolution = (request, issuer) => { + try { + reportSuccess(defaultApi.resolveRequest(request, issuer)); + } catch (error) { + reportError(error.code, error.message, error.data); + } + }; + const processRequest = (data) => { + try { + const [request, issuer] = JSON.parse(data); + processResolution(request, issuer); + } catch (error) { + reportError(`INVALID_JSON`, error.message, error.data); + } + }; + if (process.argv.length > 2) { + if (process.argv.length !== 4) { + process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} +`); + process.exitCode = 64; + } else { + processResolution(process.argv[2], process.argv[3]); + } + } else { + let buffer = ``; + const decoder = new StringDecoder__default.default.StringDecoder(); + process.stdin.on(`data`, (chunk) => { + buffer += decoder.write(chunk); + do { + const index = buffer.indexOf(` +`); + if (index === -1) + break; + const line = buffer.slice(0, index); + buffer = buffer.slice(index + 1); + processRequest(line); + } while (true); + }); + } +} + +module.exports = defaultApi; diff --git a/internal/module/pnp/testdata/test-expectations.json b/internal/module/pnp/testdata/test-expectations.json new file mode 100644 index 0000000000..b6ce0ded33 --- /dev/null +++ b/internal/module/pnp/testdata/test-expectations.json @@ -0,0 +1,378 @@ +[{ + "manifest": { + "__info": [], + "dependencyTreeRoots": [{ + "name": "root", + "reference": "workspace:." + }], + "ignorePatternData": null, + "enableTopLevelFallback": false, + "fallbackPool": [], + "fallbackExclusionList": [], + "packageRegistryData": [ + [null, [ + [null, { + "packageLocation": "./", + "packageDependencies": [["test", "npm:1.0.0"]], + "linkType": "SOFT" + }] + ]], + ["root", [ + ["workspace:.", { + "packageLocation": "./", + "packageDependencies": [["test", "npm:1.0.0"]], + "linkType": "SOFT" + }] + ]], + ["workspace-alias-dependency", [ + ["workspace:workspace-alias-dependency", { + "packageLocation": "./workspace-alias-dependency/", + "packageDependencies": [["alias", ["test", "npm:1.0.0"]]], + "linkType": "SOFT" + }] + ]], + ["workspace-self-dependency", [ + ["workspace:workspace-self-dependency", { + "packageLocation": "./workspace-self-dependency/", + "packageDependencies": [["workspace-self-dependency", "workspace:workspace-self-dependency"]], + "linkType": "SOFT" + }] + ]], + ["workspace-unfulfilled-peer-dependency", [ + ["workspace:workspace-unfulfilled-peer-dependency", { + "packageLocation": "./workspace-unfulfilled-peer-dependency/", + "packageDependencies": [["test", null]], + "linkType": "SOFT" + }] + ]], + ["longer", [ + ["workspace:longer", { + "packageLocation": "./longer/", + "packageDependencies": [["test", "npm:2.0.0"]], + "linkType": "SOFT" + }] + ]], + ["long", [ + ["workspace:long", { + "packageLocation": "./long/", + "packageDependencies": [["test", "npm:1.0.0"]], + "linkType": "SOFT" + }] + ]], + ["longerer", [ + ["workspace:longerer", { + "packageLocation": "./longerer/", + "packageDependencies": [["test", "npm:3.0.0"]], + "linkType": "SOFT" + }] + ]], + ["test", [ + ["npm:1.0.0", { + "packageLocation": "./test-1.0.0/", + "packageDependencies": [], + "linkType": "HARD" + }], + ["npm:2.0.0", { + "packageLocation": "./test-2.0.0/", + "packageDependencies": [], + "linkType": "HARD" + }], + ["npm:3.0.0", { + "packageLocation": "./test-3.0.0/", + "packageDependencies": [], + "linkType": "HARD" + }] + ]] + ] + }, + "tests": [{ + "it": "should allow a package to import one of its dependencies", + "imported": "test", + "importer": "/path/to/project/", + "expected": "/path/to/project/test-1.0.0/" + }, { + "it": "should allow a package to import itself, if specified in its own dependencies", + "imported": "workspace-self-dependency", + "importer": "/path/to/project/workspace-self-dependency/", + "expected": "/path/to/project/workspace-self-dependency/" + }, { + "it": "should allow a package to import an aliased dependency", + "imported": "alias", + "importer": "/path/to/project/workspace-alias-dependency/", + "expected": "/path/to/project/test-1.0.0/" + }, { + "it": "shouldn't allow a package to import something that isn't one of its dependencies", + "imported": "missing-dependency", + "importer": "/path/to/project/", + "expected": "error!" + }, { + "it": "shouldn't accidentally discard the trailing slash from the package locations", + "imported": "test", + "importer": "/path/to/project/long/", + "expected": "/path/to/project/test-1.0.0/" + }, { + "it": "should throw an exception when trying to access an unfulfilled peer dependency", + "imported": "test", + "importer": "/path/to/project/workspace-unfulfilled-peer-dependency/", + "expected": "error!" + }] +}, { + "manifest": { + "__info": [], + "dependencyTreeRoots": [{ + "name": "root", + "reference": "workspace:." + }], + "ignorePatternData": null, + "enableTopLevelFallback": true, + "fallbackPool": [ + ["test-2", "npm:1.0.0"], + ["alias", ["test-1", "npm:1.0.0"]] + ], + "fallbackExclusionList": [[ + "workspace-no-fallbacks", + ["workspace:workspace-no-fallbacks"] + ]], + "packageRegistryData": [ + [null, [ + [null, { + "packageLocation": "./", + "packageDependencies": [["test-1", "npm:1.0.0"]], + "linkType": "SOFT" + }] + ]], + ["root", [ + ["workspace:.", { + "packageLocation": "./", + "packageDependencies": [["test-1", "npm:1.0.0"]], + "linkType": "SOFT" + }] + ]], + ["workspace-no-fallbacks", [ + ["workspace:workspace-no-fallbacks", { + "packageLocation": "./workspace-no-fallbacks/", + "packageDependencies": [], + "linkType": "SOFT" + }] + ]], + ["workspace-with-fallbacks", [ + ["workspace:workspace-with-fallbacks", { + "packageLocation": "./workspace-with-fallbacks/", + "packageDependencies": [], + "linkType": "SOFT" + }] + ]], + ["workspace-unfulfilled-peer-dependency", [ + ["workspace:workspace-unfulfilled-peer-dependency", { + "packageLocation": "./workspace-unfulfilled-peer-dependency/", + "packageDependencies": [ + ["test-1", null], + ["test-2", null] + ], + "linkType": "SOFT" + }] + ]], + ["test-1", [ + ["npm:1.0.0", { + "packageLocation": "./test-1/", + "packageDependencies": [], + "linkType": "HARD" + }] + ]], + ["test-2", [ + ["npm:1.0.0", { + "packageLocation": "./test-2/", + "packageDependencies": [], + "linkType": "HARD" + }] + ]] + ] + }, + "tests": [{ + "it": "should allow resolution coming from the fallback pool if enableTopLevelFallback is set to true", + "imported": "test-1", + "importer": "/path/to/project/", + "expected": "/path/to/project/test-1/" + }, { + "it": "should allow the fallback pool to contain aliases", + "imported": "alias", + "importer": "/path/to/project/", + "expected": "/path/to/project/test-1/" + }, { + "it": "shouldn't use the fallback pool when the importer package is listed in fallbackExclusionList", + "imported": "test-1", + "importer": "/path/to/project/workspace-no-fallbacks/", + "expected": "error!" + }, { + "it": "should implicitly use the top-level package dependencies as part of the fallback pool", + "imported": "test-2", + "importer": "/path/to/project/workspace-with-fallbacks/", + "expected": "/path/to/project/test-2/" + }, { + "it": "should throw an error if a resolution isn't in in the package dependencies, nor inside the fallback pool", + "imported": "test-3", + "importer": "/path/to/project/workspace-with-fallbacks/", + "expected": "error!" + }, { + "it": "should use the top-level fallback if a dependency is missing because of an unfulfilled peer dependency", + "imported": "test-1", + "importer": "/path/to/project/workspace-unfulfilled-peer-dependency/", + "expected": "/path/to/project/test-1/" + }, { + "it": "should use the fallback pool if a dependency is missing because of an unfulfilled peer dependency", + "imported": "test-2", + "importer": "/path/to/project/workspace-unfulfilled-peer-dependency/", + "expected": "/path/to/project/test-2/" + }] +}, { + "manifest": { + "__info": [], + "dependencyTreeRoots": [{ + "name": "root", + "reference": "workspace:." + }], + "ignorePatternData": null, + "enableTopLevelFallback": false, + "fallbackPool": [ + ["test", "npm:1.0.0"] + ], + "fallbackExclusionList": [], + "packageRegistryData": [ + [null, [ + [null, { + "packageLocation": "./", + "packageDependencies": [], + "linkType": "SOFT" + }] + ]], + ["root", [ + ["workspace:.", { + "packageLocation": "./", + "packageDependencies": [], + "linkType": "SOFT" + }] + ]], + ["test", [ + ["npm:1.0.0", { + "packageLocation": "./test-1/", + "packageDependencies": [], + "linkType": "HARD" + }] + ]] + ] + }, + "tests": [{ + "it": "should ignore the fallback pool if enableTopLevelFallback is set to false", + "imported": "test", + "importer": "/path/to/project/", + "expected": "error!" + }] +}, { + "manifest": { + "__info": [], + "dependencyTreeRoots": [{ + "name": "root", + "reference": "workspace:." + }], + "ignorePatternData": "^not-a-workspace(/|$)", + "enableTopLevelFallback": false, + "fallbackPool": [], + "fallbackExclusionList": [], + "packageRegistryData": [ + [null, [ + [null, { + "packageLocation": "./", + "packageDependencies": [], + "linkType": "SOFT" + }] + ]], + ["root", [ + ["workspace:.", { + "packageLocation": "./", + "packageDependencies": [["test", "npm:1.0.0"]], + "linkType": "SOFT" + }] + ]], + ["test", [ + ["npm:1.0.0", { + "packageLocation": "./test/", + "packageDependencies": [], + "linkType": "HARD" + }] + ]] + ] + }, + "tests": [{ + "it": "shouldn't go through PnP when trying to resolve dependencies from packages covered by ignorePatternData", + "imported": "test", + "importer": "/path/to/project/not-a-workspace/", + "expected": "test" + }] +}, { + "manifest": { + "__info": [ + "This file is automatically generated. Do not touch it, or risk", + "your modifications being lost." + ], + "dependencyTreeRoots": [{ + "name": "root", + "reference": "workspace:." + }], + "enableTopLevelFallback": true, + "ignorePatternData": null, + "fallbackExclusionList": [], + "fallbackPool": [], + "packageRegistryData": [ + [null, [ + [null, { + "packageLocation": "./", + "packageDependencies": [ + ["root", "workspace:."], + ["pad-left", "npm:2.1.0"] + ], + "linkType": "SOFT" + }] + ]], + ["my-project", [ + ["workspace:.", { + "packageLocation": "./", + "packageDependencies": [ + ["root", "workspace:."], + ["pad-left", "npm:2.1.0"] + ], + "linkType": "SOFT" + }] + ]], + ["pad-left", [ + ["npm:2.1.0", { + "packageLocation": "../yarn/global/cache/pad-left-npm-2.1.0-ffe13d2d40-10c0.zip/node_modules/pad-left/", + "packageDependencies": [ + ["pad-left", "npm:2.1.0"], + ["repeat-string", "npm:1.6.1"] + ], + "linkType": "HARD" + }] + ]], + ["repeat-string", [ + ["npm:1.6.1", { + "packageLocation": "../yarn/global/cache/repeat-string-npm-1.6.1-bc8e388655-10c0.zip/node_modules/repeat-string/", + "packageDependencies": [ + ["repeat-string", "npm:1.6.1"] + ], + "linkType": "HARD" + }] + ]] + ] + }, + "tests": [{ + "it": "should resolve global packages", + "imported": "pad-left", + "importer": "/path/to/project/", + "expected": "/path/to/yarn/global/cache/pad-left-npm-2.1.0-ffe13d2d40-10c0.zip/node_modules/pad-left/" + }, { + "it": "should resolve global packages from third-party dependencies", + "imported": "repeat-string", + "importer": "/path/to/yarn/global/cache/pad-left-npm-2.1.0-ffe13d2d40-10c0.zip/node_modules/pad-left/", + "expected": "/path/to/yarn/global/cache/repeat-string-npm-1.6.1-bc8e388655-10c0.zip/node_modules/repeat-string/" + }] +}] diff --git a/internal/module/pnp/utils/normalize_path.go b/internal/module/pnp/utils/normalize_path.go new file mode 100644 index 0000000000..91c39f0666 --- /dev/null +++ b/internal/module/pnp/utils/normalize_path.go @@ -0,0 +1,61 @@ +package utils + +import ( + "os" + "strings" +) + +func NormalizePath(original string) string { + origPortable := toPortablePath(original) + + rooted := strings.HasPrefix(origPortable, "/") + + body := origPortable + if rooted { + body = strings.TrimPrefix(body, "/") + } + + var parts []string + if body != "" { + parts = strings.FieldsFunc(body, func(r rune) bool { return r == '/' || r == '\\' }) + } + + out := make([]string, 0, len(parts)) + + for _, comp := range parts { + switch comp { + case "", ".": + case "..": + switch { + case rooted && len(out) == 0: + case len(out) == 0 || out[len(out)-1] == "..": + out = append(out, "..") + default: + out = out[:len(out)-1] + } + default: + out = append(out, comp) + } + } + + if rooted { + if len(out) == 0 { + return fromPortablePath("/") + } + out = append([]string{""}, out...) + } + + if len(out) == 0 { + return fromPortablePath(".") + } + + str := strings.Join(out, "/") + + hasTrailing := strings.HasSuffix(origPortable, "/") || + strings.HasSuffix(original, string(os.PathSeparator)) + if hasTrailing && !strings.HasSuffix(str, "/") { + str += "/" + } + + return fromPortablePath(str) +} diff --git a/internal/module/pnp/utils/normalize_path_test.go b/internal/module/pnp/utils/normalize_path_test.go new file mode 100644 index 0000000000..ee4cc590d1 --- /dev/null +++ b/internal/module/pnp/utils/normalize_path_test.go @@ -0,0 +1,35 @@ +package utils + +import "testing" + +func TestNormalizePath(t *testing.T) { + tests := []struct { + in, want string + }{ + {"", "."}, + {"/", "/"}, + {"foo", "foo"}, + {"foo/bar", "foo/bar"}, + {"foo//bar", "foo/bar"}, + {"foo/./bar", "foo/bar"}, + {"foo/../bar", "bar"}, + {"foo/..//bar", "bar"}, + {"foo/bar/..", "foo"}, + {"foo/../../bar", "../bar"}, + {"../foo/../../bar", "../../bar"}, + {"./foo", "foo"}, + {"../foo", "../foo"}, + {"../D:/foo", "../D:/foo"}, + {"/foo/bar", "/foo/bar"}, + {"/foo/../../bar/baz", "/bar/baz"}, + {"/../foo/bar", "/foo/bar"}, + {"/../foo/bar//", "/foo/bar/"}, + {"/foo/bar/", "/foo/bar/"}, + } + + for _, tc := range tests { + if got := NormalizePath(tc.in); got != tc.want { + t.Errorf("NormalizePath(%q) = %q; want %q", tc.in, got, tc.want) + } + } +} diff --git a/internal/module/pnp/utils/portable_path.go b/internal/module/pnp/utils/portable_path.go new file mode 100644 index 0000000000..3976ce1471 --- /dev/null +++ b/internal/module/pnp/utils/portable_path.go @@ -0,0 +1,45 @@ +package utils + +import ( + "regexp" + "runtime" +) + +var reWindowsPath = regexp.MustCompile(`^([a-zA-Z]:.*)$`) +var reUNCWindowsPath = regexp.MustCompile(`^[\/\\][\/\\](\.[\/\\])?(.*)$`) +var rePortablePath = regexp.MustCompile(`^\/([a-zA-Z]:.*)$`) +var reUNCPortablePath = regexp.MustCompile(`^\/unc\/(\.dot\/)?(.*)$`) + +func toPortablePath(s string) string { + if runtime.GOOS != "windows" { + return s + } + if m := reWindowsPath.FindStringSubmatch(s); m != nil { + return "/" + m[1] + } + if m := reUNCWindowsPath.FindStringSubmatch(s); m != nil { + if m[1] != "" { + return "/unc/.dot/" + m[2] + } + return "/unc/" + m[2] + } + return s +} + +func fromPortablePath(s string) string { + if runtime.GOOS != "windows" { + return s + } + // "/C:..." → "C:..." + if m := rePortablePath.FindStringSubmatch(s); m != nil { + return m[1] + } + // "/unc/(.dot/)?rest" + if m := reUNCPortablePath.FindStringSubmatch(s); m != nil { + if m[1] != "" { + return `\\.\` + m[2] + } + return `\\` + m[2] + } + return s +} diff --git a/internal/module/pnp/utils/trie.go b/internal/module/pnp/utils/trie.go new file mode 100644 index 0000000000..688c544768 --- /dev/null +++ b/internal/module/pnp/utils/trie.go @@ -0,0 +1,32 @@ +package utils + +import ( + "strings" +) + +type Trie[T any] struct { + inner *TrieInternal[T] +} + +func NewTrie[T any]() *Trie[T] { + return &Trie[T]{inner: New[T]()} +} + +func (t *Trie[T]) key(key string) string { + p := NormalizePath(key) + + if !strings.HasSuffix(p, "/") { + return p + "/" + } + + return p +} + +func (t *Trie[T]) GetAncestorValue(p string) (*T, bool) { + v, ok := t.inner.GetAncestorValue(t.key(p)) + return &v, ok +} + +func (t *Trie[T]) Insert(p string, v T) { + t.inner.Set(t.key(p), v) +} diff --git a/internal/module/pnp/utils/trie_internal.go b/internal/module/pnp/utils/trie_internal.go new file mode 100644 index 0000000000..803dd3f447 --- /dev/null +++ b/internal/module/pnp/utils/trie_internal.go @@ -0,0 +1,80 @@ +package utils + +type TrieInternal[T any] struct { + root *node[T] +} + +type node[T any] struct { + children map[rune]*node[T] + value T + hasValue bool +} + +func New[T any]() *TrieInternal[T] { + return &TrieInternal[T]{root: &node[T]{children: make(map[rune]*node[T])}} +} + +func (t *TrieInternal[T]) Set(key string, v T) { + n := t.root + for _, r := range key { + child, ok := n.children[r] + if !ok { + child = &node[T]{children: make(map[rune]*node[T])} + n.children[r] = child + } + n = child + } + n.value = v + n.hasValue = true +} + +func (t *TrieInternal[T]) Get(key string) (T, bool) { + n := t.root + for _, r := range key { + child, ok := n.children[r] + if !ok { + var zero T + return zero, false + } + n = child + } + if n.hasValue { + return n.value, true + } + var zero T + return zero, false +} + +func (t *TrieInternal[T]) GetAncestorValue(key string) (T, bool) { + n := t.root + + var best T + var okBest bool + if n.hasValue { + best, okBest = n.value, true + } + + for _, r := range key { + child, ok := n.children[r] + if !ok { + var zero T + if okBest { + return best, true + } + return zero, false + } + n = child + if n.hasValue { + best, okBest = n.value, true + } + } + + if n.hasValue { + return n.value, true + } + var zero T + if okBest { + return best, true + } + return zero, false +} diff --git a/internal/module/pnp/utils/trie_internal_test.go b/internal/module/pnp/utils/trie_internal_test.go new file mode 100644 index 0000000000..544c3c0fb1 --- /dev/null +++ b/internal/module/pnp/utils/trie_internal_test.go @@ -0,0 +1,165 @@ +package utils + +import ( + "strconv" + "testing" +) + +func TestSetAndGet(t *testing.T) { + tr := New[string]() + tr.Set("foo", "A") + tr.Set("foobar", "B") + tr.Set("bar", "C") + + tests := []struct { + key string + want string + wantOkay bool + }{ + {"foo", "A", true}, + {"foobar", "B", true}, + {"bar", "C", true}, + {"fo", "", false}, + {"baz", "", false}, + } + + for _, tc := range tests { + got, ok := tr.Get(tc.key) + if ok != tc.wantOkay || (ok && got != tc.want) { + t.Fatalf("Get(%q) = (%q,%v), want (%q,%v)", tc.key, got, ok, tc.want, tc.wantOkay) + } + } +} + +func TestGetAncestorValue_Basic(t *testing.T) { + tr := New[string]() + tr.Set("foo", "A") + tr.Set("foobar", "B") + + tests := []struct { + key string + want string + wantOkay bool + }{ + {"foobar", "B", true}, + {"fo", "", false}, + {"foz", "", false}, + {"foobaz", "A", true}, + {"x", "", false}, + } + + for _, tc := range tests { + got, ok := tr.GetAncestorValue(tc.key) + if ok != tc.wantOkay || (ok && got != tc.want) { + t.Fatalf("GetAncestorValue(%q) = (%q,%v), want (%q,%v)", + tc.key, got, ok, tc.want, tc.wantOkay) + } + } +} + +func TestGetAncestorValue_Unicode(t *testing.T) { + tr := New[string]() + tr.Set("한", "H1") + tr.Set("한글", "H2") + tr.Set("한글날", "H3") + + tests := []struct { + key string + want string + wantOkay bool + }{ + {"한", "H1", true}, + {"한글", "H2", true}, + {"한글날", "H3", true}, + {"한글나라", "H2", true}, + {"한국", "H1", true}, + } + + for _, tc := range tests { + got, ok := tr.GetAncestorValue(tc.key) + if ok != tc.wantOkay || (ok && got != tc.want) { + t.Fatalf("Unicode GetAncestorValue(%q) = (%q,%v), want (%q,%v)", + tc.key, got, ok, tc.want, tc.wantOkay) + } + } +} + +func TestRootValue_AsAncestor(t *testing.T) { + tr := New[string]() + tr.Set("", "ROOT") + tr.Set("a", "A") + + tests := []struct { + key string + want string + wantOkay bool + }{ + {"", "ROOT", true}, + {"x", "ROOT", true}, + {"ab", "A", true}, + } + + for _, tc := range tests { + got, ok := tr.GetAncestorValue(tc.key) + if ok != tc.wantOkay || (ok && got != tc.want) { + t.Fatalf("Root GetAncestorValue(%q) = (%q,%v), want (%q,%v)", + tc.key, got, ok, tc.want, tc.wantOkay) + } + } +} + +func TestZeroValue_Int(t *testing.T) { + tr := New[int]() + tr.Set("zero", 0) + tr.Set("one", 1) + + got, ok := tr.Get("zero") + if !ok || got != 0 { + t.Fatalf("Get(zero) = (%d,%v), want (0,true)", got, ok) + } + + got2, ok2 := tr.GetAncestorValue("zero-suffix") + if !ok2 || got2 != 0 { + t.Fatalf("GetAncestorValue(zero-suffix) = (%d,%v), want (0,true)", got2, ok2) + } +} + +func TestGetAncestorValue_NoAncestor(t *testing.T) { + tr := New[string]() + + if _, ok := tr.GetAncestorValue("anything"); ok { + t.Fatalf("expected no ancestor value, but got ok=true") + } +} + +func TestGetAncestorValue_LongestPrefixWins(t *testing.T) { + tr := New[string]() + // "a", "ab", "abc", ..., "abcdefghij" + prefix := "" + for i := 0; i < 10; i++ { + prefix += "a" + tr.Set(prefix, "V"+strconv.Itoa(i)) + } + // "aaaaaaaaax" + key := prefix + "x" + + got, ok := tr.GetAncestorValue(key) + if !ok || got != "V9" { + t.Fatalf("LongestPrefix GetAncestorValue = (%q,%v), want (\"V9\",true)", got, ok) + } +} + +func BenchmarkGetAncestorValue(b *testing.B) { + tr := New[string]() + for i := 0; i < 1000; i++ { + tr.Set("key-"+strconv.Itoa(i), "V"+strconv.Itoa(i)) + } + tr.Set("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "LONG") + + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, _ = tr.GetAncestorValue("key-123-extra") + _, _ = tr.GetAncestorValue("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaax") + _, _ = tr.GetAncestorValue("zzz") // 미스 + } +} diff --git a/internal/module/resolver.go b/internal/module/resolver.go index 82d9b4bf35..f58b95caff 100644 --- a/internal/module/resolver.go +++ b/internal/module/resolver.go @@ -6,11 +6,11 @@ import ( "strings" "sync" - "github.com/gun-yu/pnp-go/pkg" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/collections" "github.com/microsoft/typescript-go/internal/core" "github.com/microsoft/typescript-go/internal/diagnostics" + "github.com/microsoft/typescript-go/internal/module/pnp" "github.com/microsoft/typescript-go/internal/packagejson" "github.com/microsoft/typescript-go/internal/semver" "github.com/microsoft/typescript-go/internal/tspath" @@ -149,7 +149,7 @@ type Resolver struct { compilerOptions *core.CompilerOptions typingsLocation string projectName string - pnpResolutionConfig *pkg.ResolutionConfig + pnpResolutionConfig *pnp.ResolutionConfig } func NewResolver( @@ -157,7 +157,7 @@ func NewResolver( options *core.CompilerOptions, typingsLocation string, projectName string, - pnpResolutionConfig *pkg.ResolutionConfig, + pnpResolutionConfig *pnp.ResolutionConfig, ) *Resolver { return &Resolver{ host: host, diff --git a/internal/module/resolver_pnp.go b/internal/module/resolver_pnp.go index 030b88b421..3389398de9 100644 --- a/internal/module/resolver_pnp.go +++ b/internal/module/resolver_pnp.go @@ -3,12 +3,12 @@ package module import ( "strings" - "github.com/gun-yu/pnp-go/pkg" + "github.com/microsoft/typescript-go/internal/module/pnp" "github.com/microsoft/typescript-go/internal/tspath" ) func (r *resolutionState) loadPNPResolutionPath(moduleName string) (string, error) { - resolution, err := pkg.ResolveToUnqualified(moduleName, r.containingDirectory, r.resolver.pnpResolutionConfig) + resolution, err := pnp.ResolveToUnqualified(moduleName, r.containingDirectory, r.resolver.pnpResolutionConfig) if err != nil { return "", err } diff --git a/internal/project/compilerhost.go b/internal/project/compilerhost.go index b038c56992..9040a297a8 100644 --- a/internal/project/compilerhost.go +++ b/internal/project/compilerhost.go @@ -3,10 +3,10 @@ package project import ( "time" - "github.com/gun-yu/pnp-go/pkg" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/collections" "github.com/microsoft/typescript-go/internal/compiler" + "github.com/microsoft/typescript-go/internal/module/pnp" "github.com/microsoft/typescript-go/internal/project/logging" "github.com/microsoft/typescript-go/internal/tsoptions" "github.com/microsoft/typescript-go/internal/tspath" @@ -28,7 +28,7 @@ type compilerHost struct { project *Project builder *projectCollectionBuilder logger *logging.LogTree - pnpResolutionConfig *pkg.ResolutionConfig + pnpResolutionConfig *pnp.ResolutionConfig } type builderFileSource struct { @@ -111,7 +111,7 @@ func (c *compilerHost) GetCurrentDirectory() string { } // GetPNPResolutionConfig implements compiler.CompilerHost. -func (c *compilerHost) GetPNPResolutionConfig() *pkg.ResolutionConfig { +func (c *compilerHost) GetPNPResolutionConfig() *pnp.ResolutionConfig { return c.pnpResolutionConfig } From f24a170f117b5d0fb531023a872f59e74cae9580 Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Sun, 12 Oct 2025 04:00:51 +0900 Subject: [PATCH 08/69] remove useless code --- internal/module/pnp/utils/trie_internal_test.go | 2 +- internal/module/resolver.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/module/pnp/utils/trie_internal_test.go b/internal/module/pnp/utils/trie_internal_test.go index 544c3c0fb1..9e2aab45b3 100644 --- a/internal/module/pnp/utils/trie_internal_test.go +++ b/internal/module/pnp/utils/trie_internal_test.go @@ -160,6 +160,6 @@ func BenchmarkGetAncestorValue(b *testing.B) { for i := 0; i < b.N; i++ { _, _ = tr.GetAncestorValue("key-123-extra") _, _ = tr.GetAncestorValue("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaax") - _, _ = tr.GetAncestorValue("zzz") // 미스 + _, _ = tr.GetAncestorValue("zzz") } } diff --git a/internal/module/resolver.go b/internal/module/resolver.go index f58b95caff..5e21b8ff86 100644 --- a/internal/module/resolver.go +++ b/internal/module/resolver.go @@ -1549,7 +1549,6 @@ func (r *resolutionState) loadNodeModuleFromDirectoryWorker(ext extensions, cand packageFile = file onlyRecordFailuresForPackageFile = !r.resolver.host.FS().DirectoryExists(tspath.GetDirectoryPath(file)) } - } else { } } From b4aaac83ed4bbd50c0e0e4677f5f7425c0ab5230 Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Sun, 12 Oct 2025 04:06:19 +0900 Subject: [PATCH 09/69] remove useless code --- internal/module/resolver.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/module/resolver.go b/internal/module/resolver.go index 5e21b8ff86..a6c40c568f 100644 --- a/internal/module/resolver.go +++ b/internal/module/resolver.go @@ -590,8 +590,7 @@ func (r *resolutionState) loadModuleFromExports(packageInfo *packagejson.InfoCac } } if mainExport.Type != packagejson.JSONValueTypeNotPresent { - result := r.loadModuleFromTargetExportOrImport(ext, subpath, packageInfo, false /*isImports*/, mainExport, "", false /*isPattern*/, ".") - return result + return r.loadModuleFromTargetExportOrImport(ext, subpath, packageInfo, false /*isImports*/, mainExport, "", false /*isPattern*/, ".") } } else if packageInfo.Contents.Exports.Type == packagejson.JSONValueTypeObject && packageInfo.Contents.Exports.IsSubpaths() { if result := r.loadModuleFromExportsOrImports(ext, subpath, packageInfo.Contents.Exports.AsObject(), packageInfo, false /*isImports*/); !result.shouldContinueSearching() { From 23735523422dd5c72d3eb316ca6beebe02fdbb11 Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Sun, 12 Oct 2025 04:30:29 +0900 Subject: [PATCH 10/69] use go-json-experiment/json --- internal/module/pnp/lib_test.go | 10 +++++++--- internal/module/pnp/manifest.go | 20 +++++++++++--------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/internal/module/pnp/lib_test.go b/internal/module/pnp/lib_test.go index d0085850f8..987793a993 100644 --- a/internal/module/pnp/lib_test.go +++ b/internal/module/pnp/lib_test.go @@ -1,7 +1,6 @@ package pnp import ( - "encoding/json" "fmt" "log" "os" @@ -10,6 +9,8 @@ import ( "strings" "testing" + "github.com/go-json-experiment/json" + "github.com/microsoft/typescript-go/internal/module/pnp/utils" ) @@ -88,7 +89,7 @@ func TestResolveUnqualified(t *testing.T) { } var suites []TestSuite - if err := json.Unmarshal(content, &suites); err != nil { + if err = json.Unmarshal(content, &suites); err != nil { t.Fatalf("Assertion failed: Expected the expectations to be loaded: %v", err) } @@ -99,7 +100,10 @@ func TestResolveUnqualified(t *testing.T) { testSuite := &suites[si] manifest := &testSuite.Manifest - InitPNPManifest(manifest, "/path/to/project/.pnp.cjs") + err := InitPNPManifest(manifest, "/path/to/project/.pnp.cjs") + if err != nil { + t.Fatalf("failed to init pnp manifest: %v", err) + } for _, tc := range testSuite.Tests { parent := filepath.Join(tc.Importer, "fooo") diff --git a/internal/module/pnp/manifest.go b/internal/module/pnp/manifest.go index 4206add898..e76cba5d35 100644 --- a/internal/module/pnp/manifest.go +++ b/internal/module/pnp/manifest.go @@ -2,10 +2,12 @@ package pnp import ( "bytes" - "encoding/json" "errors" "regexp" + "github.com/go-json-experiment/json" + "github.com/go-json-experiment/json/jsontext" + "github.com/microsoft/typescript-go/internal/module/pnp/utils" ) @@ -101,13 +103,13 @@ func (r *RegexDef) UnmarshalJSON(b []byte) error { } func (m *FallbackPool) UnmarshalJSON(data []byte) error { - var items []json.RawMessage + var items []jsontext.Value if err := json.Unmarshal(data, &items); err != nil { return err } res := make(FallbackPool, len(items)) for _, it := range items { - var pair []json.RawMessage + var pair []jsontext.Value if err := json.Unmarshal(it, &pair); err != nil { return err } @@ -138,13 +140,13 @@ func (m *FallbackPool) UnmarshalJSON(data []byte) error { type FallbackExclusionList map[string][]string func (m *FallbackExclusionList) UnmarshalJSON(data []byte) error { - var items []json.RawMessage + var items []jsontext.Value if err := json.Unmarshal(data, &items); err != nil { return err } res := make(FallbackExclusionList, len(items)) for _, it := range items { - var pair []json.RawMessage + var pair []jsontext.Value if err := json.Unmarshal(it, &pair); err != nil { return err } @@ -168,13 +170,13 @@ func (m *FallbackExclusionList) UnmarshalJSON(data []byte) error { type PackageRegistryData map[string]map[string]PackageInformation func (m *PackageRegistryData) UnmarshalJSON(data []byte) error { - var items []json.RawMessage + var items []jsontext.Value if err := json.Unmarshal(data, &items); err != nil { return err } res := make(PackageRegistryData, len(items)) for _, it := range items { - var pair []json.RawMessage + var pair []jsontext.Value if err := json.Unmarshal(it, &pair); err != nil { return err } @@ -191,13 +193,13 @@ func (m *PackageRegistryData) UnmarshalJSON(data []byte) error { k1 = *key1 } - var inner []json.RawMessage + var inner []jsontext.Value if err := json.Unmarshal(pair[1], &inner); err != nil { return err } innerMap := make(map[string]PackageInformation, len(inner)) for _, e := range inner { - var p2 []json.RawMessage + var p2 []jsontext.Value if err := json.Unmarshal(e, &p2); err != nil { return err } From f09cda5eb34575c1a29afb0dfaa7febd3f76b99a Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Sun, 12 Oct 2025 14:09:34 +0900 Subject: [PATCH 11/69] lint fix --- internal/module/pnp/lib.go | 53 +++++++++------- internal/module/pnp/lib_test.go | 61 ++++++++++++------- internal/module/pnp/utils/normalize_path.go | 2 + .../module/pnp/utils/normalize_path_test.go | 1 + .../module/pnp/utils/trie_internal_test.go | 13 +++- internal/vfs/pnpvfs/pnpvfs.go | 8 +-- 6 files changed, 83 insertions(+), 55 deletions(-) diff --git a/internal/module/pnp/lib.go b/internal/module/pnp/lib.go index cd46b507d4..8e600f220f 100644 --- a/internal/module/pnp/lib.go +++ b/internal/module/pnp/lib.go @@ -1,7 +1,7 @@ package pnp import ( - "encoding/json" + "errors" "fmt" "os" "path/filepath" @@ -9,6 +9,7 @@ import ( "slices" "strings" + "github.com/go-json-experiment/json" "github.com/microsoft/typescript-go/internal/module/pnp/utils" ) @@ -33,7 +34,7 @@ type Resolution struct { ModulePath *string } -type UndeclaredDependency struct { +type UndeclaredDependencyError struct { Message string Request string DependencyName string @@ -41,9 +42,9 @@ type UndeclaredDependency struct { IssuerPath string } -func (e *UndeclaredDependency) Error() string { return e.Message } +func (e *UndeclaredDependencyError) Error() string { return e.Message } -type MissingPeerDependency struct { +type MissingPeerDependencyError struct { Message string Request string DependencyName string @@ -52,21 +53,21 @@ type MissingPeerDependency struct { BrokenAncestors []PackageLocator } -func (e *MissingPeerDependency) Error() string { return e.Message } +func (e *MissingPeerDependencyError) Error() string { return e.Message } -type FailedManifestHydration struct { +type FailedManifestHydrationError struct { Message string ManifestPath string Err error } -func (e *FailedManifestHydration) Error() string { +func (e *FailedManifestHydrationError) Error() string { if e.Err != nil { return fmt.Sprintf("%s\n\nOriginal error: %v", e.Message, e.Err) } return e.Message } -func (e *FailedManifestHydration) Unwrap() error { return e.Err } +func (e *FailedManifestHydrationError) Unwrap() error { return e.Err } func parseScopedPackageName(spec string) (pkg string, sub *string, ok bool) { parts := strings.SplitN(spec, "/", 3) @@ -110,7 +111,7 @@ func ParseBareIdentifier(spec string) (string, *string, error) { pkg, sub, ok = parseGlobalPackageName(spec) } if !ok { - return "", nil, &FailedManifestHydration{ + return "", nil, &FailedManifestHydrationError{ Message: "Invalid specifier", ManifestPath: spec, } @@ -171,11 +172,11 @@ func InitPNPManifest(m *Manifest, manifestPath string) error { ranges, ok := m.PackageRegistryData[""] if !ok { - return fmt.Errorf("assertion failed: should have a top-level name key") + return errors.New("assertion failed: should have a top-level name key") } top, ok := ranges[""] if !ok { - return fmt.Errorf("assertion failed: should have a top-level range key") + return errors.New("assertion failed: should have a top-level range key") } if m.FallbackPool == nil { @@ -193,7 +194,7 @@ func InitPNPManifest(m *Manifest, manifestPath string) error { func LoadPNPManifest(p string) (Manifest, error) { content, err := os.ReadFile(p) if err != nil { - return Manifest{}, &FailedManifestHydration{ + return Manifest{}, &FailedManifestHydrationError{ Message: "We failed to read the content of the manifest.", Err: err, ManifestPath: func() string { @@ -207,7 +208,7 @@ func LoadPNPManifest(p string) (Manifest, error) { loc := rePNP.FindIndex(content) if loc == nil { - return Manifest{}, &FailedManifestHydration{ + return Manifest{}, &FailedManifestHydrationError{ Message: "We failed to locate the PnP data payload inside its manifest file. Did you manually edit the file?", ManifestPath: p, } @@ -221,7 +222,6 @@ func LoadPNPManifest(p string) (Manifest, error) { c := content[i] if c == '\'' && !escaped { - i++ break } else if c == '\\' && !escaped { escaped = true @@ -232,15 +232,22 @@ func LoadPNPManifest(p string) (Manifest, error) { } var manifest Manifest - if err := json.Unmarshal(jsonBuf, &manifest); err != nil { - return Manifest{}, &FailedManifestHydration{ + if err = json.Unmarshal(jsonBuf, &manifest); err != nil { + return Manifest{}, &FailedManifestHydrationError{ Message: "We failed to parse the PnP data payload as proper JSON; Did you manually edit the file?", ManifestPath: p, Err: err, } } - InitPNPManifest(&manifest, p) + err = InitPNPManifest(&manifest, p) + if err != nil { + return Manifest{}, &FailedManifestHydrationError{ + Message: "We failed to init the PnP manifest", + ManifestPath: p, + Err: err, + } + } return manifest, nil } @@ -266,7 +273,7 @@ func IsDependencyTreeRoot(m *Manifest, loc *PackageLocator) bool { func FindLocator(manifest *Manifest, absPath string) *PackageLocator { rel, err := filepath.Rel(manifest.ManifestDir, absPath) if err != nil { - panic(fmt.Sprintf("Assertion failed: Provided path should be absolute but received %s", absPath)) + panic("Assertion failed: Provided path should be absolute but received" + absPath) } if manifest.IgnorePatternData != nil { @@ -358,7 +365,7 @@ func ResolveToUnqualifiedViaManifest( "Your application tried to access %s. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since %s isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: %s%s\nRequired by: %s", ident, ident, ident, viaSuffix(specifier, ident), parentPath, ) - return Resolution{}, &UndeclaredDependency{ + return Resolution{}, &UndeclaredDependencyError{ Message: msg, Request: specifier, DependencyName: ident, @@ -370,7 +377,7 @@ func ResolveToUnqualifiedViaManifest( "%s tried to access %s. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since %s isn't otherwise declared in %s's dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: %s%s\nRequired by: %s", parentLocator.Name, ident, ident, parentLocator.Name, ident, viaSuffix(specifier, ident), parentPath, ) - return Resolution{}, &UndeclaredDependency{ + return Resolution{}, &UndeclaredDependencyError{ Message: msg, Request: specifier, DependencyName: ident, @@ -384,7 +391,7 @@ func ResolveToUnqualifiedViaManifest( "Your application tried to access %s, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.\n\nRequired package: %s%s\nRequired by: %s", ident, ident, viaSuffix(specifier, ident), parentPath, ) - return Resolution{}, &UndeclaredDependency{ + return Resolution{}, &UndeclaredDependencyError{ Message: msg, Request: specifier, DependencyName: ident, @@ -419,7 +426,7 @@ func ResolveToUnqualifiedViaManifest( ) } - return Resolution{}, &MissingPeerDependency{ + return Resolution{}, &MissingPeerDependencyError{ Message: msg, Request: specifier, DependencyName: ident, @@ -455,7 +462,7 @@ func ResolveToUnqualifiedViaManifest( func ResolveToUnqualified(specifier, parentPath string, cfg *ResolutionConfig) (Resolution, error) { if cfg == nil || cfg.Host.FindPNPManifest == nil { - return Resolution{}, fmt.Errorf("no host configured") + return Resolution{}, errors.New("no host configured") } m, err := cfg.Host.FindPNPManifest(parentPath) if err != nil { diff --git a/internal/module/pnp/lib_test.go b/internal/module/pnp/lib_test.go index 987793a993..769418be79 100644 --- a/internal/module/pnp/lib_test.go +++ b/internal/module/pnp/lib_test.go @@ -26,7 +26,8 @@ type TestCase struct { It string `json:"it"` } -func Example() { +func TestResolveToUnqualifiedExample(t *testing.T) { + t.Parallel() m, err := LoadPNPManifest("/testdata/pnp-yarn-v3.cjs") if err != nil { log.Fatalf("Expected to load the .pnp.cjs file generated by Yarn 3: %v", err) @@ -39,26 +40,30 @@ func Example() { } cfg := &ResolutionConfig{Host: host} - res, err := ResolveToUnqualified("lodash/cloneDeep", "/path/to/file", cfg) - if err != nil { - log.Printf("resolution error: %v", err) - return - } - - switch res.Kind { - case ResolutionResolved: - sub := "" - if res.ModulePath != nil { - sub = *res.ModulePath + t.Run("Example", func(t *testing.T) { + t.Parallel() + res, resolutionErr := ResolveToUnqualified("lodash/cloneDeep", "/path/to/file", cfg) + if resolutionErr != nil { + log.Printf("resolution error: %v", err) + return } - log.Printf("Resolved: path=%s subpath=%s", res.Path, sub) - case ResolutionSkipped: - log.Printf("Skipped by PnP resolver; use default resolver") - } + switch res.Kind { + case ResolutionResolved: + sub := "" + if res.ModulePath != nil { + sub = *res.ModulePath + } + log.Printf("Resolved: path=%s subpath=%s", res.Path, sub) + + case ResolutionSkipped: + log.Printf("Skipped by PnP resolver; use default resolver") + } + }) } func TestLoadPnPManifest(t *testing.T) { + t.Parallel() cases := []struct { path string msg string @@ -69,6 +74,7 @@ func TestLoadPnPManifest(t *testing.T) { for _, tc := range cases { t.Run(tc.path, func(t *testing.T) { + t.Parallel() if _, err := LoadPNPManifest(tc.path); err != nil { t.Fatalf("%s: %v", tc.msg, err) } @@ -77,6 +83,7 @@ func TestLoadPnPManifest(t *testing.T) { } func TestResolveUnqualified(t *testing.T) { + t.Parallel() cwd, err := os.Getwd() if err != nil { t.Fatalf("Assertion failed: Expected a valid current working directory: %v", err) @@ -118,18 +125,19 @@ func TestResolveUnqualified(t *testing.T) { cfg := &ResolutionConfig{Host: host} t.Run(tc.It, func(t *testing.T) { - res, err := ResolveToUnqualified(tc.Imported, parent, cfg) + t.Parallel() + res, unqualifiedErr := ResolveToUnqualified(tc.Imported, parent, cfg) switch { - case err == nil && res.Kind == ResolutionResolved: + case unqualifiedErr == nil && res.Kind == ResolutionResolved: if res.Path != tc.Expected { t.Fatalf("'%s': expected resolved path %q, got %q", tc.It, tc.Expected, res.Path) } - case err == nil && res.Kind == ResolutionSkipped: + case unqualifiedErr == nil && res.Kind == ResolutionSkipped: if tc.Imported != tc.Expected { t.Fatalf("'%s': expected skipped specifier %q, got %q", tc.It, tc.Expected, tc.Imported) } - case err != nil: + case unqualifiedErr != nil: if tc.Expected != "error!" { t.Fatalf("'%s': unexpected error: %v (expected=%q)", tc.It, err, tc.Expected) } @@ -141,6 +149,7 @@ func TestResolveUnqualified(t *testing.T) { } } func TestEdgeCase_OnePkgCachedAndUnplugged(t *testing.T) { + t.Parallel() cwd, err := os.Getwd() if err != nil { t.Fatalf("failed to get cwd: %v", err) @@ -153,11 +162,14 @@ func TestEdgeCase_OnePkgCachedAndUnplugged(t *testing.T) { } var manifest Manifest - if err := json.Unmarshal(content, &manifest); err != nil { + if err = json.Unmarshal(content, &manifest); err != nil { t.Fatalf("failed to unmarshal manifest: %v", err) } - InitPNPManifest(&manifest, manifestJSONPath) + err = InitPNPManifest(&manifest, manifestJSONPath) + if err != nil { + t.Fatalf("failed to init pnp manifest: %v", err) + } issuer := filepath.Join( cwd, @@ -189,6 +201,7 @@ func TestEdgeCase_OnePkgCachedAndUnplugged(t *testing.T) { } func TestParseSinglePackageName(t *testing.T) { + t.Parallel() name, sub, err := ParseBareIdentifier("pkg") if err != nil { t.Fatalf("unexpected error: %v", err) @@ -202,6 +215,7 @@ func TestParseSinglePackageName(t *testing.T) { } func TestParseScopedPackageName(t *testing.T) { + t.Parallel() name, sub, err := ParseBareIdentifier("@scope/pkg") if err != nil { t.Fatalf("unexpected error: %v", err) @@ -215,6 +229,7 @@ func TestParseScopedPackageName(t *testing.T) { } func TestParsePackageNameWithLongSubpath(t *testing.T) { + t.Parallel() name, sub, err := ParseBareIdentifier("pkg/a/b/c/index.js") if err != nil { t.Fatalf("unexpected error: %v", err) @@ -231,6 +246,7 @@ func TestParsePackageNameWithLongSubpath(t *testing.T) { } func TestParseScopedPackageWithLongSubpath(t *testing.T) { + t.Parallel() name, sub, err := ParseBareIdentifier("@scope/pkg/a/b/c/index.js") if err != nil { t.Fatalf("unexpected error: %v", err) @@ -248,6 +264,7 @@ func TestParseScopedPackageWithLongSubpath(t *testing.T) { // need fixtures to be yarn install and make global cache func TestGlobalCache(t *testing.T) { + t.Parallel() t.Skip("skipping global cache test") cwd, err := os.Getwd() if err != nil { diff --git a/internal/module/pnp/utils/normalize_path.go b/internal/module/pnp/utils/normalize_path.go index 91c39f0666..d7f526f4a4 100644 --- a/internal/module/pnp/utils/normalize_path.go +++ b/internal/module/pnp/utils/normalize_path.go @@ -25,9 +25,11 @@ func NormalizePath(original string) string { for _, comp := range parts { switch comp { case "", ".": + // do nothing case "..": switch { case rooted && len(out) == 0: + // do nothing case len(out) == 0 || out[len(out)-1] == "..": out = append(out, "..") default: diff --git a/internal/module/pnp/utils/normalize_path_test.go b/internal/module/pnp/utils/normalize_path_test.go index ee4cc590d1..01ef6d36c8 100644 --- a/internal/module/pnp/utils/normalize_path_test.go +++ b/internal/module/pnp/utils/normalize_path_test.go @@ -3,6 +3,7 @@ package utils import "testing" func TestNormalizePath(t *testing.T) { + t.Parallel() tests := []struct { in, want string }{ diff --git a/internal/module/pnp/utils/trie_internal_test.go b/internal/module/pnp/utils/trie_internal_test.go index 9e2aab45b3..1587e94c36 100644 --- a/internal/module/pnp/utils/trie_internal_test.go +++ b/internal/module/pnp/utils/trie_internal_test.go @@ -6,6 +6,7 @@ import ( ) func TestSetAndGet(t *testing.T) { + t.Parallel() tr := New[string]() tr.Set("foo", "A") tr.Set("foobar", "B") @@ -32,6 +33,7 @@ func TestSetAndGet(t *testing.T) { } func TestGetAncestorValue_Basic(t *testing.T) { + t.Parallel() tr := New[string]() tr.Set("foo", "A") tr.Set("foobar", "B") @@ -58,6 +60,7 @@ func TestGetAncestorValue_Basic(t *testing.T) { } func TestGetAncestorValue_Unicode(t *testing.T) { + t.Parallel() tr := New[string]() tr.Set("한", "H1") tr.Set("한글", "H2") @@ -85,6 +88,7 @@ func TestGetAncestorValue_Unicode(t *testing.T) { } func TestRootValue_AsAncestor(t *testing.T) { + t.Parallel() tr := New[string]() tr.Set("", "ROOT") tr.Set("a", "A") @@ -109,6 +113,7 @@ func TestRootValue_AsAncestor(t *testing.T) { } func TestZeroValue_Int(t *testing.T) { + t.Parallel() tr := New[int]() tr.Set("zero", 0) tr.Set("one", 1) @@ -125,6 +130,7 @@ func TestZeroValue_Int(t *testing.T) { } func TestGetAncestorValue_NoAncestor(t *testing.T) { + t.Parallel() tr := New[string]() if _, ok := tr.GetAncestorValue("anything"); ok { @@ -133,10 +139,11 @@ func TestGetAncestorValue_NoAncestor(t *testing.T) { } func TestGetAncestorValue_LongestPrefixWins(t *testing.T) { + t.Parallel() tr := New[string]() // "a", "ab", "abc", ..., "abcdefghij" prefix := "" - for i := 0; i < 10; i++ { + for i := range 10 { prefix += "a" tr.Set(prefix, "V"+strconv.Itoa(i)) } @@ -151,13 +158,13 @@ func TestGetAncestorValue_LongestPrefixWins(t *testing.T) { func BenchmarkGetAncestorValue(b *testing.B) { tr := New[string]() - for i := 0; i < 1000; i++ { + for i := range 1000 { tr.Set("key-"+strconv.Itoa(i), "V"+strconv.Itoa(i)) } tr.Set("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "LONG") b.ResetTimer() - for i := 0; i < b.N; i++ { + for range b.N { _, _ = tr.GetAncestorValue("key-123-extra") _, _ = tr.GetAncestorValue("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaax") _, _ = tr.GetAncestorValue("zzz") diff --git a/internal/vfs/pnpvfs/pnpvfs.go b/internal/vfs/pnpvfs/pnpvfs.go index 259d2c00e8..49bbd65099 100644 --- a/internal/vfs/pnpvfs/pnpvfs.go +++ b/internal/vfs/pnpvfs/pnpvfs.go @@ -2,7 +2,6 @@ package pnpvfs import ( "archive/zip" - "fmt" "io" "strconv" "strings" @@ -204,14 +203,9 @@ func (fs *PNPFS) FileExists(path string) bool { func (fs *PNPFS) ReadFile(path string) (contents string, ok bool) { path = mangleYarnPnPVirtualPath(path) - isEmotion := strings.Contains(path, "@emotion/react") - contents, ok = fs.inner.ReadFile(path) if ok { - if isEmotion { - fmt.Println("inner Read", path, len(contents)) - } - return + return contents, ok } // If the file doesn't exist, try reading from an enclosing zip archive From 0a0f05073df06064780f6491c02b367a07d43fc7 Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Sun, 12 Oct 2025 23:43:50 +0900 Subject: [PATCH 12/69] change test data path --- internal/module/pnp/lib_test.go | 32 ++++++------------ ...-dynamic-import-npm-7.8.3-fb9ff5634a-8.zip | Bin .../pnp}/edge_case_manifest_state.json | 0 .../pnp}/global-cache/.yarn/install-state.gz | Bin .../fixtures/pnp}/global-cache/.yarnrc.yml | 0 .../fixtures/pnp}/global-cache/package.json | 0 .../fixtures/pnp}/global-cache/test.js | 0 .../fixtures/pnp}/global-cache/yarn.lock | 0 .../fixtures/pnp}/left-pad-1.zip | Bin .../fixtures/pnp}/left-pad-2.zip | Bin .../fixtures/pnp}/pnp-yarn-v3.cjs | 0 .../fixtures/pnp}/pnp-yarn-v4.cjs | 0 .../fixtures/pnp}/test-expectations.json | 0 13 files changed, 11 insertions(+), 21 deletions(-) rename {internal/module/pnp/testdata => testdata/fixtures/pnp}/@babel-plugin-syntax-dynamic-import-npm-7.8.3-fb9ff5634a-8.zip (100%) rename {internal/module/pnp/testdata => testdata/fixtures/pnp}/edge_case_manifest_state.json (100%) rename {internal/module/pnp/fixtures => testdata/fixtures/pnp}/global-cache/.yarn/install-state.gz (100%) rename {internal/module/pnp/fixtures => testdata/fixtures/pnp}/global-cache/.yarnrc.yml (100%) rename {internal/module/pnp/fixtures => testdata/fixtures/pnp}/global-cache/package.json (100%) rename {internal/module/pnp/fixtures => testdata/fixtures/pnp}/global-cache/test.js (100%) rename {internal/module/pnp/fixtures => testdata/fixtures/pnp}/global-cache/yarn.lock (100%) rename {internal/module/pnp/fixtures => testdata/fixtures/pnp}/left-pad-1.zip (100%) rename {internal/module/pnp/fixtures => testdata/fixtures/pnp}/left-pad-2.zip (100%) rename {internal/module/pnp/testdata => testdata/fixtures/pnp}/pnp-yarn-v3.cjs (100%) rename {internal/module/pnp/testdata => testdata/fixtures/pnp}/pnp-yarn-v4.cjs (100%) rename {internal/module/pnp/testdata => testdata/fixtures/pnp}/test-expectations.json (100%) diff --git a/internal/module/pnp/lib_test.go b/internal/module/pnp/lib_test.go index 769418be79..8d0c085d65 100644 --- a/internal/module/pnp/lib_test.go +++ b/internal/module/pnp/lib_test.go @@ -12,6 +12,7 @@ import ( "github.com/go-json-experiment/json" "github.com/microsoft/typescript-go/internal/module/pnp/utils" + "github.com/microsoft/typescript-go/internal/repo" ) type TestSuite struct { @@ -28,7 +29,8 @@ type TestCase struct { func TestResolveToUnqualifiedExample(t *testing.T) { t.Parallel() - m, err := LoadPNPManifest("/testdata/pnp-yarn-v3.cjs") + pnpPath := filepath.Join(repo.TestDataPath, "fixtures", "pnp", "pnp-yarn-v3.cjs") + m, err := LoadPNPManifest(pnpPath) if err != nil { log.Fatalf("Expected to load the .pnp.cjs file generated by Yarn 3: %v", err) } @@ -68,8 +70,8 @@ func TestLoadPnPManifest(t *testing.T) { path string msg string }{ - {"./testdata/pnp-yarn-v3.cjs", "Expected to load the .pnp.cjs file generated by Yarn 3"}, - {"./testdata/pnp-yarn-v4.cjs", "Expected to load the .pnp.cjs file generated by Yarn 4"}, + {filepath.Join(repo.TestDataPath, "fixtures", "pnp", "pnp-yarn-v3.cjs"), "Expected to load the .pnp.cjs file generated by Yarn 3"}, + {filepath.Join(repo.TestDataPath, "fixtures", "pnp", "pnp-yarn-v4.cjs"), "Expected to load the .pnp.cjs file generated by Yarn 4"}, } for _, tc := range cases { @@ -84,11 +86,7 @@ func TestLoadPnPManifest(t *testing.T) { func TestResolveUnqualified(t *testing.T) { t.Parallel() - cwd, err := os.Getwd() - if err != nil { - t.Fatalf("Assertion failed: Expected a valid current working directory: %v", err) - } - expectationsPath := filepath.Join(cwd, "/testdata", "test-expectations.json") + expectationsPath := filepath.Join(repo.TestDataPath, "fixtures", "pnp", "test-expectations.json") content, err := os.ReadFile(expectationsPath) if err != nil { @@ -150,12 +148,7 @@ func TestResolveUnqualified(t *testing.T) { } func TestEdgeCase_OnePkgCachedAndUnplugged(t *testing.T) { t.Parallel() - cwd, err := os.Getwd() - if err != nil { - t.Fatalf("failed to get cwd: %v", err) - } - - manifestJSONPath := filepath.Join(cwd, "/testdata", "edge_case_manifest_state.json") + manifestJSONPath := filepath.Join(repo.TestDataPath, "fixtures", "pnp", "edge_case_manifest_state.json") content, err := os.ReadFile(manifestJSONPath) if err != nil { t.Fatalf("failed to read manifest json: %v", err) @@ -172,8 +165,9 @@ func TestEdgeCase_OnePkgCachedAndUnplugged(t *testing.T) { } issuer := filepath.Join( - cwd, - "testdata", + repo.TestDataPath, + "fixtures", + "pnp", ".yarn", "unplugged", "@carbon-icons-react-virtual-379302d360", @@ -266,12 +260,8 @@ func TestParseScopedPackageWithLongSubpath(t *testing.T) { func TestGlobalCache(t *testing.T) { t.Parallel() t.Skip("skipping global cache test") - cwd, err := os.Getwd() - if err != nil { - t.Fatalf("failed to get cwd: %v", err) - } - pnpPath := filepath.Join(cwd, "/fixtures", "global-cache", ".pnp.cjs") + pnpPath := filepath.Join(repo.TestDataPath, "fixtures", "pnp", "global-cache", ".pnp.cjs") manifest, err := LoadPNPManifest(pnpPath) if err != nil { t.Fatalf("failed to load pnp manifest: %v", err) diff --git a/internal/module/pnp/testdata/@babel-plugin-syntax-dynamic-import-npm-7.8.3-fb9ff5634a-8.zip b/testdata/fixtures/pnp/@babel-plugin-syntax-dynamic-import-npm-7.8.3-fb9ff5634a-8.zip similarity index 100% rename from internal/module/pnp/testdata/@babel-plugin-syntax-dynamic-import-npm-7.8.3-fb9ff5634a-8.zip rename to testdata/fixtures/pnp/@babel-plugin-syntax-dynamic-import-npm-7.8.3-fb9ff5634a-8.zip diff --git a/internal/module/pnp/testdata/edge_case_manifest_state.json b/testdata/fixtures/pnp/edge_case_manifest_state.json similarity index 100% rename from internal/module/pnp/testdata/edge_case_manifest_state.json rename to testdata/fixtures/pnp/edge_case_manifest_state.json diff --git a/internal/module/pnp/fixtures/global-cache/.yarn/install-state.gz b/testdata/fixtures/pnp/global-cache/.yarn/install-state.gz similarity index 100% rename from internal/module/pnp/fixtures/global-cache/.yarn/install-state.gz rename to testdata/fixtures/pnp/global-cache/.yarn/install-state.gz diff --git a/internal/module/pnp/fixtures/global-cache/.yarnrc.yml b/testdata/fixtures/pnp/global-cache/.yarnrc.yml similarity index 100% rename from internal/module/pnp/fixtures/global-cache/.yarnrc.yml rename to testdata/fixtures/pnp/global-cache/.yarnrc.yml diff --git a/internal/module/pnp/fixtures/global-cache/package.json b/testdata/fixtures/pnp/global-cache/package.json similarity index 100% rename from internal/module/pnp/fixtures/global-cache/package.json rename to testdata/fixtures/pnp/global-cache/package.json diff --git a/internal/module/pnp/fixtures/global-cache/test.js b/testdata/fixtures/pnp/global-cache/test.js similarity index 100% rename from internal/module/pnp/fixtures/global-cache/test.js rename to testdata/fixtures/pnp/global-cache/test.js diff --git a/internal/module/pnp/fixtures/global-cache/yarn.lock b/testdata/fixtures/pnp/global-cache/yarn.lock similarity index 100% rename from internal/module/pnp/fixtures/global-cache/yarn.lock rename to testdata/fixtures/pnp/global-cache/yarn.lock diff --git a/internal/module/pnp/fixtures/left-pad-1.zip b/testdata/fixtures/pnp/left-pad-1.zip similarity index 100% rename from internal/module/pnp/fixtures/left-pad-1.zip rename to testdata/fixtures/pnp/left-pad-1.zip diff --git a/internal/module/pnp/fixtures/left-pad-2.zip b/testdata/fixtures/pnp/left-pad-2.zip similarity index 100% rename from internal/module/pnp/fixtures/left-pad-2.zip rename to testdata/fixtures/pnp/left-pad-2.zip diff --git a/internal/module/pnp/testdata/pnp-yarn-v3.cjs b/testdata/fixtures/pnp/pnp-yarn-v3.cjs similarity index 100% rename from internal/module/pnp/testdata/pnp-yarn-v3.cjs rename to testdata/fixtures/pnp/pnp-yarn-v3.cjs diff --git a/internal/module/pnp/testdata/pnp-yarn-v4.cjs b/testdata/fixtures/pnp/pnp-yarn-v4.cjs similarity index 100% rename from internal/module/pnp/testdata/pnp-yarn-v4.cjs rename to testdata/fixtures/pnp/pnp-yarn-v4.cjs diff --git a/internal/module/pnp/testdata/test-expectations.json b/testdata/fixtures/pnp/test-expectations.json similarity index 100% rename from internal/module/pnp/testdata/test-expectations.json rename to testdata/fixtures/pnp/test-expectations.json From 94a15b7c6da4732bde42ce96f824465d7d31e426 Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Sun, 12 Oct 2025 23:46:19 +0900 Subject: [PATCH 13/69] fix hereby format --- internal/module/pnp/utils/portable_path.go | 10 ++++++---- testdata/fixtures/pnp/global-cache/package.json | 10 +++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/internal/module/pnp/utils/portable_path.go b/internal/module/pnp/utils/portable_path.go index 3976ce1471..741ce8d78a 100644 --- a/internal/module/pnp/utils/portable_path.go +++ b/internal/module/pnp/utils/portable_path.go @@ -5,10 +5,12 @@ import ( "runtime" ) -var reWindowsPath = regexp.MustCompile(`^([a-zA-Z]:.*)$`) -var reUNCWindowsPath = regexp.MustCompile(`^[\/\\][\/\\](\.[\/\\])?(.*)$`) -var rePortablePath = regexp.MustCompile(`^\/([a-zA-Z]:.*)$`) -var reUNCPortablePath = regexp.MustCompile(`^\/unc\/(\.dot\/)?(.*)$`) +var ( + reWindowsPath = regexp.MustCompile(`^([a-zA-Z]:.*)$`) + reUNCWindowsPath = regexp.MustCompile(`^[\/\\][\/\\](\.[\/\\])?(.*)$`) + rePortablePath = regexp.MustCompile(`^\/([a-zA-Z]:.*)$`) + reUNCPortablePath = regexp.MustCompile(`^\/unc\/(\.dot\/)?(.*)$`) +) func toPortablePath(s string) string { if runtime.GOOS != "windows" { diff --git a/testdata/fixtures/pnp/global-cache/package.json b/testdata/fixtures/pnp/global-cache/package.json index d963d9a21c..a37d820591 100644 --- a/testdata/fixtures/pnp/global-cache/package.json +++ b/testdata/fixtures/pnp/global-cache/package.json @@ -1,7 +1,7 @@ { - "name": "global-cache", - "dependencies": { - "source-map-support": "^0.5.21" - }, - "packageManager": "yarn@4.10.0" + "name": "global-cache", + "dependencies": { + "source-map-support": "^0.5.21" + }, + "packageManager": "yarn@4.10.0" } From 35d61885deedf4d545c95f164284f76ef183f4e1 Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Mon, 13 Oct 2025 16:40:46 +0900 Subject: [PATCH 14/69] fix hereby check:format --- internal/module/pnp/lib_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/module/pnp/lib_test.go b/internal/module/pnp/lib_test.go index 8d0c085d65..6ffd7ddcd2 100644 --- a/internal/module/pnp/lib_test.go +++ b/internal/module/pnp/lib_test.go @@ -146,6 +146,7 @@ func TestResolveUnqualified(t *testing.T) { } } } + func TestEdgeCase_OnePkgCachedAndUnplugged(t *testing.T) { t.Parallel() manifestJSONPath := filepath.Join(repo.TestDataPath, "fixtures", "pnp", "edge_case_manifest_state.json") From 35ee2efd6deda9a90563e6de812f3253b75ea753 Mon Sep 17 00:00:00 2001 From: YG Date: Tue, 14 Oct 2025 03:48:15 +0900 Subject: [PATCH 15/69] fix window test --- internal/module/pnp/lib.go | 23 +++++----------- internal/module/pnp/lib_test.go | 9 +++++-- internal/module/pnp/utils/normalize_path.go | 7 ++--- .../module/pnp/utils/normalize_path_test.go | 26 ++++++++++++++++++- 4 files changed, 43 insertions(+), 22 deletions(-) diff --git a/internal/module/pnp/lib.go b/internal/module/pnp/lib.go index 8e600f220f..1763498be0 100644 --- a/internal/module/pnp/lib.go +++ b/internal/module/pnp/lib.go @@ -139,12 +139,8 @@ func FindClosestPNPManifestPath(start string) (string, bool) { var rePNP = regexp.MustCompile(`(?s)(const[\ \r\n]+RAW_RUNTIME_STATE[\ \r\n]*=[\ \r\n]*|hydrateRuntimeState\(JSON\.parse\()'`) func InitPNPManifest(m *Manifest, manifestPath string) error { - if abs, err := filepath.Abs(manifestPath); err == nil { - m.ManifestPath = abs - m.ManifestDir = filepath.Dir(abs) - } else { - return fmt.Errorf("assertion failed: %w", err) - } + m.ManifestPath = manifestPath + m.ManifestDir = filepath.Dir(manifestPath) m.LocationTrie = *utils.NewTrie[PackageLocator]() @@ -197,12 +193,7 @@ func LoadPNPManifest(p string) (Manifest, error) { return Manifest{}, &FailedManifestHydrationError{ Message: "We failed to read the content of the manifest.", Err: err, - ManifestPath: func() string { - if abs, e := filepath.Abs(p); e == nil { - return abs - } - return p - }(), + ManifestPath: p, } } @@ -270,10 +261,10 @@ func IsDependencyTreeRoot(m *Manifest, loc *PackageLocator) bool { }) } -func FindLocator(manifest *Manifest, absPath string) *PackageLocator { - rel, err := filepath.Rel(manifest.ManifestDir, absPath) +func FindLocator(manifest *Manifest, path string) *PackageLocator { + rel, err := filepath.Rel(manifest.ManifestDir, path) if err != nil { - panic("Assertion failed: Provided path should be absolute but received" + absPath) + panic("Assertion failed: Provided path should be absolute but received" + path) } if manifest.IgnorePatternData != nil { @@ -285,7 +276,7 @@ func FindLocator(manifest *Manifest, absPath string) *PackageLocator { } } - normFull := utils.NormalizePath(absPath) + normFull := utils.NormalizePath(path) if v, ok := manifest.LocationTrie.GetAncestorValue(normFull); ok && v != nil { return v } diff --git a/internal/module/pnp/lib_test.go b/internal/module/pnp/lib_test.go index 8d0c085d65..672b41321b 100644 --- a/internal/module/pnp/lib_test.go +++ b/internal/module/pnp/lib_test.go @@ -42,9 +42,14 @@ func TestResolveToUnqualifiedExample(t *testing.T) { } cfg := &ResolutionConfig{Host: host} + parentPath, err := filepath.Abs("/path/to/file") + if err != nil { + log.Fatalf("failed to filepath.Abs: %v", err) + } + t.Run("Example", func(t *testing.T) { t.Parallel() - res, resolutionErr := ResolveToUnqualified("lodash/cloneDeep", "/path/to/file", cfg) + res, resolutionErr := ResolveToUnqualified("lodash/cloneDeep", parentPath, cfg) if resolutionErr != nil { log.Printf("resolution error: %v", err) return @@ -175,7 +180,7 @@ func TestEdgeCase_OnePkgCachedAndUnplugged(t *testing.T) { "@carbon", "icons-react", "es", - ) + "/" + ) res, err := ResolveToUnqualifiedViaManifest(&manifest, "@carbon/icon-helpers", issuer) if err != nil { diff --git a/internal/module/pnp/utils/normalize_path.go b/internal/module/pnp/utils/normalize_path.go index d7f526f4a4..8e3ec3262d 100644 --- a/internal/module/pnp/utils/normalize_path.go +++ b/internal/module/pnp/utils/normalize_path.go @@ -8,11 +8,12 @@ import ( func NormalizePath(original string) string { origPortable := toPortablePath(original) - rooted := strings.HasPrefix(origPortable, "/") + rooted := strings.HasPrefix(origPortable, "/") || strings.HasPrefix(origPortable, "\\") body := origPortable if rooted { body = strings.TrimPrefix(body, "/") + body = strings.TrimPrefix(body, "\\") } var parts []string @@ -25,11 +26,11 @@ func NormalizePath(original string) string { for _, comp := range parts { switch comp { case "", ".": - // do nothing + // Those components don't progress the path case "..": switch { case rooted && len(out) == 0: - // do nothing + // No need to add a ".." since we're already at the root case len(out) == 0 || out[len(out)-1] == "..": out = append(out, "..") default: diff --git a/internal/module/pnp/utils/normalize_path_test.go b/internal/module/pnp/utils/normalize_path_test.go index 01ef6d36c8..5f32048984 100644 --- a/internal/module/pnp/utils/normalize_path_test.go +++ b/internal/module/pnp/utils/normalize_path_test.go @@ -1,6 +1,9 @@ package utils -import "testing" +import ( + "runtime" + "testing" +) func TestNormalizePath(t *testing.T) { t.Parallel() @@ -34,3 +37,24 @@ func TestNormalizePath(t *testing.T) { } } } + +func TestNormalizePathWindow(t *testing.T) { + if runtime.GOOS != "windows" { + t.Skip("Windows-only test") + } + t.Parallel() + tests := []struct { + in, want string + }{ + {`D:\foo\..\bar`, "D:/bar"}, + {`D:\foo\..\..\C:\bar\test`, "C:/bar/test"}, + {`\\server-name\foo\..\bar`, `\\server-name/bar`}, + {`\\server-name\foo\..\..\..\C:\bar\test`, "C:/bar/test"}, + } + + for _, tc := range tests { + if got := NormalizePath(tc.in); got != tc.want { + t.Errorf("NormalizePath(%q) = %q; want %q", tc.in, got, tc.want) + } + } +} \ No newline at end of file From fd15f297d473b7084725b132d6f138845d8ad44e Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 13 Oct 2025 14:52:34 -0700 Subject: [PATCH 16/69] Default useTsgo settings change to user preferences (#1879) --- _extension/src/commands.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_extension/src/commands.ts b/_extension/src/commands.ts index d60192ff8e..18da6a3ca1 100644 --- a/_extension/src/commands.ts +++ b/_extension/src/commands.ts @@ -50,7 +50,7 @@ async function updateUseTsgoSetting(enable: boolean): Promise { useTsgo.globalValue !== undefined ? vscode.ConfigurationTarget.Global : undefined; } // Update the setting and restart the extension host (needed to change the state of the built-in TS extension) - await tsConfig.update("experimental.useTsgo", enable, target); + await tsConfig.update("experimental.useTsgo", enable, target ?? vscode.ConfigurationTarget.Global); await restartExtHostOnChangeIfNeeded(); } From b368c1cf04d53a536b575cdc56b81a8fed6cecf6 Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Tue, 14 Oct 2025 11:57:28 +0900 Subject: [PATCH 17/69] add License --- internal/module/pnp/lib.go | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/internal/module/pnp/lib.go b/internal/module/pnp/lib.go index 1763498be0..475f0d69da 100644 --- a/internal/module/pnp/lib.go +++ b/internal/module/pnp/lib.go @@ -1,3 +1,28 @@ +// BSD 2-Clause License +// +// Copyright (c) 2016-present, Yarn Contributors. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package pnp import ( @@ -191,8 +216,8 @@ func LoadPNPManifest(p string) (Manifest, error) { content, err := os.ReadFile(p) if err != nil { return Manifest{}, &FailedManifestHydrationError{ - Message: "We failed to read the content of the manifest.", - Err: err, + Message: "We failed to read the content of the manifest.", + Err: err, ManifestPath: p, } } From 6183abfe4fe92c94748aaf97fe09467b4ac1220f Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Wed, 15 Oct 2025 11:25:35 -0700 Subject: [PATCH 18/69] Port 'go to type definition' tests (#1883) --- .../fourslash/_scripts/convertFourslash.mts | 48 +++- internal/fourslash/_scripts/failingTests.txt | 1 + internal/fourslash/fourslash.go | 49 ++++ .../tests/gen/goToTypeDefinition2_test.go | 27 +++ .../tests/gen/goToTypeDefinition3_test.go | 18 ++ .../tests/gen/goToTypeDefinition4_test.go | 23 ++ .../tests/gen/goToTypeDefinition5_test.go | 20 ++ .../gen/goToTypeDefinitionAliases_test.go | 28 +++ .../gen/goToTypeDefinitionEnumMembers_test.go | 23 ++ .../gen/goToTypeDefinitionImportMeta_test.go | 24 ++ .../gen/goToTypeDefinitionModifiers_test.go | 33 +++ .../gen/goToTypeDefinitionModule_test.go | 24 ++ .../gen/goToTypeDefinitionPrimitives_test.go | 26 ++ .../gen/goToTypeDefinitionUnionType_test.go | 33 +++ .../tests/gen/goToTypeDefinition_Pick_test.go | 23 ++ .../gen/goToTypeDefinition_arrayType_test.go | 27 +++ .../goToTypeDefinition_promiseType_test.go | 22 ++ .../gen/goToTypeDefinition_returnType_test.go | 49 ++++ .../tests/gen/goToTypeDefinition_test.go | 23 ++ .../goToTypeDefinition_typeReference_test.go | 20 ++ .../gen/goToTypeDefinition_typedef_test.go | 25 ++ .../fourslash/tests/gen/jsDocServices_test.go | 30 +++ .../tests/gen/typedefinition01_test.go | 21 ++ .../goToTypeDefinition4.baseline.jsonc | 8 + .../goToTypeDefinition.baseline.jsonc | 9 + .../goToTypeDefinition2.baseline.jsonc | 11 + .../goToTypeDefinition3.baseline.jsonc | 4 + .../goToTypeDefinition4.baseline.jsonc | 4 + .../goToTypeDefinition5.baseline.jsonc | 5 + .../goToTypeDefinitionAliases.baseline.jsonc | 23 ++ ...ToTypeDefinitionEnumMembers.baseline.jsonc | 9 + ...oToTypeDefinitionImportMeta.baseline.jsonc | 9 + ...goToTypeDefinitionModifiers.baseline.jsonc | 227 ++++++++++++++++++ .../goToTypeDefinitionModule.baseline.jsonc | 23 ++ ...oToTypeDefinitionPrimitives.baseline.jsonc | 33 +++ ...goToTypeDefinitionUnionType.baseline.jsonc | 19 ++ .../goToTypeDefinition_Pick.baseline.jsonc | 19 ++ ...oToTypeDefinition_arrayType.baseline.jsonc | 37 +++ ...oTypeDefinition_promiseType.baseline.jsonc | 19 ++ ...ToTypeDefinition_returnType.baseline.jsonc | 179 ++++++++++++++ ...ypeDefinition_typeReference.baseline.jsonc | 6 + .../goToTypeDefinition_typedef.baseline.jsonc | 9 + .../goToType/typedefinition01.baseline.jsonc | 7 + 43 files changed, 1266 insertions(+), 11 deletions(-) create mode 100644 internal/fourslash/tests/gen/goToTypeDefinition2_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinition3_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinition4_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinition5_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinitionAliases_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinitionEnumMembers_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinitionImportMeta_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinitionModifiers_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinitionModule_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinitionPrimitives_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinitionUnionType_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinition_Pick_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinition_arrayType_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinition_promiseType_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinition_returnType_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinition_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinition_typeReference_test.go create mode 100644 internal/fourslash/tests/gen/goToTypeDefinition_typedef_test.go create mode 100644 internal/fourslash/tests/gen/jsDocServices_test.go create mode 100644 internal/fourslash/tests/gen/typedefinition01_test.go create mode 100644 testdata/baselines/reference/fourslash/goToDefinition/goToTypeDefinition4.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinition.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinition2.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinition3.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinition4.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinition5.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionAliases.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionEnumMembers.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionImportMeta.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionModifiers.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionModule.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionPrimitives.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionUnionType.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_Pick.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_arrayType.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_promiseType.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_returnType.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_typeReference.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_typedef.baseline.jsonc create mode 100644 testdata/baselines/reference/fourslash/goToType/typedefinition01.baseline.jsonc diff --git a/internal/fourslash/_scripts/convertFourslash.mts b/internal/fourslash/_scripts/convertFourslash.mts index 0b461efff6..534b7d69c7 100644 --- a/internal/fourslash/_scripts/convertFourslash.mts +++ b/internal/fourslash/_scripts/convertFourslash.mts @@ -186,11 +186,14 @@ function parseFourslashStatement(statement: ts.Statement): Cmd[] | undefined { return [parseBaselineSignatureHelp(callExpression.arguments)]; case "baselineGoToDefinition": case "baselineGetDefinitionAtPosition": - // Both of these take the same arguments, but differ in that... + case "baselineGoToType": + // Both `baselineGoToDefinition` and `baselineGetDefinitionAtPosition` take the same + // arguments, but differ in that... // - `verify.baselineGoToDefinition(...)` called getDefinitionAndBoundSpan // - `verify.baselineGetDefinitionAtPosition(...)` called getDefinitionAtPosition - // LSP doesn't have two separate commands though. It's unclear how we would model bound spans though. - return parseBaselineGoToDefinitionArgs(callExpression.arguments); + // LSP doesn't have two separate commands though. + // It's unclear how we would model bound spans though. + return parseBaselineGoToDefinitionArgs(func.text, callExpression.arguments); case "baselineRename": case "baselineRenameAtRangesWithText": // `verify.baselineRename...(...)` @@ -817,7 +820,20 @@ function parseBaselineDocumentHighlightsArgs(args: readonly ts.Expression[]): [V }]; } -function parseBaselineGoToDefinitionArgs(args: readonly ts.Expression[]): [VerifyBaselineGoToDefinitionCmd] | undefined { +function parseBaselineGoToDefinitionArgs( + funcName: "baselineGoToDefinition" | "baselineGoToType" | "baselineGetDefinitionAtPosition", + args: readonly ts.Expression[], +): [VerifyBaselineGoToDefinitionCmd] | undefined { + let kind: "verifyBaselineGoToDefinition" | "verifyBaselineGoToType"; + switch (funcName) { + case "baselineGoToDefinition": + case "baselineGetDefinitionAtPosition": + kind = "verifyBaselineGoToDefinition"; + break; + case "baselineGoToType": + kind = "verifyBaselineGoToType"; + break; + } const newArgs = []; for (const arg of args) { let strArg; @@ -829,19 +845,19 @@ function parseBaselineGoToDefinitionArgs(args: readonly ts.Expression[]): [Verif } else if (arg.getText() === "...test.ranges()") { return [{ - kind: "verifyBaselineGoToDefinition", + kind, markers: [], ranges: true, }]; } else { - console.error(`Unrecognized argument in verify.baselineGoToDefinition: ${arg.getText()}`); + console.error(`Unrecognized argument in verify.${funcName}: ${arg.getText()}`); return undefined; } } return [{ - kind: "verifyBaselineGoToDefinition", + kind, markers: newArgs, }]; } @@ -1293,7 +1309,7 @@ interface VerifyBaselineFindAllReferencesCmd { } interface VerifyBaselineGoToDefinitionCmd { - kind: "verifyBaselineGoToDefinition"; + kind: "verifyBaselineGoToDefinition" | "verifyBaselineGoToType"; markers: string[]; ranges?: boolean; } @@ -1393,11 +1409,20 @@ function generateBaselineDocumentHighlights({ args, preferences }: VerifyBaselin return `f.VerifyBaselineDocumentHighlights(t, ${preferences}, ${args.join(", ")})`; } -function generateBaselineGoToDefinition({ markers, ranges }: VerifyBaselineGoToDefinitionCmd): string { +function generateBaselineGoToDefinition({ markers, ranges, kind }: VerifyBaselineGoToDefinitionCmd): string { + let goFunc; + switch (kind) { + case "verifyBaselineGoToDefinition": + goFunc = "VerifyBaselineGoToDefinition"; + break; + case "verifyBaselineGoToType": + goFunc = "VerifyBaselineGoToTypeDefinition"; + break; + } if (ranges || markers.length === 0) { - return `f.VerifyBaselineGoToDefinition(t)`; + return `f.${goFunc}(t)`; } - return `f.VerifyBaselineGoToDefinition(t, ${markers.join(", ")})`; + return `f.${goFunc}(t, ${markers.join(", ")})`; } function generateGoToCommand({ funcName, args }: GoToCmd): string { @@ -1436,6 +1461,7 @@ function generateCmd(cmd: Cmd): string { case "verifyBaselineDocumentHighlights": return generateBaselineDocumentHighlights(cmd); case "verifyBaselineGoToDefinition": + case "verifyBaselineGoToType": return generateBaselineGoToDefinition(cmd); case "verifyBaselineQuickInfo": // Quick Info -> Hover diff --git a/internal/fourslash/_scripts/failingTests.txt b/internal/fourslash/_scripts/failingTests.txt index a3851e759e..3aef9a7a9f 100644 --- a/internal/fourslash/_scripts/failingTests.txt +++ b/internal/fourslash/_scripts/failingTests.txt @@ -245,6 +245,7 @@ TestJsDocPropertyDescription6 TestJsDocPropertyDescription7 TestJsDocPropertyDescription8 TestJsDocPropertyDescription9 +TestJsDocServices TestJsDocTagsWithHyphen TestJsQuickInfoGenerallyAcceptableSize TestJsRequireQuickInfo diff --git a/internal/fourslash/fourslash.go b/internal/fourslash/fourslash.go index a488f7d2c5..8c64ea2f90 100644 --- a/internal/fourslash/fourslash.go +++ b/internal/fourslash/fourslash.go @@ -852,6 +852,55 @@ func (f *FourslashTest) VerifyBaselineGoToDefinition( } } +func (f *FourslashTest) VerifyBaselineGoToTypeDefinition( + t *testing.T, + markers ...string, +) { + referenceLocations := f.lookupMarkersOrGetRanges(t, markers) + + for _, markerOrRange := range referenceLocations { + // worker in `baselineEachMarkerOrRange` + f.GoToMarkerOrRange(t, markerOrRange) + + params := &lsproto.TypeDefinitionParams{ + TextDocument: lsproto.TextDocumentIdentifier{ + Uri: ls.FileNameToDocumentURI(f.activeFilename), + }, + Position: f.currentCaretPosition, + } + + resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentTypeDefinitionInfo, params) + if resMsg == nil { + if f.lastKnownMarkerName == nil { + t.Fatalf("Nil response received for type definition request at pos %v", f.currentCaretPosition) + } else { + t.Fatalf("Nil response received for type definition request at marker '%s'", *f.lastKnownMarkerName) + } + } + if !resultOk { + if f.lastKnownMarkerName == nil { + t.Fatalf("Unexpected type definition response type at pos %v: %T", f.currentCaretPosition, resMsg.AsResponse().Result) + } else { + t.Fatalf("Unexpected type definition response type at marker '%s': %T", *f.lastKnownMarkerName, resMsg.AsResponse().Result) + } + } + + var resultAsLocations []lsproto.Location + if result.Locations != nil { + resultAsLocations = *result.Locations + } else if result.Location != nil { + resultAsLocations = []lsproto.Location{*result.Location} + } else if result.DefinitionLinks != nil { + t.Fatalf("Unexpected type definition response type at marker '%s': %T", *f.lastKnownMarkerName, result.DefinitionLinks) + } + + f.addResultToBaseline(t, "goToType", f.getBaselineForLocationsWithFileContents(resultAsLocations, baselineFourslashLocationsOptions{ + marker: markerOrRange, + markerName: "/*GOTO TYPE*/", + })) + } +} + func (f *FourslashTest) VerifyBaselineHover(t *testing.T) { markersAndItems := core.MapFiltered(f.Markers(), func(marker *Marker) (markerAndItem[*lsproto.Hover], bool) { if marker.Name == nil { diff --git a/internal/fourslash/tests/gen/goToTypeDefinition2_test.go b/internal/fourslash/tests/gen/goToTypeDefinition2_test.go new file mode 100644 index 0000000000..ebcbd8ab16 --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinition2_test.go @@ -0,0 +1,27 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinition2(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: goToTypeDefinition2_Definition.ts +interface /*definition*/I1 { + p; +} +type propertyType = I1; +interface I2 { + property: propertyType; +} +// @Filename: goToTypeDefinition2_Consumption.ts +var i2: I2; +i2.prop/*reference*/erty;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "reference") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinition3_test.go b/internal/fourslash/tests/gen/goToTypeDefinition3_test.go new file mode 100644 index 0000000000..959731d36c --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinition3_test.go @@ -0,0 +1,18 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinition3(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `type /*definition*/T = string; +const x: /*reference*/T;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "reference") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinition4_test.go b/internal/fourslash/tests/gen/goToTypeDefinition4_test.go new file mode 100644 index 0000000000..b37d04f884 --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinition4_test.go @@ -0,0 +1,23 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinition4(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: foo.ts +export type /*def0*/T = string; +export const /*def1*/T = ""; +// @Filename: bar.ts +import { T } from "./foo"; +let x: [|/*reference*/T|];` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "reference") + f.VerifyBaselineGoToDefinition(t, "reference") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinition5_test.go b/internal/fourslash/tests/gen/goToTypeDefinition5_test.go new file mode 100644 index 0000000000..a6e495eddd --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinition5_test.go @@ -0,0 +1,20 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinition5(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: foo.ts +let Foo: /*definition*/unresolved; +type Foo = { x: string }; +/*reference*/Foo;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "reference") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinitionAliases_test.go b/internal/fourslash/tests/gen/goToTypeDefinitionAliases_test.go new file mode 100644 index 0000000000..cf70f8b7e6 --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinitionAliases_test.go @@ -0,0 +1,28 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinitionAliases(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: goToTypeDefinitioAliases_module1.ts +interface /*definition*/I { + p; +} +export {I as I2}; +// @Filename: goToTypeDefinitioAliases_module2.ts +import {I2 as I3} from "./goToTypeDefinitioAliases_module1"; +var v1: I3; +export {v1 as v2}; +// @Filename: goToTypeDefinitioAliases_module3.ts +import {/*reference1*/v2 as v3} from "./goToTypeDefinitioAliases_module2"; +/*reference2*/v3;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "reference1", "reference2") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinitionEnumMembers_test.go b/internal/fourslash/tests/gen/goToTypeDefinitionEnumMembers_test.go new file mode 100644 index 0000000000..6a248e3e46 --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinitionEnumMembers_test.go @@ -0,0 +1,23 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinitionEnumMembers(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `enum E { + value1, + /*definition*/value2 +} +var x = E.value2; + +/*reference*/x;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "reference") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinitionImportMeta_test.go b/internal/fourslash/tests/gen/goToTypeDefinitionImportMeta_test.go new file mode 100644 index 0000000000..9cda20577e --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinitionImportMeta_test.go @@ -0,0 +1,24 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinitionImportMeta(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: esnext +// @Filename: foo.ts +/// +/// +import.me/*reference*/ta; +//@Filename: bar.d.ts +interface /*definition*/ImportMeta { +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "reference") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinitionModifiers_test.go b/internal/fourslash/tests/gen/goToTypeDefinitionModifiers_test.go new file mode 100644 index 0000000000..957d3ff39e --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinitionModifiers_test.go @@ -0,0 +1,33 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinitionModifiers(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /a.ts +/*export*/export class A/*A*/ { + + /*private*/private z/*z*/: string; + + /*private2*/private y/*y*/: A; + + /*readonly*/readonly x/*x*/: string; + + /*async*/async a/*a*/() { } + + /*override*/override b/*b*/() {} + + /*public1*/public/*public2*/ as/*multipleModifiers*/ync c/*c*/() { } +} + +exp/*exportFunction*/ort function foo/*foo*/() { }` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "export", "A", "private", "z", "private2", "y", "readonly", "x", "async", "a", "override", "b", "public1", "public2", "multipleModifiers", "c", "exportFunction", "foo") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinitionModule_test.go b/internal/fourslash/tests/gen/goToTypeDefinitionModule_test.go new file mode 100644 index 0000000000..988f92ddd2 --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinitionModule_test.go @@ -0,0 +1,24 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinitionModule(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: module1.ts +module /*definition*/M { + export var p; +} +var m: typeof M; +// @Filename: module3.ts +/*reference1*/M; +/*reference2*/m;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "reference1", "reference2") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinitionPrimitives_test.go b/internal/fourslash/tests/gen/goToTypeDefinitionPrimitives_test.go new file mode 100644 index 0000000000..18e9fe06ef --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinitionPrimitives_test.go @@ -0,0 +1,26 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinitionPrimitives(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: module1.ts +var w: {a: number}; +var x = "string"; +var y: number | string; +var z; // any +// @Filename: module2.ts +w./*reference1*/a; +/*reference2*/x; +/*reference3*/y; +/*reference4*/y;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "reference1", "reference2", "reference3", "reference4") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinitionUnionType_test.go b/internal/fourslash/tests/gen/goToTypeDefinitionUnionType_test.go new file mode 100644 index 0000000000..76e52a123e --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinitionUnionType_test.go @@ -0,0 +1,33 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinitionUnionType(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `class /*definition0*/C { + p; +} + +interface /*definition1*/I { + x; +} + +module M { + export interface /*definition2*/I { + y; + } +} + +var x: C | I | M.I; + +/*reference*/x;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "reference") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinition_Pick_test.go b/internal/fourslash/tests/gen/goToTypeDefinition_Pick_test.go new file mode 100644 index 0000000000..ed7dae6496 --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinition_Pick_test.go @@ -0,0 +1,23 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinition_Pick(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `type User = { id: number; name: string; }; +declare const user: Pick +/*reference*/user + +type PickedUser = Pick +declare const user2: PickedUser +/*reference2*/user2` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "reference", "reference2") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinition_arrayType_test.go b/internal/fourslash/tests/gen/goToTypeDefinition_arrayType_test.go new file mode 100644 index 0000000000..8d3803c3bb --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinition_arrayType_test.go @@ -0,0 +1,27 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinition_arrayType(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `type User = { name: string }; +declare const users: User[] +/*reference*/users + +type UsersArr = Array +declare const users2: UsersArr +/*reference2*/users2 + +class CustomArray extends Array { immutableReverse() { return [...this].reverse() } } +declare const users3: CustomArray +/*reference3*/users3` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "reference", "reference2", "reference3") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinition_promiseType_test.go b/internal/fourslash/tests/gen/goToTypeDefinition_promiseType_test.go new file mode 100644 index 0000000000..c13cbf198d --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinition_promiseType_test.go @@ -0,0 +1,22 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinition_promiseType(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `type User = { name: string }; +async function /*reference*/getUser() { return { name: "Bob" } satisfies User as User } + +const /*reference2*/promisedBob = getUser() + +export {}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "reference", "reference2") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinition_returnType_test.go b/internal/fourslash/tests/gen/goToTypeDefinition_returnType_test.go new file mode 100644 index 0000000000..930b658c60 --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinition_returnType_test.go @@ -0,0 +1,49 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinition_returnType(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `interface /*I*/I { x: number; } +interface /*J*/J { y: number; } + +function f0(): I { return { x: 0 }; } + +type T = /*T*/(i: I) => I; +const f1: T = i => ({ x: i.x + 1 }); + +const f2 = (i: I): I => ({ x: i.x + 1 }); + +const f3 = (i: I) => (/*f3Def*/{ x: i.x + 1 }); + +const f4 = (i: I) => i; + +const f5 = /*f5Def*/(i: I): I | J => ({ x: i.x + 1 }); + +const f6 = (i: I, j: J, b: boolean) => b ? i : j; + +const /*f7Def*/f7 = (i: I) => {}; + +function f8(i: I): I; +function f8(j: J): J; +function /*f8Def*/f8(ij: any): any { return ij; } + +/*f0*/f0(); +/*f1*/f1(); +/*f2*/f2(); +/*f3*/f3(); +/*f4*/f4(); +/*f5*/f5(); +/*f6*/f6(); +/*f7*/f7(); +/*f8*/f8();` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinition_test.go b/internal/fourslash/tests/gen/goToTypeDefinition_test.go new file mode 100644 index 0000000000..2b9a7ca2a1 --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinition_test.go @@ -0,0 +1,23 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinition(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: goToTypeDefinition_Definition.ts +class /*definition*/C { + p; +} +var c: C; +// @Filename: goToTypeDefinition_Consumption.ts +/*reference*/c = undefined;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "reference") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinition_typeReference_test.go b/internal/fourslash/tests/gen/goToTypeDefinition_typeReference_test.go new file mode 100644 index 0000000000..e7e8ae6ee9 --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinition_typeReference_test.go @@ -0,0 +1,20 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinition_typeReference(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `type User = { name: string }; +type Box = { value: T }; +declare const boxedUser: Box +/*reference*/boxedUser` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "reference") +} diff --git a/internal/fourslash/tests/gen/goToTypeDefinition_typedef_test.go b/internal/fourslash/tests/gen/goToTypeDefinition_typedef_test.go new file mode 100644 index 0000000000..8f8c1868cb --- /dev/null +++ b/internal/fourslash/tests/gen/goToTypeDefinition_typedef_test.go @@ -0,0 +1,25 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestGoToTypeDefinition_typedef(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @Filename: /a.js +/** + * /*def*/@typedef {object} I + * @property {number} x + */ + +/** @type {I} */ +const /*ref*/i = { x: 0 };` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "ref") +} diff --git a/internal/fourslash/tests/gen/jsDocServices_test.go b/internal/fourslash/tests/gen/jsDocServices_test.go new file mode 100644 index 0000000000..e25cdc74ce --- /dev/null +++ b/internal/fourslash/tests/gen/jsDocServices_test.go @@ -0,0 +1,30 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsDocServices(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `interface /*I*/I {} + +/** + * @param /*use*/[|foo|] I pity the foo + */ +function f([|[|/*def*/{| "contextRangeIndex": 1 |}foo|]: I|]) { + return /*use2*/[|foo|]; +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "use") + f.VerifyQuickInfoIs(t, "(parameter) foo: I", "I pity the foo") + f.VerifyBaselineFindAllReferences(t, "use", "def", "use2") + f.VerifyBaselineRename(t, nil /*preferences*/, f.Ranges()[0], f.Ranges()[2], f.Ranges()[3]) + f.VerifyBaselineDocumentHighlights(t, nil /*preferences*/, f.Ranges()[0], f.Ranges()[2], f.Ranges()[3]) + f.VerifyBaselineGoToTypeDefinition(t, "use") + f.VerifyBaselineGoToDefinition(t, "use") +} diff --git a/internal/fourslash/tests/gen/typedefinition01_test.go b/internal/fourslash/tests/gen/typedefinition01_test.go new file mode 100644 index 0000000000..dc025b79ad --- /dev/null +++ b/internal/fourslash/tests/gen/typedefinition01_test.go @@ -0,0 +1,21 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestTypedefinition01(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: b.ts +import n = require('./a'); +var x/*1*/ = new n.Foo(); +// @Filename: a.ts +export class /*2*/Foo {}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineGoToTypeDefinition(t, "1") +} diff --git a/testdata/baselines/reference/fourslash/goToDefinition/goToTypeDefinition4.baseline.jsonc b/testdata/baselines/reference/fourslash/goToDefinition/goToTypeDefinition4.baseline.jsonc new file mode 100644 index 0000000000..a639362681 --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToDefinition/goToTypeDefinition4.baseline.jsonc @@ -0,0 +1,8 @@ +// === goToDefinition === +// === /foo.ts === +// export type [|T|] = string; +// export const [|T|] = ""; + +// === /bar.ts === +// import { T } from "./foo"; +// let x: /*GOTO DEF*/T; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition.baseline.jsonc new file mode 100644 index 0000000000..1ff73db085 --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition.baseline.jsonc @@ -0,0 +1,9 @@ +// === goToType === +// === /goToTypeDefinition_Definition.ts === +// class [|C|] { +// p; +// } +// var c: C; + +// === /goToTypeDefinition_Consumption.ts === +// /*GOTO TYPE*/c = undefined; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition2.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition2.baseline.jsonc new file mode 100644 index 0000000000..beaf380dc5 --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition2.baseline.jsonc @@ -0,0 +1,11 @@ +// === goToType === +// === /goToTypeDefinition2_Definition.ts === +// interface [|I1|] { +// p; +// } +// type propertyType = I1; +// // --- (line: 5) skipped --- + +// === /goToTypeDefinition2_Consumption.ts === +// var i2: I2; +// i2.prop/*GOTO TYPE*/erty; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition3.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition3.baseline.jsonc new file mode 100644 index 0000000000..6067823559 --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition3.baseline.jsonc @@ -0,0 +1,4 @@ +// === goToType === +// === /goToTypeDefinition3.ts === +// type [|T|] = string; +// const x: /*GOTO TYPE*/T; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition4.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition4.baseline.jsonc new file mode 100644 index 0000000000..61504f639c --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition4.baseline.jsonc @@ -0,0 +1,4 @@ +// === goToType === +// === /bar.ts === +// import { T } from "./foo"; +// let x: /*GOTO TYPE*/T; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition5.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition5.baseline.jsonc new file mode 100644 index 0000000000..4f3d334efb --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition5.baseline.jsonc @@ -0,0 +1,5 @@ +// === goToType === +// === /foo.ts === +// let Foo: unresolved; +// type Foo = { x: string }; +// /*GOTO TYPE*/Foo; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionAliases.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionAliases.baseline.jsonc new file mode 100644 index 0000000000..dd9f252f4b --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionAliases.baseline.jsonc @@ -0,0 +1,23 @@ +// === goToType === +// === /goToTypeDefinitioAliases_module1.ts === +// interface [|I|] { +// p; +// } +// export {I as I2}; + +// === /goToTypeDefinitioAliases_module3.ts === +// import {/*GOTO TYPE*/v2 as v3} from "./goToTypeDefinitioAliases_module2"; +// v3; + + + +// === goToType === +// === /goToTypeDefinitioAliases_module1.ts === +// interface [|I|] { +// p; +// } +// export {I as I2}; + +// === /goToTypeDefinitioAliases_module3.ts === +// import {v2 as v3} from "./goToTypeDefinitioAliases_module2"; +// /*GOTO TYPE*/v3; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionEnumMembers.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionEnumMembers.baseline.jsonc new file mode 100644 index 0000000000..7e09546c95 --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionEnumMembers.baseline.jsonc @@ -0,0 +1,9 @@ +// === goToType === +// === /goToTypeDefinitionEnumMembers.ts === +// enum E { +// value1, +// [|value2|] +// } +// var x = E.value2; +// +// /*GOTO TYPE*/x; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionImportMeta.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionImportMeta.baseline.jsonc new file mode 100644 index 0000000000..11fd9f4d3d --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionImportMeta.baseline.jsonc @@ -0,0 +1,9 @@ +// === goToType === +// === /bar.d.ts === +// interface [|ImportMeta|] { +// } + +// === /foo.ts === +// /// +// /// +// import.me/*GOTO TYPE*/ta; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionModifiers.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionModifiers.baseline.jsonc new file mode 100644 index 0000000000..c6416aa695 --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionModifiers.baseline.jsonc @@ -0,0 +1,227 @@ +// === goToType === +// === /a.ts === +// /*GOTO TYPE*/export class [|A|] { +// +// private z: string; +// +// // --- (line: 5) skipped --- + + + +// === goToType === +// === /a.ts === +// export class [|A|]/*GOTO TYPE*/ { +// +// private z: string; +// +// // --- (line: 5) skipped --- + + + +// === goToType === +// === /a.ts === +// export class A { +// +// /*GOTO TYPE*/private z: string; +// +// private y: A; +// +// // --- (line: 7) skipped --- + + + +// === goToType === +// === /a.ts === +// export class A { +// +// private z/*GOTO TYPE*/: string; +// +// private y: A; +// +// // --- (line: 7) skipped --- + + + +// === goToType === +// === /a.ts === +// export class [|A|] { +// +// private z: string; +// +// /*GOTO TYPE*/private y: A; +// +// readonly x: string; +// +// // --- (line: 9) skipped --- + + + +// === goToType === +// === /a.ts === +// export class [|A|] { +// +// private z: string; +// +// private y/*GOTO TYPE*/: A; +// +// readonly x: string; +// +// // --- (line: 9) skipped --- + + + +// === goToType === +// === /a.ts === +// --- (line: 3) skipped --- +// +// private y: A; +// +// /*GOTO TYPE*/readonly x: string; +// +// async a() { } +// +// // --- (line: 11) skipped --- + + + +// === goToType === +// === /a.ts === +// --- (line: 3) skipped --- +// +// private y: A; +// +// readonly x/*GOTO TYPE*/: string; +// +// async a() { } +// +// // --- (line: 11) skipped --- + + + +// === goToType === +// === /a.ts === +// --- (line: 5) skipped --- +// +// readonly x: string; +// +// /*GOTO TYPE*/async a() { } +// +// override b() {} +// +// // --- (line: 13) skipped --- + + + +// === goToType === +// === /a.ts === +// --- (line: 5) skipped --- +// +// readonly x: string; +// +// async a/*GOTO TYPE*/() { } +// +// override b() {} +// +// // --- (line: 13) skipped --- + + + +// === goToType === +// === /a.ts === +// --- (line: 7) skipped --- +// +// async a() { } +// +// /*GOTO TYPE*/override b() {} +// +// public async c() { } +// } +// +// export function foo() { } + + + +// === goToType === +// === /a.ts === +// --- (line: 7) skipped --- +// +// async a() { } +// +// override b/*GOTO TYPE*/() {} +// +// public async c() { } +// } +// +// export function foo() { } + + + +// === goToType === +// === /a.ts === +// --- (line: 9) skipped --- +// +// override b() {} +// +// /*GOTO TYPE*/public async c() { } +// } +// +// export function foo() { } + + + +// === goToType === +// === /a.ts === +// --- (line: 9) skipped --- +// +// override b() {} +// +// public/*GOTO TYPE*/ async c() { } +// } +// +// export function foo() { } + + + +// === goToType === +// === /a.ts === +// --- (line: 9) skipped --- +// +// override b() {} +// +// public as/*GOTO TYPE*/ync c() { } +// } +// +// export function foo() { } + + + +// === goToType === +// === /a.ts === +// --- (line: 9) skipped --- +// +// override b() {} +// +// public async c/*GOTO TYPE*/() { } +// } +// +// export function foo() { } + + + +// === goToType === +// === /a.ts === +// --- (line: 12) skipped --- +// public async c() { } +// } +// +// exp/*GOTO TYPE*/ort function foo() { } + + + +// === goToType === +// === /a.ts === +// --- (line: 12) skipped --- +// public async c() { } +// } +// +// export function foo/*GOTO TYPE*/() { } \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionModule.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionModule.baseline.jsonc new file mode 100644 index 0000000000..e4615be10b --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionModule.baseline.jsonc @@ -0,0 +1,23 @@ +// === goToType === +// === /module1.ts === +// module [|M|] { +// export var p; +// } +// var m: typeof M; + +// === /module3.ts === +// /*GOTO TYPE*/M; +// m; + + + +// === goToType === +// === /module1.ts === +// module [|M|] { +// export var p; +// } +// var m: typeof M; + +// === /module3.ts === +// M; +// /*GOTO TYPE*/m; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionPrimitives.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionPrimitives.baseline.jsonc new file mode 100644 index 0000000000..04785ee8ff --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionPrimitives.baseline.jsonc @@ -0,0 +1,33 @@ +// === goToType === +// === /module2.ts === +// w./*GOTO TYPE*/a; +// x; +// y; +// y; + + + +// === goToType === +// === /module2.ts === +// w.a; +// /*GOTO TYPE*/x; +// y; +// y; + + + +// === goToType === +// === /module2.ts === +// w.a; +// x; +// /*GOTO TYPE*/y; +// y; + + + +// === goToType === +// === /module2.ts === +// w.a; +// x; +// y; +// /*GOTO TYPE*/y; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionUnionType.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionUnionType.baseline.jsonc new file mode 100644 index 0000000000..b29b559356 --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinitionUnionType.baseline.jsonc @@ -0,0 +1,19 @@ +// === goToType === +// === /goToTypeDefinitionUnionType.ts === +// class [|C|] { +// p; +// } +// +// interface [|I|] { +// x; +// } +// +// module M { +// export interface [|I|] { +// y; +// } +// } +// +// var x: C | I | M.I; +// +// /*GOTO TYPE*/x; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_Pick.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_Pick.baseline.jsonc new file mode 100644 index 0000000000..e15dcddec0 --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_Pick.baseline.jsonc @@ -0,0 +1,19 @@ +// === goToType === +// === /goToTypeDefinition_Pick.ts === +// type User = [|{ id: number; name: string; }|]; +// declare const user: Pick +// /*GOTO TYPE*/user +// +// type PickedUser = Pick +// declare const user2: PickedUser +// user2 + + + +// === goToType === +// === /goToTypeDefinition_Pick.ts === +// --- (line: 3) skipped --- +// +// type PickedUser = Pick +// declare const user2: PickedUser +// /*GOTO TYPE*/user2 \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_arrayType.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_arrayType.baseline.jsonc new file mode 100644 index 0000000000..e984cc5804 --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_arrayType.baseline.jsonc @@ -0,0 +1,37 @@ +// === goToType === +// === /goToTypeDefinition_arrayType.ts === +// type User = [|{ name: string }|]; +// declare const users: User[] +// /*GOTO TYPE*/users +// +// type UsersArr = Array +// declare const users2: UsersArr +// // --- (line: 7) skipped --- + + + +// === goToType === +// === /goToTypeDefinition_arrayType.ts === +// type User = [|{ name: string }|]; +// declare const users: User[] +// users +// +// type UsersArr = Array +// declare const users2: UsersArr +// /*GOTO TYPE*/users2 +// +// class CustomArray extends Array { immutableReverse() { return [...this].reverse() } } +// declare const users3: CustomArray +// users3 + + + +// === goToType === +// === /goToTypeDefinition_arrayType.ts === +// --- (line: 5) skipped --- +// declare const users2: UsersArr +// users2 +// +// class [|CustomArray|] extends Array { immutableReverse() { return [...this].reverse() } } +// declare const users3: CustomArray +// /*GOTO TYPE*/users3 \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_promiseType.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_promiseType.baseline.jsonc new file mode 100644 index 0000000000..18eae436c2 --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_promiseType.baseline.jsonc @@ -0,0 +1,19 @@ +// === goToType === +// === /goToTypeDefinition_promiseType.ts === +// type User = [|{ name: string }|]; +// async function /*GOTO TYPE*/getUser() { return { name: "Bob" } satisfies User as User } +// +// const promisedBob = getUser() +// +// export {} + + + +// === goToType === +// === /goToTypeDefinition_promiseType.ts === +// type User = [|{ name: string }|]; +// async function getUser() { return { name: "Bob" } satisfies User as User } +// +// const /*GOTO TYPE*/promisedBob = getUser() +// +// export {} \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_returnType.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_returnType.baseline.jsonc new file mode 100644 index 0000000000..33d20e328a --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_returnType.baseline.jsonc @@ -0,0 +1,179 @@ +// === goToType === +// === /goToTypeDefinition_returnType.ts === +// interface [|I|] { x: number; } +// interface J { y: number; } +// +// function f0(): I { return { x: 0 }; } +// // --- (line: 5) skipped --- + +// --- (line: 21) skipped --- +// function f8(j: J): J; +// function f8(ij: any): any { return ij; } +// +// /*GOTO TYPE*/f0(); +// f1(); +// f2(); +// f3(); +// // --- (line: 29) skipped --- + + + +// === goToType === +// === /goToTypeDefinition_returnType.ts === +// interface I { x: number; } +// interface J { y: number; } +// +// function f0(): I { return { x: 0 }; } +// +// type T = [|(i: I) => I|]; +// const f1: T = i => ({ x: i.x + 1 }); +// +// const f2 = (i: I): I => ({ x: i.x + 1 }); +// // --- (line: 10) skipped --- + +// --- (line: 22) skipped --- +// function f8(ij: any): any { return ij; } +// +// f0(); +// /*GOTO TYPE*/f1(); +// f2(); +// f3(); +// f4(); +// // --- (line: 30) skipped --- + + + +// === goToType === +// === /goToTypeDefinition_returnType.ts === +// interface [|I|] { x: number; } +// interface J { y: number; } +// +// function f0(): I { return { x: 0 }; } +// // --- (line: 5) skipped --- + +// --- (line: 23) skipped --- +// +// f0(); +// f1(); +// /*GOTO TYPE*/f2(); +// f3(); +// f4(); +// f5(); +// // --- (line: 31) skipped --- + + + +// === goToType === +// === /goToTypeDefinition_returnType.ts === +// --- (line: 7) skipped --- +// +// const f2 = (i: I): I => ({ x: i.x + 1 }); +// +// const f3 = (i: I) => ([|{ x: i.x + 1 }|]); +// +// const f4 = (i: I) => i; +// +// // --- (line: 15) skipped --- + +// --- (line: 24) skipped --- +// f0(); +// f1(); +// f2(); +// /*GOTO TYPE*/f3(); +// f4(); +// f5(); +// f6(); +// f7(); +// f8(); + + + +// === goToType === +// === /goToTypeDefinition_returnType.ts === +// interface [|I|] { x: number; } +// interface J { y: number; } +// +// function f0(): I { return { x: 0 }; } +// // --- (line: 5) skipped --- + +// --- (line: 25) skipped --- +// f1(); +// f2(); +// f3(); +// /*GOTO TYPE*/f4(); +// f5(); +// f6(); +// f7(); +// f8(); + + + +// === goToType === +// === /goToTypeDefinition_returnType.ts === +// interface [|I|] { x: number; } +// interface [|J|] { y: number; } +// +// function f0(): I { return { x: 0 }; } +// +// // --- (line: 6) skipped --- + +// --- (line: 26) skipped --- +// f2(); +// f3(); +// f4(); +// /*GOTO TYPE*/f5(); +// f6(); +// f7(); +// f8(); + + + +// === goToType === +// === /goToTypeDefinition_returnType.ts === +// interface [|I|] { x: number; } +// interface [|J|] { y: number; } +// +// function f0(): I { return { x: 0 }; } +// +// // --- (line: 6) skipped --- + +// --- (line: 27) skipped --- +// f3(); +// f4(); +// f5(); +// /*GOTO TYPE*/f6(); +// f7(); +// f8(); + + + +// === goToType === +// === /goToTypeDefinition_returnType.ts === +// --- (line: 28) skipped --- +// f4(); +// f5(); +// f6(); +// /*GOTO TYPE*/f7(); +// f8(); + + + +// === goToType === +// === /goToTypeDefinition_returnType.ts === +// --- (line: 17) skipped --- +// +// const f7 = (i: I) => {}; +// +// function [|f8|](i: I): I; +// function [|f8|](j: J): J; +// function [|f8|](ij: any): any { return ij; } +// +// f0(); +// f1(); +// f2(); +// f3(); +// f4(); +// f5(); +// f6(); +// f7(); +// /*GOTO TYPE*/f8(); \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_typeReference.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_typeReference.baseline.jsonc new file mode 100644 index 0000000000..b5a668654f --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_typeReference.baseline.jsonc @@ -0,0 +1,6 @@ +// === goToType === +// === /goToTypeDefinition_typeReference.ts === +// type User = { name: string }; +// type Box = [|{ value: T }|]; +// declare const boxedUser: Box +// /*GOTO TYPE*/boxedUser \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_typedef.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_typedef.baseline.jsonc new file mode 100644 index 0000000000..beeae33cc7 --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/goToTypeDefinition_typedef.baseline.jsonc @@ -0,0 +1,9 @@ +// === goToType === +// === /a.js === +// /** +// * @typedef {object} I +// * [|@property {number} x +// |]*/ +// +// /** @type {I} */ +// const /*GOTO TYPE*/i = { x: 0 }; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/goToType/typedefinition01.baseline.jsonc b/testdata/baselines/reference/fourslash/goToType/typedefinition01.baseline.jsonc new file mode 100644 index 0000000000..5803b2d492 --- /dev/null +++ b/testdata/baselines/reference/fourslash/goToType/typedefinition01.baseline.jsonc @@ -0,0 +1,7 @@ +// === goToType === +// === /a.ts === +// export class [|Foo|] {} + +// === /b.ts === +// import n = require('./a'); +// var x/*GOTO TYPE*/ = new n.Foo(); \ No newline at end of file From 2ad9453a78179115066aa8301b7f82f1e9890b3c Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Oct 2025 17:22:41 -0700 Subject: [PATCH 19/69] Fix panic in `getTokenAtPosition` for JSDoc type assertions (#1846) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com> Co-authored-by: andrewbranch <3277153+andrewbranch@users.noreply.github.com> Co-authored-by: Andrew Branch --- internal/astnav/tokens.go | 45 ++++++++++++++++++++++++--------- internal/astnav/tokens_test.go | 46 ++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 12 deletions(-) diff --git a/internal/astnav/tokens.go b/internal/astnav/tokens.go index a7b4750034..27ad1ebdf6 100644 --- a/internal/astnav/tokens.go +++ b/internal/astnav/tokens.go @@ -65,6 +65,10 @@ func getTokenAtPosition( // `left` tracks the lower boundary of the node/token that could be returned, // and is eventually the scanner's start position, if the scanner is used. left := 0 + // `allowReparsed` is set when we're navigating inside an AsExpression or + // SatisfiesExpression, which allows visiting their reparsed children to reach + // the actual identifier from JSDoc type assertions. + allowReparsed := false testNode := func(node *ast.Node) int { if node.Kind != ast.KindEndOfFile && node.End() == position && includePrecedingTokenAtEndPosition != nil { @@ -74,7 +78,8 @@ func getTokenAtPosition( if node.End() < position || node.Kind != ast.KindEndOfFile && node.End() == position { return -1 } - if getPosition(node, sourceFile, allowPositionInLeadingTrivia) > position { + nodePos := getPosition(node, sourceFile, allowPositionInLeadingTrivia) + if nodePos > position { return 1 } return 0 @@ -86,18 +91,29 @@ func getTokenAtPosition( visitNode := func(node *ast.Node, _ *ast.NodeVisitor) *ast.Node { // We can't abort visiting children, so once a match is found, we set `next` // and do nothing on subsequent visits. - if node != nil && node.Flags&ast.NodeFlagsReparsed == 0 && next == nil { - switch testNode(node) { - case -1: - if !ast.IsJSDocKind(node.Kind) { - // We can't move the left boundary into or beyond JSDoc, - // because we may end up returning the token after this JSDoc, - // constructing it with the scanner, and we need to include - // all its leading trivia in its position. - left = node.End() + if node != nil && next == nil { + // Skip reparsed nodes unless: + // 1. The node itself is AsExpression or SatisfiesExpression, OR + // 2. We're already inside an AsExpression or SatisfiesExpression (allowReparsed=true) + // These are special cases where reparsed nodes from JSDoc type assertions + // should still be navigable to reach identifiers. + isSpecialReparsed := node.Flags&ast.NodeFlagsReparsed != 0 && + (node.Kind == ast.KindAsExpression || node.Kind == ast.KindSatisfiesExpression) + + if node.Flags&ast.NodeFlagsReparsed == 0 || isSpecialReparsed || allowReparsed { + result := testNode(node) + switch result { + case -1: + if !ast.IsJSDocKind(node.Kind) { + // We can't move the left boundary into or beyond JSDoc, + // because we may end up returning the token after this JSDoc, + // constructing it with the scanner, and we need to include + // all its leading trivia in its position. + left = node.End() + } + case 0: + next = node } - case 0: - next = node } } return node @@ -194,6 +210,11 @@ func getTokenAtPosition( current = next left = current.Pos() next = nil + // When navigating into AsExpression or SatisfiesExpression, allow visiting + // their reparsed children to reach identifiers from JSDoc type assertions. + if current.Kind == ast.KindAsExpression || current.Kind == ast.KindSatisfiesExpression { + allowReparsed = true + } } } diff --git a/internal/astnav/tokens_test.go b/internal/astnav/tokens_test.go index b5eb7ba39f..0a0d180646 100644 --- a/internal/astnav/tokens_test.go +++ b/internal/astnav/tokens_test.go @@ -43,6 +43,52 @@ func TestGetTokenAtPosition(t *testing.T) { ) }) + t.Run("JSDoc type assertion", func(t *testing.T) { + t.Parallel() + fileText := `function foo(x) { + const s = /**@type {string}*/(x) +}` + file := parser.ParseSourceFile(ast.SourceFileParseOptions{ + FileName: "/test.js", + Path: "/test.js", + }, fileText, core.ScriptKindJS) + + // Position of 'x' inside the parenthesized expression (position 52) + position := 52 + + // This should not panic - it previously panicked with: + // "did not expect KindParenthesizedExpression to have KindIdentifier in its trivia" + token := astnav.GetTouchingPropertyName(file, position) + if token == nil { + t.Fatal("Expected to get a token, got nil") + } + + // The function may return either the identifier itself or the containing + // parenthesized expression, depending on how the AST is structured + if token.Kind != ast.KindIdentifier && token.Kind != ast.KindParenthesizedExpression { + t.Errorf("Expected identifier or parenthesized expression, got %s", token.Kind) + } + }) + + t.Run("JSDoc type assertion with comment", func(t *testing.T) { + t.Parallel() + // Exact code from the issue report + fileText := `function foo(x) { + const s = /**@type {string}*/(x) // Go-to-definition on x causes panic +}` + file := parser.ParseSourceFile(ast.SourceFileParseOptions{ + FileName: "/test.js", + Path: "/test.js", + }, fileText, core.ScriptKindJS) + + // Find position of 'x' in the type assertion + xPos := 52 // Position of 'x' in (x) + + // This should not panic + token := astnav.GetTouchingPropertyName(file, xPos) + assert.Assert(t, token != nil, "Expected to get a token") + }) + t.Run("pointer equality", func(t *testing.T) { t.Parallel() fileText := ` From 305fd49550f74402b0dd28cffa7adfb4d090ead6 Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Thu, 16 Oct 2025 10:55:58 +0900 Subject: [PATCH 20/69] remove filepath and utils --- internal/module/pnp/builtins.go | 62 ------------------ internal/module/pnp/lib.go | 37 +++++------ internal/module/pnp/lib_test.go | 7 +- internal/module/pnp/manifest.go | 36 +++++++++-- .../pnp/{utils/trie_internal.go => trie.go} | 14 ++-- .../trie_internal_test.go => trie_test.go} | 2 +- internal/module/pnp/utils/normalize_path.go | 64 ------------------- .../module/pnp/utils/normalize_path_test.go | 60 ----------------- internal/module/pnp/utils/portable_path.go | 47 -------------- internal/module/pnp/utils/trie.go | 32 ---------- 10 files changed, 59 insertions(+), 302 deletions(-) delete mode 100644 internal/module/pnp/builtins.go rename internal/module/pnp/{utils/trie_internal.go => trie.go} (74%) rename internal/module/pnp/{utils/trie_internal_test.go => trie_test.go} (99%) delete mode 100644 internal/module/pnp/utils/normalize_path.go delete mode 100644 internal/module/pnp/utils/normalize_path_test.go delete mode 100644 internal/module/pnp/utils/portable_path.go delete mode 100644 internal/module/pnp/utils/trie.go diff --git a/internal/module/pnp/builtins.go b/internal/module/pnp/builtins.go deleted file mode 100644 index b195d2275a..0000000000 --- a/internal/module/pnp/builtins.go +++ /dev/null @@ -1,62 +0,0 @@ -package pnp - -import "slices" - -var NodeJSBuiltins = []string{ - "assert", - "assert/strict", - "async_hooks", - "buffer", - "child_process", - "cluster", - "console", - "constants", - "crypto", - "dgram", - "diagnostics_channel", - "dns", - "dns/promises", - "domain", - "events", - "fs", - "fs/promises", - "http", - "http2", - "https", - "inspector", - "module", - "net", - "os", - "path", - "path/posix", - "path/win32", - "perf_hooks", - "process", - "punycode", - "querystring", - "readline", - "readline/promises", - "repl", - "stream", - "stream/consumers", - "stream/promises", - "stream/web", - "string_decoder", - "sys", - "timers", - "timers/promises", - "tls", - "trace_events", - "tty", - "url", - "util", - "util/types", - "v8", - "vm", - "worker_threads", - "zlib", -} - -func IsNodeJSBuiltin(s string) bool { - return slices.Contains(NodeJSBuiltins, s) -} diff --git a/internal/module/pnp/lib.go b/internal/module/pnp/lib.go index 475f0d69da..a66afecfcc 100644 --- a/internal/module/pnp/lib.go +++ b/internal/module/pnp/lib.go @@ -29,13 +29,13 @@ import ( "errors" "fmt" "os" - "path/filepath" "regexp" "slices" "strings" "github.com/go-json-experiment/json" - "github.com/microsoft/typescript-go/internal/module/pnp/utils" + "github.com/microsoft/typescript-go/internal/core" + "github.com/microsoft/typescript-go/internal/tspath" ) type ResolutionKind int @@ -94,6 +94,10 @@ func (e *FailedManifestHydrationError) Error() string { } func (e *FailedManifestHydrationError) Unwrap() error { return e.Err } +func isNodeJSBuiltin(name string) bool { + return core.NodeCoreModules()[name] +} + func parseScopedPackageName(spec string) (pkg string, sub *string, ok bool) { parts := strings.SplitN(spec, "/", 3) if len(parts) < 2 { @@ -145,14 +149,14 @@ func ParseBareIdentifier(spec string) (string, *string, error) { } func FindClosestPNPManifestPath(start string) (string, bool) { - dir := filepath.Clean(start) + dir := tspath.NormalizePath(start) for { - candidate := filepath.Join(dir, ".pnp.cjs") + candidate := tspath.CombinePaths(dir, ".pnp.cjs") if st, err := os.Stat(candidate); err == nil && !st.IsDir() { return candidate, true } - parent := filepath.Dir(dir) + parent := tspath.GetDirectoryPath(dir) if parent == dir { break } @@ -165,19 +169,15 @@ var rePNP = regexp.MustCompile(`(?s)(const[\ \r\n]+RAW_RUNTIME_STATE[\ \r\n]*=[\ func InitPNPManifest(m *Manifest, manifestPath string) error { m.ManifestPath = manifestPath - m.ManifestDir = filepath.Dir(manifestPath) + m.ManifestDir = tspath.GetDirectoryPath(manifestPath) - m.LocationTrie = *utils.NewTrie[PackageLocator]() + m.LocationTrie = *NewLocationTrie[PackageLocator]() for name, ranges := range m.PackageRegistryData { for reference, info := range ranges { - joined := filepath.Join(m.ManifestDir, info.PackageLocation) - - if strings.HasSuffix(info.PackageLocation, "/") { - joined = joined + "/" - } + joined := tspath.CombinePaths(m.ManifestDir, info.PackageLocation) - norm := utils.NormalizePath(joined) + norm := tspath.NormalizePath(joined) info.PackageLocation = norm ranges[reference] = info @@ -287,21 +287,18 @@ func IsDependencyTreeRoot(m *Manifest, loc *PackageLocator) bool { } func FindLocator(manifest *Manifest, path string) *PackageLocator { - rel, err := filepath.Rel(manifest.ManifestDir, path) - if err != nil { - panic("Assertion failed: Provided path should be absolute but received" + path) - } + rel := tspath.GetRelativePathFromDirectory(manifest.ManifestDir, path, tspath.ComparePathsOptions{UseCaseSensitiveFileNames: true}) if manifest.IgnorePatternData != nil { re, err := manifest.IgnorePatternData.compile() if err == nil { - if re.MatchString(utils.NormalizePath(rel)) { + if re.MatchString(tspath.NormalizePath(rel)) { return nil } } } - normFull := utils.NormalizePath(path) + normFull := tspath.NormalizePath(path) if v, ok := manifest.LocationTrie.GetAncestorValue(normFull); ok && v != nil { return v } @@ -375,7 +372,7 @@ func ResolveToUnqualifiedViaManifest( } if refOrAlias == nil { - if IsNodeJSBuiltin(specifier) { + if isNodeJSBuiltin(specifier) { if IsDependencyTreeRoot(manifest, parentLocator) { msg := fmt.Sprintf( "Your application tried to access %s. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since %s isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: %s%s\nRequired by: %s", diff --git a/internal/module/pnp/lib_test.go b/internal/module/pnp/lib_test.go index 9755e0ec06..e1508ceda0 100644 --- a/internal/module/pnp/lib_test.go +++ b/internal/module/pnp/lib_test.go @@ -10,9 +10,8 @@ import ( "testing" "github.com/go-json-experiment/json" - - "github.com/microsoft/typescript-go/internal/module/pnp/utils" "github.com/microsoft/typescript-go/internal/repo" + "github.com/microsoft/typescript-go/internal/tspath" ) type TestSuite struct { @@ -301,8 +300,8 @@ func TestGlobalCache(t *testing.T) { t.Fatalf("unexpected resolution kind: %v", res.Kind) } - got := utils.NormalizePath(res.Path) - expected := utils.NormalizePath(filepath.Join( + got := tspath.NormalizePath(res.Path) + expected := tspath.NormalizePath(filepath.Join( globalCache, "source-map-npm-0.6.1-1a3621db16-10c0.zip", "node_modules", diff --git a/internal/module/pnp/manifest.go b/internal/module/pnp/manifest.go index e76cba5d35..694bb1b4d0 100644 --- a/internal/module/pnp/manifest.go +++ b/internal/module/pnp/manifest.go @@ -4,14 +4,17 @@ import ( "bytes" "errors" "regexp" + "strings" "github.com/go-json-experiment/json" "github.com/go-json-experiment/json/jsontext" - "github.com/microsoft/typescript-go/internal/module/pnp/utils" + "github.com/microsoft/typescript-go/internal/tspath" ) -type Trie[T any] = utils.Trie[T] +type LocationTrie[T any] struct { + inner *Trie[T] +} type RegexDef struct { Source string `json:"source"` @@ -19,9 +22,9 @@ type RegexDef struct { } type Manifest struct { - ManifestDir string `json:"-"` - ManifestPath string `json:"-"` - LocationTrie Trie[PackageLocator] `json:"-"` + ManifestDir string `json:"-"` + ManifestPath string `json:"-"` + LocationTrie LocationTrie[PackageLocator] `json:"-"` EnableTopLevelFallback bool `json:"enableTopLevelFallback"` IgnorePatternData *RegexDef `json:"ignorePatternData,omitempty"` @@ -229,3 +232,26 @@ func (m *PackageRegistryData) UnmarshalJSON(data []byte) error { func (r *RegexDef) compile() (*regexp.Regexp, error) { return regexp.Compile(r.Source) } + +func NewLocationTrie[T any]() *LocationTrie[T] { + return &LocationTrie[T]{inner: New[T]()} +} + +func (t *LocationTrie[T]) key(key string) string { + p := tspath.NormalizePath(key) + + if !strings.HasSuffix(p, "/") { + return p + "/" + } + + return p +} + +func (t *LocationTrie[T]) GetAncestorValue(p string) (*T, bool) { + v, ok := t.inner.GetAncestorValue(t.key(p)) + return &v, ok +} + +func (t *LocationTrie[T]) Insert(p string, v T) { + t.inner.Set(t.key(p), v) +} diff --git a/internal/module/pnp/utils/trie_internal.go b/internal/module/pnp/trie.go similarity index 74% rename from internal/module/pnp/utils/trie_internal.go rename to internal/module/pnp/trie.go index 803dd3f447..c3dddab14a 100644 --- a/internal/module/pnp/utils/trie_internal.go +++ b/internal/module/pnp/trie.go @@ -1,6 +1,6 @@ -package utils +package pnp -type TrieInternal[T any] struct { +type Trie[T any] struct { root *node[T] } @@ -10,11 +10,11 @@ type node[T any] struct { hasValue bool } -func New[T any]() *TrieInternal[T] { - return &TrieInternal[T]{root: &node[T]{children: make(map[rune]*node[T])}} +func New[T any]() *Trie[T] { + return &Trie[T]{root: &node[T]{children: make(map[rune]*node[T])}} } -func (t *TrieInternal[T]) Set(key string, v T) { +func (t *Trie[T]) Set(key string, v T) { n := t.root for _, r := range key { child, ok := n.children[r] @@ -28,7 +28,7 @@ func (t *TrieInternal[T]) Set(key string, v T) { n.hasValue = true } -func (t *TrieInternal[T]) Get(key string) (T, bool) { +func (t *Trie[T]) Get(key string) (T, bool) { n := t.root for _, r := range key { child, ok := n.children[r] @@ -45,7 +45,7 @@ func (t *TrieInternal[T]) Get(key string) (T, bool) { return zero, false } -func (t *TrieInternal[T]) GetAncestorValue(key string) (T, bool) { +func (t *Trie[T]) GetAncestorValue(key string) (T, bool) { n := t.root var best T diff --git a/internal/module/pnp/utils/trie_internal_test.go b/internal/module/pnp/trie_test.go similarity index 99% rename from internal/module/pnp/utils/trie_internal_test.go rename to internal/module/pnp/trie_test.go index 1587e94c36..93ec08ea08 100644 --- a/internal/module/pnp/utils/trie_internal_test.go +++ b/internal/module/pnp/trie_test.go @@ -1,4 +1,4 @@ -package utils +package pnp import ( "strconv" diff --git a/internal/module/pnp/utils/normalize_path.go b/internal/module/pnp/utils/normalize_path.go deleted file mode 100644 index 8e3ec3262d..0000000000 --- a/internal/module/pnp/utils/normalize_path.go +++ /dev/null @@ -1,64 +0,0 @@ -package utils - -import ( - "os" - "strings" -) - -func NormalizePath(original string) string { - origPortable := toPortablePath(original) - - rooted := strings.HasPrefix(origPortable, "/") || strings.HasPrefix(origPortable, "\\") - - body := origPortable - if rooted { - body = strings.TrimPrefix(body, "/") - body = strings.TrimPrefix(body, "\\") - } - - var parts []string - if body != "" { - parts = strings.FieldsFunc(body, func(r rune) bool { return r == '/' || r == '\\' }) - } - - out := make([]string, 0, len(parts)) - - for _, comp := range parts { - switch comp { - case "", ".": - // Those components don't progress the path - case "..": - switch { - case rooted && len(out) == 0: - // No need to add a ".." since we're already at the root - case len(out) == 0 || out[len(out)-1] == "..": - out = append(out, "..") - default: - out = out[:len(out)-1] - } - default: - out = append(out, comp) - } - } - - if rooted { - if len(out) == 0 { - return fromPortablePath("/") - } - out = append([]string{""}, out...) - } - - if len(out) == 0 { - return fromPortablePath(".") - } - - str := strings.Join(out, "/") - - hasTrailing := strings.HasSuffix(origPortable, "/") || - strings.HasSuffix(original, string(os.PathSeparator)) - if hasTrailing && !strings.HasSuffix(str, "/") { - str += "/" - } - - return fromPortablePath(str) -} diff --git a/internal/module/pnp/utils/normalize_path_test.go b/internal/module/pnp/utils/normalize_path_test.go deleted file mode 100644 index 5f32048984..0000000000 --- a/internal/module/pnp/utils/normalize_path_test.go +++ /dev/null @@ -1,60 +0,0 @@ -package utils - -import ( - "runtime" - "testing" -) - -func TestNormalizePath(t *testing.T) { - t.Parallel() - tests := []struct { - in, want string - }{ - {"", "."}, - {"/", "/"}, - {"foo", "foo"}, - {"foo/bar", "foo/bar"}, - {"foo//bar", "foo/bar"}, - {"foo/./bar", "foo/bar"}, - {"foo/../bar", "bar"}, - {"foo/..//bar", "bar"}, - {"foo/bar/..", "foo"}, - {"foo/../../bar", "../bar"}, - {"../foo/../../bar", "../../bar"}, - {"./foo", "foo"}, - {"../foo", "../foo"}, - {"../D:/foo", "../D:/foo"}, - {"/foo/bar", "/foo/bar"}, - {"/foo/../../bar/baz", "/bar/baz"}, - {"/../foo/bar", "/foo/bar"}, - {"/../foo/bar//", "/foo/bar/"}, - {"/foo/bar/", "/foo/bar/"}, - } - - for _, tc := range tests { - if got := NormalizePath(tc.in); got != tc.want { - t.Errorf("NormalizePath(%q) = %q; want %q", tc.in, got, tc.want) - } - } -} - -func TestNormalizePathWindow(t *testing.T) { - if runtime.GOOS != "windows" { - t.Skip("Windows-only test") - } - t.Parallel() - tests := []struct { - in, want string - }{ - {`D:\foo\..\bar`, "D:/bar"}, - {`D:\foo\..\..\C:\bar\test`, "C:/bar/test"}, - {`\\server-name\foo\..\bar`, `\\server-name/bar`}, - {`\\server-name\foo\..\..\..\C:\bar\test`, "C:/bar/test"}, - } - - for _, tc := range tests { - if got := NormalizePath(tc.in); got != tc.want { - t.Errorf("NormalizePath(%q) = %q; want %q", tc.in, got, tc.want) - } - } -} \ No newline at end of file diff --git a/internal/module/pnp/utils/portable_path.go b/internal/module/pnp/utils/portable_path.go deleted file mode 100644 index 741ce8d78a..0000000000 --- a/internal/module/pnp/utils/portable_path.go +++ /dev/null @@ -1,47 +0,0 @@ -package utils - -import ( - "regexp" - "runtime" -) - -var ( - reWindowsPath = regexp.MustCompile(`^([a-zA-Z]:.*)$`) - reUNCWindowsPath = regexp.MustCompile(`^[\/\\][\/\\](\.[\/\\])?(.*)$`) - rePortablePath = regexp.MustCompile(`^\/([a-zA-Z]:.*)$`) - reUNCPortablePath = regexp.MustCompile(`^\/unc\/(\.dot\/)?(.*)$`) -) - -func toPortablePath(s string) string { - if runtime.GOOS != "windows" { - return s - } - if m := reWindowsPath.FindStringSubmatch(s); m != nil { - return "/" + m[1] - } - if m := reUNCWindowsPath.FindStringSubmatch(s); m != nil { - if m[1] != "" { - return "/unc/.dot/" + m[2] - } - return "/unc/" + m[2] - } - return s -} - -func fromPortablePath(s string) string { - if runtime.GOOS != "windows" { - return s - } - // "/C:..." → "C:..." - if m := rePortablePath.FindStringSubmatch(s); m != nil { - return m[1] - } - // "/unc/(.dot/)?rest" - if m := reUNCPortablePath.FindStringSubmatch(s); m != nil { - if m[1] != "" { - return `\\.\` + m[2] - } - return `\\` + m[2] - } - return s -} diff --git a/internal/module/pnp/utils/trie.go b/internal/module/pnp/utils/trie.go deleted file mode 100644 index 688c544768..0000000000 --- a/internal/module/pnp/utils/trie.go +++ /dev/null @@ -1,32 +0,0 @@ -package utils - -import ( - "strings" -) - -type Trie[T any] struct { - inner *TrieInternal[T] -} - -func NewTrie[T any]() *Trie[T] { - return &Trie[T]{inner: New[T]()} -} - -func (t *Trie[T]) key(key string) string { - p := NormalizePath(key) - - if !strings.HasSuffix(p, "/") { - return p + "/" - } - - return p -} - -func (t *Trie[T]) GetAncestorValue(p string) (*T, bool) { - v, ok := t.inner.GetAncestorValue(t.key(p)) - return &v, ok -} - -func (t *Trie[T]) Insert(p string, v T) { - t.inner.Set(t.key(p), v) -} From f0ee55baae946a3fcbace07443488162481dedca Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Thu, 16 Oct 2025 11:59:44 +0900 Subject: [PATCH 21/69] make regex more efficient --- internal/module/pnp/lib.go | 8 +++----- internal/module/pnp/manifest.go | 22 +++++++++++++--------- internal/vfs/pnpvfs/pnpvfs.go | 2 -- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/internal/module/pnp/lib.go b/internal/module/pnp/lib.go index a66afecfcc..98981d591f 100644 --- a/internal/module/pnp/lib.go +++ b/internal/module/pnp/lib.go @@ -290,11 +290,9 @@ func FindLocator(manifest *Manifest, path string) *PackageLocator { rel := tspath.GetRelativePathFromDirectory(manifest.ManifestDir, path, tspath.ComparePathsOptions{UseCaseSensitiveFileNames: true}) if manifest.IgnorePatternData != nil { - re, err := manifest.IgnorePatternData.compile() - if err == nil { - if re.MatchString(tspath.NormalizePath(rel)) { - return nil - } + _, err := manifest.IgnorePatternData.reg.MatchString(tspath.NormalizePath(rel)) + if err != nil { + return nil } } diff --git a/internal/module/pnp/manifest.go b/internal/module/pnp/manifest.go index 694bb1b4d0..057f3f94d7 100644 --- a/internal/module/pnp/manifest.go +++ b/internal/module/pnp/manifest.go @@ -3,9 +3,9 @@ package pnp import ( "bytes" "errors" - "regexp" "strings" + "github.com/dlclark/regexp2" "github.com/go-json-experiment/json" "github.com/go-json-experiment/json/jsontext" @@ -18,7 +18,7 @@ type LocationTrie[T any] struct { type RegexDef struct { Source string `json:"source"` - Flags string `json:"flags,omitempty"` + reg *regexp2.Regexp } type Manifest struct { @@ -93,15 +93,23 @@ func (r *RegexDef) UnmarshalJSON(b []byte) error { return err } r.Source = s - r.Flags = "" + reg, err := regexp2.Compile(s, regexp2.ECMAScript) + if err != nil { + return err + } + r.reg = reg return nil } - type alias RegexDef - var a alias + var a RegexDef if err := json.Unmarshal(b, &a); err != nil { return err } *r = RegexDef(a) + reg, err := regexp2.Compile(a.Source, regexp2.ECMAScript) + if err != nil { + return err + } + r.reg = reg return nil } @@ -229,10 +237,6 @@ func (m *PackageRegistryData) UnmarshalJSON(data []byte) error { return nil } -func (r *RegexDef) compile() (*regexp.Regexp, error) { - return regexp.Compile(r.Source) -} - func NewLocationTrie[T any]() *LocationTrie[T] { return &LocationTrie[T]{inner: New[T]()} } diff --git a/internal/vfs/pnpvfs/pnpvfs.go b/internal/vfs/pnpvfs/pnpvfs.go index 49bbd65099..9fb45c1fac 100644 --- a/internal/vfs/pnpvfs/pnpvfs.go +++ b/internal/vfs/pnpvfs/pnpvfs.go @@ -63,8 +63,6 @@ func (fs *PNPFS) checkForZip(path string, kind EntryKind) (*zipFile, string) { var zipPath string var pathTail string - // Do a quick check for a ".zip" in the path at all - path = strings.ReplaceAll(path, "\\", "/") if i := strings.Index(path, ".zip/"); i != -1 { zipPath = path[:i+len(".zip")] pathTail = path[i+len(".zip/"):] From ef6d713fd5c8ec5d736fac2b9ae76d1858afd9c2 Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Thu, 16 Oct 2025 12:24:33 +0900 Subject: [PATCH 22/69] fix lint --- internal/module/pnp/manifest.go | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/internal/module/pnp/manifest.go b/internal/module/pnp/manifest.go index 057f3f94d7..b37320fba9 100644 --- a/internal/module/pnp/manifest.go +++ b/internal/module/pnp/manifest.go @@ -87,25 +87,12 @@ func (r *RegexDef) UnmarshalJSON(b []byte) error { *r = RegexDef{} return nil } - if len(b) > 0 && b[0] == '"' { - var s string - if err := json.Unmarshal(b, &s); err != nil { - return err - } - r.Source = s - reg, err := regexp2.Compile(s, regexp2.ECMAScript) - if err != nil { - return err - } - r.reg = reg - return nil - } - var a RegexDef - if err := json.Unmarshal(b, &a); err != nil { + var s string + if err := json.Unmarshal(b, &s); err != nil { return err } - *r = RegexDef(a) - reg, err := regexp2.Compile(a.Source, regexp2.ECMAScript) + r.Source = s + reg, err := regexp2.Compile(s, regexp2.ECMAScript) if err != nil { return err } From 0f6b0a779b8dc059a8ae7bc2168b3e40234105e0 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Thu, 16 Oct 2025 11:05:49 -0700 Subject: [PATCH 23/69] =?UTF-8?q?Don=E2=80=99t=20look=20in=20JSExportAssig?= =?UTF-8?q?nment=20and=20CommonJSExport=20for=20nodes=20(#1886)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/ast/utilities.go | 2 +- .../tests/cases/compiler/nestedJSDocImportType.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 testdata/tests/cases/compiler/nestedJSDocImportType.ts diff --git a/internal/ast/utilities.go b/internal/ast/utilities.go index 1793bc63ef..f491127d22 100644 --- a/internal/ast/utilities.go +++ b/internal/ast/utilities.go @@ -2641,7 +2641,7 @@ func GetNodeAtPosition(file *SourceFile, position int, includeJSDoc bool) *Node } if child == nil { current.ForEachChild(func(node *Node) bool { - if nodeContainsPosition(node, position) { + if nodeContainsPosition(node, position) && node.Kind != KindJSExportAssignment && node.Kind != KindCommonJSExport { child = node return true } diff --git a/testdata/tests/cases/compiler/nestedJSDocImportType.ts b/testdata/tests/cases/compiler/nestedJSDocImportType.ts new file mode 100644 index 0000000000..8569089738 --- /dev/null +++ b/testdata/tests/cases/compiler/nestedJSDocImportType.ts @@ -0,0 +1,15 @@ +// @checkJs: true +// @noEmit: true +// @noTypesAndSymbols: true + +// @Filename: a.js +/** @typedef {string} A */ + +// @Filename: b.js +module.exports = { + create() { + /** @param {import("./a").A} x */ + function f(x) {} + return f("hi"); + } +} \ No newline at end of file From 49e5285c336c2212d568b504e578a461cb726ab3 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:04:16 -0700 Subject: [PATCH 24/69] Fix link in native preview platform packages (#1838) --- Herebyfile.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Herebyfile.mjs b/Herebyfile.mjs index 81109df321..b43a2b0115 100644 --- a/Herebyfile.mjs +++ b/Herebyfile.mjs @@ -1127,7 +1127,7 @@ export const buildNativePreviewPackages = task({ const readme = [ `# \`${npmPackageName}\``, "", - `This package provides ${nodeOs}-${nodeArch} support for [${packageJson.name}](https://www.npmjs.com/package/${packageJson.name}).`, + `This package provides ${nodeOs}-${nodeArch} support for [${mainNativePreviewPackage.npmPackageName}](https://www.npmjs.com/package/${mainNativePreviewPackage.npmPackageName}).`, ]; fs.promises.writeFile(path.join(npmDir, "README.md"), readme.join("\n") + "\n"); From 20b1482ea8b55d51fc21c60718dc934d763c918b Mon Sep 17 00:00:00 2001 From: "Oleksandr T." Date: Fri, 17 Oct 2025 15:59:03 +0300 Subject: [PATCH 25/69] fix(1880): No error message for JSDoc type parsing (#1881) --- internal/compiler/program.go | 6 ++ .../compiler/invalidJsdocType.errors.txt | 8 +++ .../compiler/invalidJsdocType.symbols | 7 +++ .../reference/compiler/invalidJsdocType.types | 7 +++ .../compiler/jsEnumCrossFileExport.errors.txt | 6 +- .../jsdocFunctionTypeFalsePositive.errors.txt | 5 +- ...docParameterParsingInfiniteLoop.errors.txt | 5 +- .../compiler/uniqueSymbolJs.errors.txt | 5 +- .../asyncArrowFunction_allowJs.errors.txt | 17 +++++- .../checkJsdocSatisfiesTag14.errors.txt | 20 +++++++ .../conformance/checkJsdocTypeTag1.errors.txt | 11 +++- .../conformance/checkJsdocTypeTag2.errors.txt | 14 ++++- ...ckJsdocTypeTagOnObjectProperty1.errors.txt | 8 ++- ...ckJsdocTypeTagOnObjectProperty2.errors.txt | 11 +++- ...checkJsdocTypedefOnlySourceFile.errors.txt | 6 +- .../conformance/importDeferJsdoc.errors.txt | 5 +- .../conformance/importTag10.errors.txt | 11 ++++ .../conformance/importTag11.errors.txt | 10 ++++ .../conformance/importTag12.errors.txt | 10 ++++ .../conformance/importTag13.errors.txt | 5 +- .../conformance/importTag14.errors.txt | 5 +- ...larationsModuleReferenceHasEmit.errors.txt | 5 +- ...ArgsWithThisTypeInJSDocFunction.errors.txt | 13 +++++ ...sExistingNodesMappingJSDocTypes.errors.txt | 11 +++- .../jsdocAugmentsMissingType.errors.txt | 5 +- .../conformance/jsdocFunctionType.errors.txt | 20 ++++++- .../jsdocFunction_missingReturn.errors.txt | 5 +- .../jsdocImplements_missingType.errors.txt | 11 ++++ .../jsdocImplements_missingType.js | 18 ------ .../jsdocImplements_missingType.js.diff | 20 +------ .../jsdocOuterTypeParameters1.errors.txt | 5 +- .../jsdocOuterTypeParameters3.errors.txt | 5 +- ...ocParseDotDotDotInJSDocFunction.errors.txt | 8 ++- .../jsdocParseHigherOrderFunction.errors.txt | 5 +- ...arseParenthesizedJSDocParameter.errors.txt | 5 +- .../jsdocParseStarEquals.errors.txt | 5 +- .../jsdocPrefixPostfixParsing.errors.txt | 11 +++- .../conformance/jsdocPrivateName2.errors.txt | 14 +++++ .../conformance/jsdocTemplateTag.errors.txt | 5 +- .../conformance/jsdocTemplateTag3.errors.txt | 5 +- .../jsdocTemplateTagDefault.errors.txt | 8 ++- .../conformance/jsdocThisType.errors.txt | 8 ++- .../jsdocTypeTagParameterType.errors.txt | 5 +- .../jsdocTypeTagRequiredParameters.errors.txt | 5 +- .../conformance/jsdocVariadicType.errors.txt | 5 +- .../noAssertForUnparseableTypedefs.errors.txt | 5 +- .../conformance/paramTagWrapping.errors.txt | 11 +++- .../templateInsideCallback.errors.txt | 14 ++++- ...typedefDuplicateTypeDeclaration.errors.txt | 13 +++++ .../typedefInnerNamepaths.errors.txt | 19 +++++++ .../conformance/typedefTagWrapping.errors.txt | 23 ++++++-- .../jsEnumCrossFileExport.errors.txt.diff | 6 +- ...cFunctionTypeFalsePositive.errors.txt.diff | 18 ------ ...rameterParsingInfiniteLoop.errors.txt.diff | 5 +- .../compiler/uniqueSymbolJs.errors.txt.diff | 13 +++-- ...asyncArrowFunction_allowJs.errors.txt.diff | 17 +++++- .../checkJsdocSatisfiesTag14.errors.txt.diff | 35 ++++++------ .../checkJsdocTypeTag1.errors.txt.diff | 22 +++++++- .../checkJsdocTypeTag2.errors.txt.diff | 16 +++++- ...ocTypeTagOnObjectProperty1.errors.txt.diff | 8 ++- ...ocTypeTagOnObjectProperty2.errors.txt.diff | 23 ++++---- ...JsdocTypedefOnlySourceFile.errors.txt.diff | 6 +- .../importDeferJsdoc.errors.txt.diff | 13 +++-- .../conformance/importTag10.errors.txt.diff | 15 ----- .../conformance/importTag11.errors.txt.diff | 19 +++---- .../conformance/importTag12.errors.txt.diff | 18 +++--- .../conformance/importTag13.errors.txt.diff | 15 +++-- .../conformance/importTag14.errors.txt.diff | 11 ++-- ...ionsModuleReferenceHasEmit.errors.txt.diff | 5 +- ...ithThisTypeInJSDocFunction.errors.txt.diff | 17 ++++++ ...tingNodesMappingJSDocTypes.errors.txt.diff | 11 +++- .../jsdocAugmentsMissingType.errors.txt.diff | 5 +- .../jsdocFunctionType.errors.txt.diff | 27 +++++++-- ...sdocFunction_missingReturn.errors.txt.diff | 5 +- ...sdocImplements_missingType.errors.txt.diff | 20 +++---- .../jsdocOuterTypeParameters1.errors.txt.diff | 12 ++-- .../jsdocOuterTypeParameters3.errors.txt.diff | 12 ++-- ...seDotDotDotInJSDocFunction.errors.txt.diff | 8 ++- ...ocParseHigherOrderFunction.errors.txt.diff | 5 +- ...arenthesizedJSDocParameter.errors.txt.diff | 5 +- .../jsdocParseStarEquals.errors.txt.diff | 5 +- .../jsdocPrefixPostfixParsing.errors.txt.diff | 24 ++++---- .../jsdocPrivateName2.errors.txt.diff | 23 +++----- .../jsdocTemplateTag.errors.txt.diff | 9 ++- .../jsdocTemplateTag3.errors.txt.diff | 21 +++---- .../jsdocTemplateTagDefault.errors.txt.diff | 33 ----------- .../conformance/jsdocThisType.errors.txt.diff | 10 +++- .../jsdocTypeTagParameterType.errors.txt.diff | 5 +- ...cTypeTagRequiredParameters.errors.txt.diff | 7 ++- .../jsdocVariadicType.errors.txt.diff | 5 +- ...sertForUnparseableTypedefs.errors.txt.diff | 5 +- .../paramTagWrapping.errors.txt.diff | 19 ++++--- .../templateInsideCallback.errors.txt.diff | 51 +++++++---------- ...efDuplicateTypeDeclaration.errors.txt.diff | 17 ------ .../typedefInnerNamepaths.errors.txt.diff | 35 ++++++------ .../typedefTagWrapping.errors.txt.diff | 55 +++++++------------ .../tests/cases/compiler/invalidJsdocType.ts | 6 ++ 97 files changed, 777 insertions(+), 419 deletions(-) create mode 100644 testdata/baselines/reference/compiler/invalidJsdocType.errors.txt create mode 100644 testdata/baselines/reference/compiler/invalidJsdocType.symbols create mode 100644 testdata/baselines/reference/compiler/invalidJsdocType.types create mode 100644 testdata/baselines/reference/submodule/conformance/checkJsdocSatisfiesTag14.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/importTag10.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/importTag11.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/importTag12.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/jsDeclarationsRestArgsWithThisTypeInJSDocFunction.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/jsdocImplements_missingType.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/jsdocPrivateName2.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/typedefDuplicateTypeDeclaration.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/typedefInnerNamepaths.errors.txt delete mode 100644 testdata/baselines/reference/submoduleAccepted/compiler/jsdocFunctionTypeFalsePositive.errors.txt.diff delete mode 100644 testdata/baselines/reference/submoduleAccepted/conformance/importTag10.errors.txt.diff create mode 100644 testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsRestArgsWithThisTypeInJSDocFunction.errors.txt.diff delete mode 100644 testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTagDefault.errors.txt.diff delete mode 100644 testdata/baselines/reference/submoduleAccepted/conformance/typedefDuplicateTypeDeclaration.errors.txt.diff create mode 100644 testdata/tests/cases/compiler/invalidJsdocType.ts diff --git a/internal/compiler/program.go b/internal/compiler/program.go index b70a00197f..7238991f97 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -1056,6 +1056,12 @@ func (p *Program) getSemanticDiagnosticsForFileNotFilter(ctx context.Context, so }) } + isJS := sourceFile.ScriptKind == core.ScriptKindJS || sourceFile.ScriptKind == core.ScriptKindJSX + isCheckJS := isJS && ast.IsCheckJSEnabledForFile(sourceFile, compilerOptions) + if isCheckJS { + diags = append(diags, sourceFile.JSDocDiagnostics()...) + } + filtered, directivesByLine := p.getDiagnosticsWithPrecedingDirectives(sourceFile, diags) for _, directive := range directivesByLine { // Above we changed all used directive kinds to @ts-ignore, so any @ts-expect-error directives that diff --git a/testdata/baselines/reference/compiler/invalidJsdocType.errors.txt b/testdata/baselines/reference/compiler/invalidJsdocType.errors.txt new file mode 100644 index 0000000000..e122d03076 --- /dev/null +++ b/testdata/baselines/reference/compiler/invalidJsdocType.errors.txt @@ -0,0 +1,8 @@ +a.js(1,12): error TS1110: Type expected. + + +==== a.js (1 errors) ==== + /** @type {@import("a").Type} */ + ~ +!!! error TS1110: Type expected. + let x; \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/invalidJsdocType.symbols b/testdata/baselines/reference/compiler/invalidJsdocType.symbols new file mode 100644 index 0000000000..0f8b4e2b0a --- /dev/null +++ b/testdata/baselines/reference/compiler/invalidJsdocType.symbols @@ -0,0 +1,7 @@ +//// [tests/cases/compiler/invalidJsdocType.ts] //// + +=== a.js === +/** @type {@import("a").Type} */ +let x; +>x : Symbol(x, Decl(a.js, 1, 3)) + diff --git a/testdata/baselines/reference/compiler/invalidJsdocType.types b/testdata/baselines/reference/compiler/invalidJsdocType.types new file mode 100644 index 0000000000..50b41486a2 --- /dev/null +++ b/testdata/baselines/reference/compiler/invalidJsdocType.types @@ -0,0 +1,7 @@ +//// [tests/cases/compiler/invalidJsdocType.ts] //// + +=== a.js === +/** @type {@import("a").Type} */ +let x; +>x : any + diff --git a/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.errors.txt b/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.errors.txt index 3be4b9a200..8636c15447 100644 --- a/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.errors.txt @@ -1,3 +1,4 @@ +enumDef.js(14,21): error TS1003: Identifier expected. enumDef.js(16,18): error TS2339: Property 'Blah' does not exist on type '{ Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }'. index.js(4,17): error TS2503: Cannot find namespace 'Host'. index.js(8,21): error TS2304: Cannot find name 'Host'. @@ -5,7 +6,7 @@ index.js(13,11): error TS2503: Cannot find namespace 'Host'. index.js(18,11): error TS2503: Cannot find namespace 'Host'. -==== enumDef.js (1 errors) ==== +==== enumDef.js (2 errors) ==== var Host = {}; Host.UserMetrics = {}; /** @enum {number} */ @@ -20,7 +21,10 @@ index.js(18,11): error TS2503: Cannot find namespace 'Host'. */ /** * @typedef {string} + */ + +!!! error TS1003: Identifier expected. Host.UserMetrics.Blah = { ~~~~ !!! error TS2339: Property 'Blah' does not exist on type '{ Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }'. diff --git a/testdata/baselines/reference/submodule/compiler/jsdocFunctionTypeFalsePositive.errors.txt b/testdata/baselines/reference/submodule/compiler/jsdocFunctionTypeFalsePositive.errors.txt index 4147bce1d5..f3bf77a415 100644 --- a/testdata/baselines/reference/submodule/compiler/jsdocFunctionTypeFalsePositive.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsdocFunctionTypeFalsePositive.errors.txt @@ -1,9 +1,12 @@ /a.js(1,13): error TS1098: Type parameter list cannot be empty. +/a.js(1,14): error TS1139: Type parameter declaration expected. -==== /a.js (1 errors) ==== +==== /a.js (2 errors) ==== /** @param {<} x */ ~~ !!! error TS1098: Type parameter list cannot be empty. + ~ +!!! error TS1139: Type parameter declaration expected. function f(x) {} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsdocParameterParsingInfiniteLoop.errors.txt b/testdata/baselines/reference/submodule/compiler/jsdocParameterParsingInfiniteLoop.errors.txt index 1b0b2a8cd2..e7e5e429a5 100644 --- a/testdata/baselines/reference/submodule/compiler/jsdocParameterParsingInfiniteLoop.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsdocParameterParsingInfiniteLoop.errors.txt @@ -1,12 +1,15 @@ example.js(3,11): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +example.js(3,19): error TS1005: '}' expected. -==== example.js (1 errors) ==== +==== example.js (2 errors) ==== // @ts-check /** * @type {function(@foo)} ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. */ let x; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/uniqueSymbolJs.errors.txt b/testdata/baselines/reference/submodule/compiler/uniqueSymbolJs.errors.txt index 162596d71b..9b3d5518d5 100644 --- a/testdata/baselines/reference/submodule/compiler/uniqueSymbolJs.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/uniqueSymbolJs.errors.txt @@ -1,8 +1,9 @@ a.js(5,18): error TS1268: An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type. a.js(5,23): error TS2749: 'foo' refers to a value, but is being used as a type here. Did you mean 'typeof foo'? +a.js(5,28): error TS1005: ';' expected. -==== a.js (2 errors) ==== +==== a.js (3 errors) ==== /** @type {unique symbol} */ const foo = Symbol(); @@ -12,4 +13,6 @@ a.js(5,23): error TS2749: 'foo' refers to a value, but is being used as a type h !!! error TS1268: An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type. ~~~ !!! error TS2749: 'foo' refers to a value, but is being used as a type here. Did you mean 'typeof foo'? + ~~~~~~~ +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/asyncArrowFunction_allowJs.errors.txt b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction_allowJs.errors.txt index 6dc5427f14..fcda802241 100644 --- a/testdata/baselines/reference/submodule/conformance/asyncArrowFunction_allowJs.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction_allowJs.errors.txt @@ -1,16 +1,23 @@ file.js(2,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +file.js(2,20): error TS1005: '}' expected. file.js(6,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +file.js(6,20): error TS1005: '}' expected. file.js(10,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +file.js(10,20): error TS1005: '}' expected. file.js(16,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +file.js(16,20): error TS1005: '}' expected. file.js(21,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +file.js(21,20): error TS1005: '}' expected. -==== file.js (5 errors) ==== +==== file.js (10 errors) ==== // Error (good) /** @type {function(): string} */ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. const a = () => 0 // Error (good) @@ -18,6 +25,8 @@ file.js(21,12): error TS2552: Cannot find name 'function'. Did you mean 'Functio ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. const b = async () => 0 // No error (bad) @@ -25,6 +34,8 @@ file.js(21,12): error TS2552: Cannot find name 'function'. Did you mean 'Functio ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. const c = async () => { return 0 } @@ -34,6 +45,8 @@ file.js(21,12): error TS2552: Cannot find name 'function'. Did you mean 'Functio ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. const d = async () => { return "" } @@ -42,6 +55,8 @@ file.js(21,12): error TS2552: Cannot find name 'function'. Did you mean 'Functio ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. const f = (p) => {} // Error (good) diff --git a/testdata/baselines/reference/submodule/conformance/checkJsdocSatisfiesTag14.errors.txt b/testdata/baselines/reference/submodule/conformance/checkJsdocSatisfiesTag14.errors.txt new file mode 100644 index 0000000000..81ef184a80 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/checkJsdocSatisfiesTag14.errors.txt @@ -0,0 +1,20 @@ +/a.js(7,15): error TS1005: '{' expected. +/a.js(10,27): error TS1005: '{' expected. + + +==== /a.js (2 errors) ==== + /** + * @typedef {Object} T1 + * @property {number} a + */ + + /** + * @satisfies T1 + ~~ +!!! error TS1005: '{' expected. + */ + const t1 = { a: 1 }; + const t2 = /** @satisfies T1 */ ({ a: 1 }); + ~~ +!!! error TS1005: '{' expected. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag1.errors.txt b/testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag1.errors.txt index beeb1723a4..e65ef651bc 100644 --- a/testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag1.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag1.errors.txt @@ -1,10 +1,13 @@ +0.js(12,13): error TS1110: Type expected. 0.js(20,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? 0.js(24,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +0.js(24,21): error TS1005: '}' expected. 0.js(28,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +0.js(28,21): error TS1005: '}' expected. 0.js(40,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'props' must be of type 'object', but here has type 'Object'. -==== 0.js (4 errors) ==== +==== 0.js (7 errors) ==== // @ts-check /** @type {String} */ var S = "hello world"; @@ -17,6 +20,8 @@ anyT = "hello"; /** @type {?} */ + ~ +!!! error TS1110: Type expected. var anyT1 = 2; anyT1 = "hi"; @@ -35,6 +40,8 @@ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. const x1 = (a) => a + 1; x1(0); @@ -42,6 +49,8 @@ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. const x2 = (a) => a + 1; x2(0); diff --git a/testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag2.errors.txt b/testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag2.errors.txt index 76933dc06a..3fa558ce7e 100644 --- a/testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/checkJsdocTypeTag2.errors.txt @@ -1,12 +1,16 @@ 0.js(3,5): error TS2322: Type 'boolean' is not assignable to type 'String'. 0.js(6,5): error TS2322: Type 'string' is not assignable to type 'number'. 0.js(8,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +0.js(8,21): error TS1005: '}' expected. 0.js(12,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +0.js(12,21): error TS1005: '}' expected. 0.js(19,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +0.js(19,21): error TS1005: '}' expected. 0.js(23,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +0.js(23,21): error TS1005: '}' expected. -==== 0.js (6 errors) ==== +==== 0.js (10 errors) ==== // @ts-check /** @type {String} */ var S = true; @@ -22,6 +26,8 @@ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. const x1 = (a) => a + 1; x1("string"); @@ -29,6 +35,8 @@ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. const x2 = (a) => a + 1; /** @type {string} */ @@ -39,6 +47,8 @@ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. const x3 = (a) => a.concat("hi"); x3(0); @@ -46,5 +56,7 @@ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. const x4 = (a) => a + 1; x4(0); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/checkJsdocTypeTagOnObjectProperty1.errors.txt b/testdata/baselines/reference/submodule/conformance/checkJsdocTypeTagOnObjectProperty1.errors.txt index 0de428dba4..fdc2f09b11 100644 --- a/testdata/baselines/reference/submodule/conformance/checkJsdocTypeTagOnObjectProperty1.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/checkJsdocTypeTagOnObjectProperty1.errors.txt @@ -1,9 +1,11 @@ 0.js(8,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? 0.js(8,14): error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments. +0.js(8,22): error TS1005: '}' expected. 0.js(16,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +0.js(16,22): error TS1005: '}' expected. -==== 0.js (3 errors) ==== +==== 0.js (5 errors) ==== // @ts-check var lol = "hello Lol" const obj = { @@ -17,6 +19,8 @@ !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ~~~~~~~~ !!! error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments. + ~ +!!! error TS1005: '}' expected. method1(n1) { return n1 + 42; }, @@ -28,6 +32,8 @@ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. arrowFunc: (num) => num + 42 } obj.foo = 'string' diff --git a/testdata/baselines/reference/submodule/conformance/checkJsdocTypeTagOnObjectProperty2.errors.txt b/testdata/baselines/reference/submodule/conformance/checkJsdocTypeTagOnObjectProperty2.errors.txt index 42e3fc5e74..a57a956ce1 100644 --- a/testdata/baselines/reference/submodule/conformance/checkJsdocTypeTagOnObjectProperty2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/checkJsdocTypeTagOnObjectProperty2.errors.txt @@ -1,11 +1,14 @@ 0.js(5,3): error TS2322: Type 'number' is not assignable to type 'string'. 0.js(6,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? 0.js(6,14): error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments. +0.js(6,22): error TS1005: '}' expected. 0.js(10,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +0.js(10,22): error TS1005: '}' expected. 0.js(12,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +0.js(12,22): error TS1005: '}' expected. -==== 0.js (5 errors) ==== +==== 0.js (8 errors) ==== // @ts-check var lol; const obj = { @@ -19,6 +22,8 @@ !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ~~~~~~~~ !!! error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments. + ~ +!!! error TS1005: '}' expected. method1(n1) { return "42"; }, @@ -26,11 +31,15 @@ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. method2: (n1) => "lol", /** @type {function(number): number} */ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. arrowFunc: (num="0") => num + 42, /** @type {string} */ lol diff --git a/testdata/baselines/reference/submodule/conformance/checkJsdocTypedefOnlySourceFile.errors.txt b/testdata/baselines/reference/submodule/conformance/checkJsdocTypedefOnlySourceFile.errors.txt index 7cb22b9170..02b45beef8 100644 --- a/testdata/baselines/reference/submodule/conformance/checkJsdocTypedefOnlySourceFile.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/checkJsdocTypedefOnlySourceFile.errors.txt @@ -1,9 +1,10 @@ 0.js(3,5): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. +0.js(6,21): error TS1003: Identifier expected. 0.js(8,9): error TS2339: Property 'SomeName' does not exist on type '{}'. 0.js(10,12): error TS2503: Cannot find namespace 'exports'. -==== 0.js (3 errors) ==== +==== 0.js (4 errors) ==== // @ts-check var exports = {}; @@ -12,7 +13,10 @@ /** * @typedef {string} + */ + +!!! error TS1003: Identifier expected. exports.SomeName; ~~~~~~~~ !!! error TS2339: Property 'SomeName' does not exist on type '{}'. diff --git a/testdata/baselines/reference/submodule/conformance/importDeferJsdoc.errors.txt b/testdata/baselines/reference/submodule/conformance/importDeferJsdoc.errors.txt index ddbf644aaa..857db340b4 100644 --- a/testdata/baselines/reference/submodule/conformance/importDeferJsdoc.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/importDeferJsdoc.errors.txt @@ -1,3 +1,4 @@ +/foo.js(2,18): error TS1005: 'from' expected. /foo.js(2,18): error TS1141: String literal expected. /foo.js(6,12): error TS2503: Cannot find namespace 'ns'. @@ -5,9 +6,11 @@ ==== /types.ts (0 errors) ==== export type X = 1; -==== /foo.js (2 errors) ==== +==== /foo.js (3 errors) ==== /** * @import defer * as ns from "./types" + ~ +!!! error TS1005: 'from' expected. ~~~~ !!! error TS1141: String literal expected. */ diff --git a/testdata/baselines/reference/submodule/conformance/importTag10.errors.txt b/testdata/baselines/reference/submodule/conformance/importTag10.errors.txt new file mode 100644 index 0000000000..496ce7f502 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/importTag10.errors.txt @@ -0,0 +1,11 @@ +/foo.js(2,11): error TS1109: Expression expected. + + +==== /foo.js (1 errors) ==== + /** + * @import + + */ + +!!! error TS1109: Expression expected. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/importTag11.errors.txt b/testdata/baselines/reference/submodule/conformance/importTag11.errors.txt new file mode 100644 index 0000000000..6071e9e709 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/importTag11.errors.txt @@ -0,0 +1,10 @@ +/foo.js(3,2): error TS1005: 'from' expected. + + +==== /foo.js (1 errors) ==== + /** + * @import foo + */ + +!!! error TS1005: 'from' expected. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/importTag12.errors.txt b/testdata/baselines/reference/submodule/conformance/importTag12.errors.txt new file mode 100644 index 0000000000..dc3d88ac50 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/importTag12.errors.txt @@ -0,0 +1,10 @@ +/foo.js(3,2): error TS1109: Expression expected. + + +==== /foo.js (1 errors) ==== + /** + * @import foo from + */ + +!!! error TS1109: Expression expected. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/importTag13.errors.txt b/testdata/baselines/reference/submodule/conformance/importTag13.errors.txt index 958d6225ec..3427c0e358 100644 --- a/testdata/baselines/reference/submodule/conformance/importTag13.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/importTag13.errors.txt @@ -1,8 +1,11 @@ +/foo.js(1,15): error TS1005: 'from' expected. /foo.js(1,15): error TS1141: String literal expected. -==== /foo.js (1 errors) ==== +==== /foo.js (2 errors) ==== /** @import x = require("types") */ + ~ +!!! error TS1005: 'from' expected. ~~~~~~~~~~~~~~~~~~ !!! error TS1141: String literal expected. diff --git a/testdata/baselines/reference/submodule/conformance/importTag14.errors.txt b/testdata/baselines/reference/submodule/conformance/importTag14.errors.txt index d5fdf908c6..6109dd03ca 100644 --- a/testdata/baselines/reference/submodule/conformance/importTag14.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/importTag14.errors.txt @@ -1,9 +1,10 @@ /foo.js(1,25): error TS2306: File '/foo.js' is not a module. /foo.js(1,33): error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. /foo.js(1,33): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +/foo.js(1,38): error TS1005: '{' expected. -==== /foo.js (3 errors) ==== +==== /foo.js (4 errors) ==== /** @import * as f from "./foo" with */ ~~~~~~~ !!! error TS2306: File '/foo.js' is not a module. @@ -11,4 +12,6 @@ !!! error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. ~~~~ !!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. + +!!! error TS1005: '{' expected. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsModuleReferenceHasEmit.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsModuleReferenceHasEmit.errors.txt index 30a9f935a7..03ef528a8c 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsModuleReferenceHasEmit.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsModuleReferenceHasEmit.errors.txt @@ -1,7 +1,8 @@ index.js(9,11): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(9,17): error TS1005: '}' expected. -==== index.js (1 errors) ==== +==== index.js (2 errors) ==== /** * @module A */ @@ -13,6 +14,8 @@ index.js(9,11): error TS2580: Cannot find name 'module'. Do you need to install * @type {module:A} ~~~~~~ !!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~ +!!! error TS1005: '}' expected. */ export let el = null; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsRestArgsWithThisTypeInJSDocFunction.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsRestArgsWithThisTypeInJSDocFunction.errors.txt new file mode 100644 index 0000000000..9e85c38599 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsRestArgsWithThisTypeInJSDocFunction.errors.txt @@ -0,0 +1,13 @@ +bug38550.js(3,22): error TS1005: '}' expected. + + +==== bug38550.js (1 errors) ==== + export class Clazz { + /** + * @param {function(this:Object, ...*):*} functionDeclaration + ~ +!!! error TS1005: '}' expected. + */ + method(functionDeclaration) {} + } + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReusesExistingNodesMappingJSDocTypes.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReusesExistingNodesMappingJSDocTypes.errors.txt index e15b2747c9..e6ea3ee553 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReusesExistingNodesMappingJSDocTypes.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReusesExistingNodesMappingJSDocTypes.errors.txt @@ -1,10 +1,15 @@ +index.js(1,13): error TS1110: Type expected. index.js(16,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +index.js(16,20): error TS1005: '}' expected. index.js(19,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +index.js(19,20): error TS1005: '}' expected. index.js(22,12): error TS2315: Type 'Object' is not generic. -==== index.js (3 errors) ==== +==== index.js (6 errors) ==== /** @type {?} */ + ~ +!!! error TS1110: Type expected. export const a = null; /** @type {*} */ @@ -23,12 +28,16 @@ index.js(22,12): error TS2315: Type 'Object' is not generic. ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. export const f = null; /** @type {function(new: object, string, number)} */ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. export const g = null; /** @type {Object.} */ diff --git a/testdata/baselines/reference/submodule/conformance/jsdocAugmentsMissingType.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocAugmentsMissingType.errors.txt index f3a1da2292..64751af466 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocAugmentsMissingType.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocAugmentsMissingType.errors.txt @@ -1,11 +1,14 @@ /a.js(2,14): error TS8023: JSDoc '@augments ' does not match the 'extends A' clause. +/a.js(2,14): error TS1003: Identifier expected. -==== /a.js (1 errors) ==== +==== /a.js (2 errors) ==== class A { constructor() { this.x = 0; } } /** @augments */ !!! error TS8023: JSDoc '@augments ' does not match the 'extends A' clause. + ~ +!!! error TS1003: Identifier expected. class B extends A { m() { this.x diff --git a/testdata/baselines/reference/submodule/conformance/jsdocFunctionType.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocFunctionType.errors.txt index b1407448a2..bb3a047fb1 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocFunctionType.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocFunctionType.errors.txt @@ -1,22 +1,32 @@ +functions.js(2,20): error TS1005: '}' expected. functions.js(3,13): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +functions.js(3,21): error TS1005: '}' expected. functions.js(5,14): error TS7006: Parameter 'c' implicitly has an 'any' type. functions.js(9,23): error TS7006: Parameter 'n' implicitly has an 'any' type. +functions.js(12,20): error TS1005: '}' expected. functions.js(13,13): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +functions.js(13,21): error TS1005: '}' expected. functions.js(15,14): error TS7006: Parameter 'c' implicitly has an 'any' type. functions.js(30,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +functions.js(30,21): error TS1005: '}' expected. functions.js(31,19): error TS7006: Parameter 'ab' implicitly has an 'any' type. functions.js(31,23): error TS7006: Parameter 'onetwo' implicitly has an 'any' type. +functions.js(48,20): error TS1005: '}' expected. functions.js(49,13): error TS2749: 'D' refers to a value, but is being used as a type here. Did you mean 'typeof D'? functions.js(51,26): error TS7006: Parameter 'dref' implicitly has an 'any' type. -==== functions.js (10 errors) ==== +==== functions.js (16 errors) ==== /** * @param {function(this: string, number): number} c is just passing on through + ~ +!!! error TS1005: '}' expected. * @return {function(this: string, number): number} ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. */ function id1(c) { ~ @@ -30,10 +40,14 @@ functions.js(51,26): error TS7006: Parameter 'dref' implicitly has an 'any' type /** * @param {function(new: { length: number }, number): number} c is just passing on through + ~ +!!! error TS1005: '}' expected. * @return {function(new: { length: number }, number): number} ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. */ function id2(c) { ~ @@ -56,6 +70,8 @@ functions.js(51,26): error TS7006: Parameter 'dref' implicitly has an 'any' type ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. var f = function (ab, onetwo) { return ab === "a" ? 3 : 4; } ~~ !!! error TS7006: Parameter 'ab' implicitly has an 'any' type. @@ -78,6 +94,8 @@ functions.js(51,26): error TS7006: Parameter 'dref' implicitly has an 'any' type /** * @param {function(new: D, number)} dref + ~ +!!! error TS1005: '}' expected. * @return {D} ~ !!! error TS2749: 'D' refers to a value, but is being used as a type here. Did you mean 'typeof D'? diff --git a/testdata/baselines/reference/submodule/conformance/jsdocFunction_missingReturn.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocFunction_missingReturn.errors.txt index cf99dc4aac..f245054c91 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocFunction_missingReturn.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocFunction_missingReturn.errors.txt @@ -1,13 +1,16 @@ /a.js(1,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? /a.js(1,12): error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments. +/a.js(1,20): error TS1005: '}' expected. -==== /a.js (2 errors) ==== +==== /a.js (3 errors) ==== /** @type {function(): number} */ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ~~~~~~~~ !!! error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments. + ~ +!!! error TS1005: '}' expected. function f() {} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImplements_missingType.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocImplements_missingType.errors.txt new file mode 100644 index 0000000000..1b22f60035 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/jsdocImplements_missingType.errors.txt @@ -0,0 +1,11 @@ +/a.js(2,16): error TS1003: Identifier expected. + + +==== /a.js (1 errors) ==== + class A { constructor() { this.x = 0; } } + /** @implements */ + ~ +!!! error TS1003: Identifier expected. + class B { + } + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImplements_missingType.js b/testdata/baselines/reference/submodule/conformance/jsdocImplements_missingType.js index 0d5243e60c..222dea0291 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImplements_missingType.js +++ b/testdata/baselines/reference/submodule/conformance/jsdocImplements_missingType.js @@ -16,21 +16,3 @@ declare class A { /** @implements */ declare class B implements { } - - -//// [DtsFileErrors] - - -out/a.d.ts(5,27): error TS1097: 'implements' list cannot be empty. - - -==== out/a.d.ts (1 errors) ==== - declare class A { - constructor(); - } - /** @implements */ - declare class B implements { - -!!! error TS1097: 'implements' list cannot be empty. - } - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImplements_missingType.js.diff b/testdata/baselines/reference/submodule/conformance/jsdocImplements_missingType.js.diff index 643e190e6e..0f948ec122 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImplements_missingType.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsdocImplements_missingType.js.diff @@ -10,22 +10,4 @@ /** @implements */ -declare class B { +declare class B implements { - } -+ -+ -+//// [DtsFileErrors] -+ -+ -+out/a.d.ts(5,27): error TS1097: 'implements' list cannot be empty. -+ -+ -+==== out/a.d.ts (1 errors) ==== -+ declare class A { -+ constructor(); -+ } -+ /** @implements */ -+ declare class B implements { -+ -+!!! error TS1097: 'implements' list cannot be empty. -+ } -+ \ No newline at end of file + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsdocOuterTypeParameters1.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocOuterTypeParameters1.errors.txt index ab250f778b..7d683ab15b 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocOuterTypeParameters1.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocOuterTypeParameters1.errors.txt @@ -1,18 +1,21 @@ error TS5055: Cannot write file 'jsdocOuterTypeParameters1.js' because it would overwrite input file. Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. jsdocOuterTypeParameters1.js(1,14): error TS2304: Cannot find name 'T'. +jsdocOuterTypeParameters1.js(4,19): error TS1069: Unexpected token. A type parameter name was expected without curly braces. jsdocOuterTypeParameters1.js(7,35): error TS2339: Property 'foo' does not exist on type 'Bar'. !!! error TS5055: Cannot write file 'jsdocOuterTypeParameters1.js' because it would overwrite input file. !!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. -==== jsdocOuterTypeParameters1.js (2 errors) ==== +==== jsdocOuterTypeParameters1.js (3 errors) ==== /** @return {T} */ ~ !!! error TS2304: Cannot find name 'T'. const dedupingMixin = function(mixin) {}; /** @template {T} */ + ~ +!!! error TS1069: Unexpected token. A type parameter name was expected without curly braces. const PropertyAccessors = dedupingMixin(() => { class Bar { static bar() { this.prototype.foo(); } diff --git a/testdata/baselines/reference/submodule/conformance/jsdocOuterTypeParameters3.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocOuterTypeParameters3.errors.txt index dbb9a05d5f..dec5ad00d7 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocOuterTypeParameters3.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocOuterTypeParameters3.errors.txt @@ -1,12 +1,15 @@ error TS5055: Cannot write file 'jsdocOuterTypeParameters3.js' because it would overwrite input file. Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. +jsdocOuterTypeParameters3.js(1,18): error TS1069: Unexpected token. A type parameter name was expected without curly braces. jsdocOuterTypeParameters3.js(5,43): error TS2339: Property 'foo' does not exist on type 'Bar'. !!! error TS5055: Cannot write file 'jsdocOuterTypeParameters3.js' because it would overwrite input file. !!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. -==== jsdocOuterTypeParameters3.js (1 errors) ==== +==== jsdocOuterTypeParameters3.js (2 errors) ==== /** @template {T} */ + ~ +!!! error TS1069: Unexpected token. A type parameter name was expected without curly braces. class Baz { m() { class Bar { diff --git a/testdata/baselines/reference/submodule/conformance/jsdocParseDotDotDotInJSDocFunction.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocParseDotDotDotInJSDocFunction.errors.txt index 4d4beab51f..eae095f502 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocParseDotDotDotInJSDocFunction.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocParseDotDotDotInJSDocFunction.errors.txt @@ -1,10 +1,14 @@ +a.js(2,21): error TS1005: '}' expected. a.js(3,12): error TS7006: Parameter 'callback' implicitly has an 'any' type. a.js(8,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +a.js(8,20): error TS1005: '}' expected. -==== a.js (2 errors) ==== +==== a.js (4 errors) ==== // from bcryptjs /** @param {function(...[*])} callback */ + ~ +!!! error TS1005: '}' expected. function g(callback) { ~~~~~~~~ !!! error TS7006: Parameter 'callback' implicitly has an 'any' type. @@ -16,6 +20,8 @@ a.js(8,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. * @inner */ var stringFromCharCode = String.fromCharCode; diff --git a/testdata/baselines/reference/submodule/conformance/jsdocParseHigherOrderFunction.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocParseHigherOrderFunction.errors.txt index ff420a46d1..a5d5360268 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocParseHigherOrderFunction.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocParseHigherOrderFunction.errors.txt @@ -1,13 +1,16 @@ paren.js(1,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +paren.js(1,20): error TS1005: '}' expected. paren.js(2,10): error TS7006: Parameter 's' implicitly has an 'any' type. paren.js(2,13): error TS7006: Parameter 'id' implicitly has an 'any' type. -==== paren.js (3 errors) ==== +==== paren.js (4 errors) ==== /** @type {function((string), function((string)): string): string} */ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. var x = (s, id) => id(s) ~ !!! error TS7006: Parameter 's' implicitly has an 'any' type. diff --git a/testdata/baselines/reference/submodule/conformance/jsdocParseParenthesizedJSDocParameter.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocParseParenthesizedJSDocParameter.errors.txt index 89b948713c..ebc7f44032 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocParseParenthesizedJSDocParameter.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocParseParenthesizedJSDocParameter.errors.txt @@ -1,12 +1,15 @@ paren.js(1,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +paren.js(1,20): error TS1005: '}' expected. paren.js(2,9): error TS7006: Parameter 's' implicitly has an 'any' type. -==== paren.js (2 errors) ==== +==== paren.js (3 errors) ==== /** @type {function((string)): string} */ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. var x = s => s.toString() ~ !!! error TS7006: Parameter 's' implicitly has an 'any' type. diff --git a/testdata/baselines/reference/submodule/conformance/jsdocParseStarEquals.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocParseStarEquals.errors.txt index b4c0510f9b..a6b4acf204 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocParseStarEquals.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocParseStarEquals.errors.txt @@ -1,9 +1,10 @@ a.js(1,5): error TS1047: A rest parameter cannot be optional. a.js(3,12): error TS2370: A rest parameter must be of an array type. +a.js(11,21): error TS1005: '}' expected. a.js(12,14): error TS7006: Parameter 'f' implicitly has an 'any' type. -==== a.js (3 errors) ==== +==== a.js (4 errors) ==== /** @param {...*=} args ~~~~~~~~~~~~~~~~~~~ @return {*=} */ @@ -20,6 +21,8 @@ a.js(12,14): error TS7006: Parameter 'f' implicitly has an 'any' type. /** @param {function():*=} f */ + ~ +!!! error TS1005: '}' expected. function cbf(f) { ~ !!! error TS7006: Parameter 'f' implicitly has an 'any' type. diff --git a/testdata/baselines/reference/submodule/conformance/jsdocPrefixPostfixParsing.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocPrefixPostfixParsing.errors.txt index f6d00af955..4318cb0357 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocPrefixPostfixParsing.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocPrefixPostfixParsing.errors.txt @@ -1,23 +1,32 @@ +prefixPostfix.js(5,18): error TS1005: '}' expected. +prefixPostfix.js(11,21): error TS1005: '}' expected. +prefixPostfix.js(14,21): error TS1005: '}' expected. prefixPostfix.js(18,21): error TS7006: Parameter 'a' implicitly has an 'any' type. prefixPostfix.js(18,39): error TS7006: Parameter 'h' implicitly has an 'any' type. prefixPostfix.js(18,48): error TS7006: Parameter 'k' implicitly has an 'any' type. -==== prefixPostfix.js (3 errors) ==== +==== prefixPostfix.js (6 errors) ==== /** * @param {number![]} x - number[] * @param {!number[]} y - number[] * @param {(number[])!} z - number[] * @param {number?[]} a - parse error without parentheses + ~ +!!! error TS1005: '}' expected. * @param {?number[]} b - number[] | null * @param {(number[])?} c - number[] | null * @param {...?number} e - (number | null)[] * @param {...number?} f - number[] | null * @param {...number!?} g - number[] | null * @param {...number?!} h - parse error without parentheses (also nonsensical) + ~ +!!! error TS1005: '}' expected. * @param {...number[]} i - number[][] * @param {...number![]?} j - number[][] | null * @param {...number?[]!} k - parse error without parentheses + ~ +!!! error TS1005: '}' expected. * @param {number extends number ? true : false} l - conditional types work * @param {[number, number?]} m - [number, (number | undefined)?] */ diff --git a/testdata/baselines/reference/submodule/conformance/jsdocPrivateName2.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocPrivateName2.errors.txt new file mode 100644 index 0000000000..259a1dcf2f --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/jsdocPrivateName2.errors.txt @@ -0,0 +1,14 @@ +jsdocPrivateName1.js(6,23): error TS1003: Identifier expected. + + +==== jsdocPrivateName1.js (1 errors) ==== + // Expecting parse error for private field + + /** + * @typedef A + * @type {object} + * @property {string} #id + ~ +!!! error TS1003: Identifier expected. + */ + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag.errors.txt index b60487ba5b..c2c29e32e4 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag.errors.txt @@ -1,9 +1,10 @@ forgot.js(13,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +forgot.js(13,22): error TS1005: '}' expected. forgot.js(23,1): error TS2322: Type '(keyframes: Keyframe[] | PropertyIndexedKeyframes) => void' is not assignable to type '(keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions) => Animation'. Type 'void' is not assignable to type 'Animation'. -==== forgot.js (2 errors) ==== +==== forgot.js (3 errors) ==== /** * @param {T} a * @template T @@ -20,6 +21,8 @@ forgot.js(23,1): error TS2322: Type '(keyframes: Keyframe[] | PropertyIndexedKey ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. */ function g(a) { return () => a diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag3.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag3.errors.txt index acd63b1e17..13884500ea 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag3.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag3.errors.txt @@ -1,9 +1,10 @@ a.js(14,29): error TS2339: Property 'a' does not exist on type 'U'. a.js(14,35): error TS2339: Property 'b' does not exist on type 'U'. a.js(21,3): error TS2741: Property 'b' is missing in type '{ a: number; }' but required in type '{ a: number; b: string; }'. +a.js(25,2): error TS1069: Unexpected token. A type parameter name was expected without curly braces. -==== a.js (3 errors) ==== +==== a.js (4 errors) ==== /** * @template {{ a: number, b: string }} T,U A Comment * @template {{ c: boolean }} V uh ... are comments even supported?? @@ -36,6 +37,8 @@ a.js(21,3): error TS2741: Property 'b' is missing in type '{ a: number; }' but r /** * @template {NoLongerAllowed} * @template T preceding line's syntax is no longer allowed + ~ +!!! error TS1069: Unexpected token. A type parameter name was expected without curly braces. * @param {T} x */ function g(x) { } diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTagDefault.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTagDefault.errors.txt index 6ad768a099..ef3db758ce 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTagDefault.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTagDefault.errors.txt @@ -1,11 +1,13 @@ file.js(9,20): error TS2322: Type 'number' is not assignable to type 'string'. +file.js(22,34): error TS1005: '=' expected. +file.js(27,35): error TS1110: Type expected. file.js(33,14): error TS2706: Required type parameters may not follow optional type parameters. file.js(38,17): error TS2744: Type parameter defaults can only reference previously declared type parameters. file.js(53,14): error TS2706: Required type parameters may not follow optional type parameters. file.js(60,17): error TS2744: Type parameter defaults can only reference previously declared type parameters. -==== file.js (5 errors) ==== +==== file.js (7 errors) ==== /** * @template {string | number} [T=string] - ok: defaults are permitted * @typedef {[T]} A @@ -30,11 +32,15 @@ file.js(60,17): error TS2744: Type parameter defaults can only reference previou /** * @template {string | number} [T] - error: default requires an `=type` + ~ +!!! error TS1005: '=' expected. * @typedef {[T]} C */ /** * @template {string | number} [T=] - error: default requires a `type` + ~ +!!! error TS1110: Type expected. * @typedef {[T]} D */ diff --git a/testdata/baselines/reference/submodule/conformance/jsdocThisType.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocThisType.errors.txt index 1d0065669f..138dbe00f1 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocThisType.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocThisType.errors.txt @@ -3,8 +3,10 @@ /a.js(13,10): error TS2339: Property 'test' does not exist on type 'Foo'. /a.js(18,10): error TS2339: Property 'test' does not exist on type 'Foo'. /a.js(21,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +/a.js(21,20): error TS1005: '}' expected. /a.js(26,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? /a.js(26,12): error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments. +/a.js(26,20): error TS1005: '}' expected. ==== /types.d.ts (0 errors) ==== @@ -14,7 +16,7 @@ export type M = (this: Foo) => void; -==== /a.js (7 errors) ==== +==== /a.js (9 errors) ==== /** @type {import('./types').M} */ export const f1 = function() { this.test(); @@ -47,6 +49,8 @@ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. export const f5 = function() { this.test(); } @@ -57,6 +61,8 @@ !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ~~~~~~~~ !!! error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments. + ~ +!!! error TS1005: '}' expected. export function f6() { this.test(); } diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeTagParameterType.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocTypeTagParameterType.errors.txt index c7dad2e526..0aab334433 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeTagParameterType.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeTagParameterType.errors.txt @@ -1,13 +1,16 @@ a.js(1,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +a.js(1,20): error TS1005: '}' expected. a.js(2,12): error TS7006: Parameter 'value' implicitly has an 'any' type. a.js(7,5): error TS2322: Type 'number' is not assignable to type 'string'. -==== a.js (3 errors) ==== +==== a.js (4 errors) ==== /** @type {function(string): void} */ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. const f = (value) => { ~~~~~ !!! error TS7006: Parameter 'value' implicitly has an 'any' type. diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeTagRequiredParameters.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocTypeTagRequiredParameters.errors.txt index 5b78db63ce..39e940dd64 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeTagRequiredParameters.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeTagRequiredParameters.errors.txt @@ -1,14 +1,17 @@ a.js(1,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +a.js(1,20): error TS1005: '}' expected. a.js(2,12): error TS7006: Parameter 'value' implicitly has an 'any' type. a.js(12,1): error TS2554: Expected 1 arguments, but got 0. a.js(13,1): error TS2554: Expected 1 arguments, but got 0. -==== a.js (4 errors) ==== +==== a.js (5 errors) ==== /** @type {function(string): void} */ ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. const f = (value) => { ~~~~~ !!! error TS7006: Parameter 'value' implicitly has an 'any' type. diff --git a/testdata/baselines/reference/submodule/conformance/jsdocVariadicType.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocVariadicType.errors.txt index 908bca4dda..45177af772 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocVariadicType.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocVariadicType.errors.txt @@ -1,12 +1,15 @@ a.js(2,11): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +a.js(2,19): error TS1005: '}' expected. -==== a.js (1 errors) ==== +==== a.js (2 errors) ==== /** * @type {function(boolean, string, ...*):void} ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. */ const foo = function (a, b, ...r) { }; diff --git a/testdata/baselines/reference/submodule/conformance/noAssertForUnparseableTypedefs.errors.txt b/testdata/baselines/reference/submodule/conformance/noAssertForUnparseableTypedefs.errors.txt index e71c8f9b2d..072f764cfa 100644 --- a/testdata/baselines/reference/submodule/conformance/noAssertForUnparseableTypedefs.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/noAssertForUnparseableTypedefs.errors.txt @@ -1,11 +1,14 @@ bug26693.js(1,15): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +bug26693.js(1,21): error TS1005: '}' expected. bug26693.js(2,22): error TS2307: Cannot find module 'nope' or its corresponding type declarations. -==== bug26693.js (2 errors) ==== +==== bug26693.js (3 errors) ==== /** @typedef {module:locale} hi */ ~~~~~~ !!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~ +!!! error TS1005: '}' expected. import { nope } from 'nope'; ~~~~~~ !!! error TS2307: Cannot find module 'nope' or its corresponding type declarations. diff --git a/testdata/baselines/reference/submodule/conformance/paramTagWrapping.errors.txt b/testdata/baselines/reference/submodule/conformance/paramTagWrapping.errors.txt index bc43cc7750..c0d8d0c963 100644 --- a/testdata/baselines/reference/submodule/conformance/paramTagWrapping.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/paramTagWrapping.errors.txt @@ -1,3 +1,6 @@ +bad.js(2,11): error TS1003: Identifier expected. +bad.js(5,4): error TS1003: Identifier expected. +bad.js(6,20): error TS1003: Identifier expected. bad.js(9,14): error TS7006: Parameter 'x' implicitly has an 'any' type. bad.js(9,17): error TS7006: Parameter 'y' implicitly has an 'any' type. bad.js(9,20): error TS7006: Parameter 'z' implicitly has an 'any' type. @@ -18,13 +21,19 @@ bad.js(9,20): error TS7006: Parameter 'z' implicitly has an 'any' type. good(1, 2, 3) -==== bad.js (3 errors) ==== +==== bad.js (6 errors) ==== /** * @param * + ~ +!!! error TS1003: Identifier expected. * {number} x Arg x. * @param {number} * * y Arg y. + ~ +!!! error TS1003: Identifier expected. * @param {number} * z + ~ +!!! error TS1003: Identifier expected. * Arg z. */ function bad(x, y, z) { diff --git a/testdata/baselines/reference/submodule/conformance/templateInsideCallback.errors.txt b/testdata/baselines/reference/submodule/conformance/templateInsideCallback.errors.txt index 48940af384..7d0367dab1 100644 --- a/testdata/baselines/reference/submodule/conformance/templateInsideCallback.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/templateInsideCallback.errors.txt @@ -1,11 +1,15 @@ +templateInsideCallback.js(9,5): error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag templateInsideCallback.js(15,11): error TS2315: Type 'Call' is not generic. templateInsideCallback.js(15,16): error TS2304: Cannot find name 'T'. templateInsideCallback.js(17,18): error TS7006: Parameter 'x' implicitly has an 'any' type. +templateInsideCallback.js(23,5): error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag templateInsideCallback.js(29,5): error TS7012: This overload implicitly returns the type 'any' because it lacks a return type annotation. +templateInsideCallback.js(30,5): error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag templateInsideCallback.js(37,5): error TS7012: This overload implicitly returns the type 'any' because it lacks a return type annotation. +templateInsideCallback.js(38,5): error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag -==== templateInsideCallback.js (5 errors) ==== +==== templateInsideCallback.js (9 errors) ==== /** * @typedef Oops * @template T @@ -15,6 +19,8 @@ templateInsideCallback.js(37,5): error TS7012: This overload implicitly returns /** * @callback Call * @template T + ~~~~~~~~ +!!! error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag * @param {T} x * @returns {T} */ @@ -35,6 +41,8 @@ templateInsideCallback.js(37,5): error TS7012: This overload implicitly returns * @property {Object} oh * @property {number} oh.no * @template T + ~~~~~~~~ +!!! error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag * @property {string} oh.noooooo */ @@ -44,6 +52,8 @@ templateInsideCallback.js(37,5): error TS7012: This overload implicitly returns ~~~~~~~~ !!! error TS7012: This overload implicitly returns the type 'any' because it lacks a return type annotation. * @template T + ~~~~~~~~ +!!! error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag * @template U * @param {T[]} array * @param {(x: T) => U[]} iterable @@ -54,6 +64,8 @@ templateInsideCallback.js(37,5): error TS7012: This overload implicitly returns ~~~~~~~~ !!! error TS7012: This overload implicitly returns the type 'any' because it lacks a return type annotation. * @template T + ~~~~~~~~ +!!! error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag * @param {T[][]} array * @returns {T[]} */ diff --git a/testdata/baselines/reference/submodule/conformance/typedefDuplicateTypeDeclaration.errors.txt b/testdata/baselines/reference/submodule/conformance/typedefDuplicateTypeDeclaration.errors.txt new file mode 100644 index 0000000000..9dd2576068 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typedefDuplicateTypeDeclaration.errors.txt @@ -0,0 +1,13 @@ +typedefDuplicateTypeDeclaration.js(4,16): error TS8033: A JSDoc '@typedef' comment may not contain multiple '@type' tags. + + +==== typedefDuplicateTypeDeclaration.js (1 errors) ==== + /** + * @typedef Name + * @type {string} + * @type {Oops} + + */ + +!!! error TS8033: A JSDoc '@typedef' comment may not contain multiple '@type' tags. +!!! related TS8034 typedefDuplicateTypeDeclaration.js:1:1: The tag was first specified here. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typedefInnerNamepaths.errors.txt b/testdata/baselines/reference/submodule/conformance/typedefInnerNamepaths.errors.txt new file mode 100644 index 0000000000..2aa319ce1c --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typedefInnerNamepaths.errors.txt @@ -0,0 +1,19 @@ +bug25104.js(3,19): error TS1005: '}' expected. +bug25104.js(6,18): error TS1005: '}' expected. + + +==== bug25104.js (2 errors) ==== + class C { + /** + * @typedef {C~A} C~B + ~ +!!! error TS1005: '}' expected. + * @typedef {object} C~A + */ + /** @param {C~A} o */ + ~ +!!! error TS1005: '}' expected. + constructor(o) { + } + } + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typedefTagWrapping.errors.txt b/testdata/baselines/reference/submodule/conformance/typedefTagWrapping.errors.txt index 6b2506e05c..80e1108585 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefTagWrapping.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typedefTagWrapping.errors.txt @@ -1,17 +1,24 @@ mod1.js(2,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +mod1.js(2,22): error TS1005: '}' expected. mod1.js(9,12): error TS2304: Cannot find name 'Type1'. mod3.js(4,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +mod3.js(4,22): error TS1005: '}' expected. mod3.js(10,12): error TS2304: Cannot find name 'StringOrNumber1'. mod4.js(4,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +mod4.js(4,22): error TS1005: '}' expected. mod4.js(11,12): error TS2304: Cannot find name 'StringOrNumber2'. +mod7.js(5,7): error TS1110: Type expected. +mod7.js(8,4): error TS1110: Type expected. -==== mod1.js (2 errors) ==== +==== mod1.js (3 errors) ==== /** * @typedef {function(string): boolean} ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. * Type1 */ @@ -46,7 +53,7 @@ mod4.js(11,12): error TS2304: Cannot find name 'StringOrNumber2'. return obj.boo ? obj.num : obj.str; } -==== mod3.js (2 errors) ==== +==== mod3.js (3 errors) ==== /** * A function whose signature is very long. * @@ -54,6 +61,8 @@ mod4.js(11,12): error TS2304: Cannot find name 'StringOrNumber2'. ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. * (string|number)} StringOrNumber1 */ @@ -71,7 +80,7 @@ mod4.js(11,12): error TS2304: Cannot find name 'StringOrNumber2'. return func(bool, str, num) } -==== mod4.js (2 errors) ==== +==== mod4.js (3 errors) ==== /** * A function whose signature is very long. * @@ -79,6 +88,8 @@ mod4.js(11,12): error TS2304: Cannot find name 'StringOrNumber2'. ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? !!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~ +!!! error TS1005: '}' expected. * number): * (string|number)} StringOrNumber2 */ @@ -138,14 +149,18 @@ mod4.js(11,12): error TS2304: Cannot find name 'StringOrNumber2'. } -==== mod7.js (0 errors) ==== +==== mod7.js (2 errors) ==== /** Multiline type expressions in comments without leading * are not supported. @typedef {{ foo: *, + ~ +!!! error TS1110: Type expected. bar: * }} Type7 + ~ +!!! error TS1110: Type expected. */ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumCrossFileExport.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumCrossFileExport.errors.txt.diff index aa131e44ee..8c877aa4f3 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumCrossFileExport.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumCrossFileExport.errors.txt.diff @@ -2,6 +2,7 @@ +++ new.jsEnumCrossFileExport.errors.txt @@= skipped -0, +0 lines =@@ - ++enumDef.js(14,21): error TS1003: Identifier expected. +enumDef.js(16,18): error TS2339: Property 'Blah' does not exist on type '{ Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }'. +index.js(4,17): error TS2503: Cannot find namespace 'Host'. +index.js(8,21): error TS2304: Cannot find name 'Host'. @@ -9,7 +10,7 @@ +index.js(18,11): error TS2503: Cannot find namespace 'Host'. + + -+==== enumDef.js (1 errors) ==== ++==== enumDef.js (2 errors) ==== + var Host = {}; + Host.UserMetrics = {}; + /** @enum {number} */ @@ -24,7 +25,10 @@ + */ + /** + * @typedef {string} ++ + */ ++ ++!!! error TS1003: Identifier expected. + Host.UserMetrics.Blah = { + ~~~~ +!!! error TS2339: Property 'Blah' does not exist on type '{ Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }'. diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsdocFunctionTypeFalsePositive.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsdocFunctionTypeFalsePositive.errors.txt.diff deleted file mode 100644 index 240506dd0b..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsdocFunctionTypeFalsePositive.errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.jsdocFunctionTypeFalsePositive.errors.txt -+++ new.jsdocFunctionTypeFalsePositive.errors.txt -@@= skipped -0, +0 lines =@@ - /a.js(1,13): error TS1098: Type parameter list cannot be empty. --/a.js(1,14): error TS1139: Type parameter declaration expected. -- -- --==== /a.js (2 errors) ==== -+ -+ -+==== /a.js (1 errors) ==== - /** @param {<} x */ - ~~ - !!! error TS1098: Type parameter list cannot be empty. -- ~ --!!! error TS1139: Type parameter declaration expected. - function f(x) {} - \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsdocParameterParsingInfiniteLoop.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsdocParameterParsingInfiniteLoop.errors.txt.diff index d1fab64b56..fbc195cf2e 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsdocParameterParsingInfiniteLoop.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsdocParameterParsingInfiniteLoop.errors.txt.diff @@ -8,9 +8,10 @@ - -==== example.js (3 errors) ==== +example.js(3,11): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++example.js(3,19): error TS1005: '}' expected. + + -+==== example.js (1 errors) ==== ++==== example.js (2 errors) ==== // @ts-check /** * @type {function(@foo)} @@ -23,5 +24,7 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. */ let x; \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/uniqueSymbolJs.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/uniqueSymbolJs.errors.txt.diff index e97c2ce80f..9372405a69 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/uniqueSymbolJs.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/uniqueSymbolJs.errors.txt.diff @@ -2,20 +2,23 @@ +++ new.uniqueSymbolJs.errors.txt @@= skipped -0, +0 lines =@@ -a.js(5,18): error TS1337: An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead. --a.js(5,28): error TS1005: ';' expected. +a.js(5,18): error TS1268: An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type. +a.js(5,23): error TS2749: 'foo' refers to a value, but is being used as a type here. Did you mean 'typeof foo'? + a.js(5,28): error TS1005: ';' expected. - ==== a.js (2 errors) ==== -@@= skipped -8, +8 lines =@@ +-==== a.js (2 errors) ==== ++==== a.js (3 errors) ==== + /** @type {unique symbol} */ + const foo = Symbol(); + /** @typedef {{ [foo]: boolean }} A */ /** @typedef {{ [key: foo] boolean }} B */ ~~~ -!!! error TS1337: An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead. -- ~~~~~~~ --!!! error TS1005: ';' expected. +!!! error TS1268: An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type. + ~~~ +!!! error TS2749: 'foo' refers to a value, but is being used as a type here. Did you mean 'typeof foo'? + ~~~~~~~ + !!! error TS1005: ';' expected. \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/asyncArrowFunction_allowJs.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/asyncArrowFunction_allowJs.errors.txt.diff index ec3ffa5a3a..49320a3a4a 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/asyncArrowFunction_allowJs.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/asyncArrowFunction_allowJs.errors.txt.diff @@ -13,18 +13,25 @@ - -==== file.js (7 errors) ==== +file.js(2,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++file.js(2,20): error TS1005: '}' expected. +file.js(6,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++file.js(6,20): error TS1005: '}' expected. +file.js(10,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++file.js(10,20): error TS1005: '}' expected. +file.js(16,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++file.js(16,20): error TS1005: '}' expected. +file.js(21,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++file.js(21,20): error TS1005: '}' expected. + + -+==== file.js (5 errors) ==== ++==== file.js (10 errors) ==== // Error (good) /** @type {function(): string} */ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. const a = () => 0 - ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. @@ -36,6 +43,8 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. const b = async () => 0 - ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. @@ -47,6 +56,8 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. const c = async () => { return 0 - ~~~~~~ @@ -60,6 +71,8 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. const d = async () => { return "" } @@ -68,6 +81,8 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. const f = (p) => {} // Error (good) diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocSatisfiesTag14.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocSatisfiesTag14.errors.txt.diff index 85c8c13099..5bf5bbfd0b 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocSatisfiesTag14.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocSatisfiesTag14.errors.txt.diff @@ -1,30 +1,29 @@ --- old.checkJsdocSatisfiesTag14.errors.txt +++ new.checkJsdocSatisfiesTag14.errors.txt @@= skipped -0, +0 lines =@@ --/a.js(7,15): error TS1005: '{' expected. + /a.js(7,15): error TS1005: '{' expected. -/a.js(8,2): error TS1005: '}' expected. --/a.js(10,27): error TS1005: '{' expected. + /a.js(10,27): error TS1005: '{' expected. -/a.js(10,30): error TS1005: '}' expected. - - -==== /a.js (4 errors) ==== -- /** -- * @typedef {Object} T1 -- * @property {number} a -- */ -- -- /** -- * @satisfies T1 -- ~~ --!!! error TS1005: '{' expected. -- */ ++ ++ ++==== /a.js (2 errors) ==== + /** + * @typedef {Object} T1 + * @property {number} a +@@= skipped -14, +12 lines =@@ + ~~ + !!! error TS1005: '{' expected. + */ - -!!! error TS1005: '}' expected. -- const t1 = { a: 1 }; -- const t2 = /** @satisfies T1 */ ({ a: 1 }); -- ~~ --!!! error TS1005: '{' expected. + const t1 = { a: 1 }; + const t2 = /** @satisfies T1 */ ({ a: 1 }); + ~~ + !!! error TS1005: '{' expected. - -!!! error TS1005: '}' expected. -- -+ \ No newline at end of file + \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypeTag1.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypeTag1.errors.txt.diff index 886d602488..684c5b6009 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypeTag1.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypeTag1.errors.txt.diff @@ -5,17 +5,29 @@ - - -==== 0.js (1 errors) ==== ++0.js(12,13): error TS1110: Type expected. +0.js(20,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +0.js(24,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++0.js(24,21): error TS1005: '}' expected. +0.js(28,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++0.js(28,21): error TS1005: '}' expected. +0.js(40,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'props' must be of type 'object', but here has type 'Object'. + + -+==== 0.js (4 errors) ==== ++==== 0.js (7 errors) ==== // @ts-check /** @type {String} */ var S = "hello world"; -@@= skipped -21, +24 lines =@@ +@@= skipped -13, +19 lines =@@ + anyT = "hello"; + + /** @type {?} */ ++ ~ ++!!! error TS1110: Type expected. + var anyT1 = 2; + anyT1 = "hi"; + +@@= skipped -8, +10 lines =@@ x(1); /** @type {function} */ @@ -31,6 +43,8 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. const x1 = (a) => a + 1; x1(0); @@ -38,10 +52,12 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. const x2 = (a) => a + 1; x2(0); -@@= skipped -22, +29 lines =@@ +@@= skipped -22, +33 lines =@@ * @type {Object} */ var props = {}; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypeTag2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypeTag2.errors.txt.diff index 6b72170b6d..6665582b86 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypeTag2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypeTag2.errors.txt.diff @@ -13,12 +13,16 @@ - -==== 0.js (7 errors) ==== +0.js(8,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++0.js(8,21): error TS1005: '}' expected. +0.js(12,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++0.js(12,21): error TS1005: '}' expected. +0.js(19,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++0.js(19,21): error TS1005: '}' expected. +0.js(23,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++0.js(23,21): error TS1005: '}' expected. + + -+==== 0.js (6 errors) ==== ++==== 0.js (10 errors) ==== // @ts-check /** @type {String} */ var S = true; @@ -28,7 +32,7 @@ /** @type {number} */ var n = "hello"; -@@= skipped -19, +18 lines =@@ +@@= skipped -19, +22 lines =@@ !!! error TS2322: Type 'string' is not assignable to type 'number'. /** @type {function (number)} */ @@ -37,6 +41,8 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. const x1 = (a) => a + 1; x1("string"); - ~~~~~~~~ @@ -46,6 +52,8 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. const x2 = (a) => a + 1; /** @type {string} */ @@ -58,6 +66,8 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. const x3 = (a) => a.concat("hi"); - ~~~~~~ -!!! error TS2339: Property 'concat' does not exist on type 'number'. @@ -67,6 +77,8 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. const x4 = (a) => a + 1; - ~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypeTagOnObjectProperty1.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypeTagOnObjectProperty1.errors.txt.diff index 4df7dcb221..763732c109 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypeTagOnObjectProperty1.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypeTagOnObjectProperty1.errors.txt.diff @@ -4,10 +4,12 @@ - +0.js(8,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +0.js(8,14): error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments. ++0.js(8,22): error TS1005: '}' expected. +0.js(16,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++0.js(16,22): error TS1005: '}' expected. + + -+==== 0.js (3 errors) ==== ++==== 0.js (5 errors) ==== + // @ts-check + var lol = "hello Lol" + const obj = { @@ -21,6 +23,8 @@ +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~~~~~~~~ +!!! error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments. ++ ~ ++!!! error TS1005: '}' expected. + method1(n1) { + return n1 + 42; + }, @@ -32,6 +36,8 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. + arrowFunc: (num) => num + 42 + } + obj.foo = 'string' diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypeTagOnObjectProperty2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypeTagOnObjectProperty2.errors.txt.diff index e6472b5cf2..65a1df20cd 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypeTagOnObjectProperty2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypeTagOnObjectProperty2.errors.txt.diff @@ -9,20 +9,17 @@ -0.js(19,5): error TS2322: Type 'number' is not assignable to type 'string'. -0.js(22,5): error TS2322: Type 'number' is not assignable to type 'string'. -0.js(22,22): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -- -- --==== 0.js (8 errors) ==== +0.js(6,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +0.js(6,14): error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments. ++0.js(6,22): error TS1005: '}' expected. +0.js(10,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++0.js(10,22): error TS1005: '}' expected. +0.js(12,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? -+ -+ -+==== 0.js (5 errors) ==== - // @ts-check - var lol; - const obj = { -@@= skipped -16, +13 lines =@@ ++0.js(12,22): error TS1005: '}' expected. + + + ==== 0.js (8 errors) ==== +@@= skipped -16, +16 lines =@@ ~~~~~~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. /** @type {function(number): number} */ @@ -31,6 +28,8 @@ +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~~~~~~~~ +!!! error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments. ++ ~ ++!!! error TS1005: '}' expected. method1(n1) { return "42"; - ~~~~~~ @@ -40,6 +39,8 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. method2: (n1) => "lol", - ~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. @@ -47,6 +48,8 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. arrowFunc: (num="0") => num + 42, - ~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypedefOnlySourceFile.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypedefOnlySourceFile.errors.txt.diff index cfb3d23d1b..60fa860711 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypedefOnlySourceFile.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/checkJsdocTypedefOnlySourceFile.errors.txt.diff @@ -6,11 +6,12 @@ - -==== 0.js (1 errors) ==== +0.js(3,5): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. ++0.js(6,21): error TS1003: Identifier expected. +0.js(8,9): error TS2339: Property 'SomeName' does not exist on type '{}'. +0.js(10,12): error TS2503: Cannot find namespace 'exports'. + + -+==== 0.js (3 errors) ==== ++==== 0.js (4 errors) ==== // @ts-check var exports = {}; @@ -19,7 +20,10 @@ /** * @typedef {string} ++ */ ++ ++!!! error TS1003: Identifier expected. exports.SomeName; + ~~~~~~~~ +!!! error TS2339: Property 'SomeName' does not exist on type '{}'. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/importDeferJsdoc.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/importDeferJsdoc.errors.txt.diff index 36ba74556a..07493724d2 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/importDeferJsdoc.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/importDeferJsdoc.errors.txt.diff @@ -1,17 +1,20 @@ --- old.importDeferJsdoc.errors.txt +++ new.importDeferJsdoc.errors.txt @@= skipped -0, +0 lines =@@ --/foo.js(2,18): error TS1005: 'from' expected. + /foo.js(2,18): error TS1005: 'from' expected. +/foo.js(2,18): error TS1141: String literal expected. /foo.js(6,12): error TS2503: Cannot find namespace 'ns'. -@@= skipped -7, +7 lines =@@ - ==== /foo.js (2 errors) ==== + ==== /types.ts (0 errors) ==== + export type X = 1; + +-==== /foo.js (2 errors) ==== ++==== /foo.js (3 errors) ==== /** * @import defer * as ns from "./types" -- ~ --!!! error TS1005: 'from' expected. + ~ + !!! error TS1005: 'from' expected. + ~~~~ +!!! error TS1141: String literal expected. */ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/importTag10.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/importTag10.errors.txt.diff deleted file mode 100644 index c90b25d031..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/importTag10.errors.txt.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- old.importTag10.errors.txt -+++ new.importTag10.errors.txt -@@= skipped -0, +0 lines =@@ --/foo.js(2,11): error TS1109: Expression expected. -- -- --==== /foo.js (1 errors) ==== -- /** -- * @import -- -- */ -- --!!! error TS1109: Expression expected. -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/importTag11.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/importTag11.errors.txt.diff index 1d60c189e9..545f442e45 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/importTag11.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/importTag11.errors.txt.diff @@ -2,16 +2,15 @@ +++ new.importTag11.errors.txt @@= skipped -0, +0 lines =@@ -/foo.js(2,15): error TS1109: Expression expected. --/foo.js(3,2): error TS1005: 'from' expected. -- -- + /foo.js(3,2): error TS1005: 'from' expected. + + -==== /foo.js (2 errors) ==== -- /** -- * @import foo ++==== /foo.js (1 errors) ==== + /** + * @import foo - -!!! error TS1109: Expression expected. -- */ -- --!!! error TS1005: 'from' expected. -- -+ \ No newline at end of file + */ + + !!! error TS1005: 'from' expected. \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/importTag12.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/importTag12.errors.txt.diff index 3bcbbcf079..afbde6e8d6 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/importTag12.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/importTag12.errors.txt.diff @@ -2,13 +2,15 @@ +++ new.importTag12.errors.txt @@= skipped -0, +0 lines =@@ -/foo.js(2,20): error TS1109: Expression expected. -- -- --==== /foo.js (1 errors) ==== -- /** -- * @import foo from ++/foo.js(3,2): error TS1109: Expression expected. + + + ==== /foo.js (1 errors) ==== + /** + * @import foo from - -!!! error TS1109: Expression expected. -- */ -- -+ \ No newline at end of file + */ ++ ++!!! error TS1109: Expression expected. + \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/importTag13.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/importTag13.errors.txt.diff index a55a49f933..55cd457a99 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/importTag13.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/importTag13.errors.txt.diff @@ -1,14 +1,17 @@ --- old.importTag13.errors.txt +++ new.importTag13.errors.txt @@= skipped -0, +0 lines =@@ --/foo.js(1,15): error TS1005: 'from' expected. + /foo.js(1,15): error TS1005: 'from' expected. +- +- +-==== /foo.js (1 errors) ==== +/foo.js(1,15): error TS1141: String literal expected. - - - ==== /foo.js (1 errors) ==== ++ ++ ++==== /foo.js (2 errors) ==== /** @import x = require("types") */ -- ~ --!!! error TS1005: 'from' expected. + ~ + !!! error TS1005: 'from' expected. + ~~~~~~~~~~~~~~~~~~ +!!! error TS1141: String literal expected. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/importTag14.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/importTag14.errors.txt.diff index 06e93a4fb5..7f62149103 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/importTag14.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/importTag14.errors.txt.diff @@ -4,17 +4,14 @@ +/foo.js(1,25): error TS2306: File '/foo.js' is not a module. /foo.js(1,33): error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. /foo.js(1,33): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. --/foo.js(1,38): error TS1005: '{' expected. + /foo.js(1,38): error TS1005: '{' expected. - ==== /foo.js (3 errors) ==== +-==== /foo.js (3 errors) ==== ++==== /foo.js (4 errors) ==== /** @import * as f from "./foo" with */ + ~~~~~~~ +!!! error TS2306: File '/foo.js' is not a module. ~~~~ !!! error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. - ~~~~ - !!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. -- --!!! error TS1005: '{' expected. - \ No newline at end of file + ~~~~ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsModuleReferenceHasEmit.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsModuleReferenceHasEmit.errors.txt.diff index 6344763693..44818fe741 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsModuleReferenceHasEmit.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsModuleReferenceHasEmit.errors.txt.diff @@ -3,9 +3,10 @@ @@= skipped -0, +0 lines =@@ - +index.js(9,11): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++index.js(9,17): error TS1005: '}' expected. + + -+==== index.js (1 errors) ==== ++==== index.js (2 errors) ==== + /** + * @module A + */ @@ -17,6 +18,8 @@ + * @type {module:A} + ~~~~~~ +!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~ ++!!! error TS1005: '}' expected. + */ + export let el = null; + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsRestArgsWithThisTypeInJSDocFunction.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsRestArgsWithThisTypeInJSDocFunction.errors.txt.diff new file mode 100644 index 0000000000..77f79eb7c4 --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsRestArgsWithThisTypeInJSDocFunction.errors.txt.diff @@ -0,0 +1,17 @@ +--- old.jsDeclarationsRestArgsWithThisTypeInJSDocFunction.errors.txt ++++ new.jsDeclarationsRestArgsWithThisTypeInJSDocFunction.errors.txt +@@= skipped -0, +0 lines =@@ +- ++bug38550.js(3,22): error TS1005: '}' expected. ++ ++ ++==== bug38550.js (1 errors) ==== ++ export class Clazz { ++ /** ++ * @param {function(this:Object, ...*):*} functionDeclaration ++ ~ ++!!! error TS1005: '}' expected. ++ */ ++ method(functionDeclaration) {} ++ } ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReusesExistingNodesMappingJSDocTypes.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReusesExistingNodesMappingJSDocTypes.errors.txt.diff index 23875f11d5..b84e9f3807 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReusesExistingNodesMappingJSDocTypes.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReusesExistingNodesMappingJSDocTypes.errors.txt.diff @@ -2,13 +2,18 @@ +++ new.jsDeclarationsReusesExistingNodesMappingJSDocTypes.errors.txt @@= skipped -0, +0 lines =@@ - ++index.js(1,13): error TS1110: Type expected. +index.js(16,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++index.js(16,20): error TS1005: '}' expected. +index.js(19,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++index.js(19,20): error TS1005: '}' expected. +index.js(22,12): error TS2315: Type 'Object' is not generic. + + -+==== index.js (3 errors) ==== ++==== index.js (6 errors) ==== + /** @type {?} */ ++ ~ ++!!! error TS1110: Type expected. + export const a = null; + + /** @type {*} */ @@ -27,12 +32,16 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. + export const f = null; + + /** @type {function(new: object, string, number)} */ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. + export const g = null; + + /** @type {Object.} */ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocAugmentsMissingType.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocAugmentsMissingType.errors.txt.diff index 0d8dfe2f9e..bc605dfad5 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocAugmentsMissingType.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocAugmentsMissingType.errors.txt.diff @@ -7,15 +7,18 @@ - - -==== /a.js (3 errors) ==== ++/a.js(2,14): error TS1003: Identifier expected. + + -+==== /a.js (1 errors) ==== ++==== /a.js (2 errors) ==== class A { constructor() { this.x = 0; } } /** @augments */ -!!! error TS1003: Identifier expected. - !!! error TS8023: JSDoc '@augments ' does not match the 'extends A' clause. ++ ~ ++!!! error TS1003: Identifier expected. class B extends A { m() { this.x diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocFunctionType.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocFunctionType.errors.txt.diff index 899510ffa9..aa905126e8 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocFunctionType.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocFunctionType.errors.txt.diff @@ -6,25 +6,35 @@ - - -==== functions.js (1 errors) ==== ++functions.js(2,20): error TS1005: '}' expected. +functions.js(3,13): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++functions.js(3,21): error TS1005: '}' expected. +functions.js(5,14): error TS7006: Parameter 'c' implicitly has an 'any' type. +functions.js(9,23): error TS7006: Parameter 'n' implicitly has an 'any' type. ++functions.js(12,20): error TS1005: '}' expected. +functions.js(13,13): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++functions.js(13,21): error TS1005: '}' expected. +functions.js(15,14): error TS7006: Parameter 'c' implicitly has an 'any' type. +functions.js(30,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++functions.js(30,21): error TS1005: '}' expected. +functions.js(31,19): error TS7006: Parameter 'ab' implicitly has an 'any' type. +functions.js(31,23): error TS7006: Parameter 'onetwo' implicitly has an 'any' type. ++functions.js(48,20): error TS1005: '}' expected. +functions.js(49,13): error TS2749: 'D' refers to a value, but is being used as a type here. Did you mean 'typeof D'? +functions.js(51,26): error TS7006: Parameter 'dref' implicitly has an 'any' type. + + -+==== functions.js (10 errors) ==== ++==== functions.js (16 errors) ==== /** * @param {function(this: string, number): number} c is just passing on through ++ ~ ++!!! error TS1005: '}' expected. * @return {function(this: string, number): number} + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. */ function id1(c) { + ~ @@ -38,10 +48,14 @@ /** * @param {function(new: { length: number }, number): number} c is just passing on through ++ ~ ++!!! error TS1005: '}' expected. * @return {function(new: { length: number }, number): number} + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. */ function id2(c) { + ~ @@ -49,13 +63,15 @@ return c } -@@= skipped -32, +52 lines =@@ +@@= skipped -32, +66 lines =@@ z.length; /** @type {function ("a" | "b", 1 | 2): 3 | 4} */ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. var f = function (ab, onetwo) { return ab === "a" ? 3 : 4; } + ~~ +!!! error TS7006: Parameter 'ab' implicitly has an 'any' type. @@ -64,9 +80,12 @@ /** -@@= skipped -19, +26 lines =@@ +@@= skipped -18, +27 lines =@@ + /** * @param {function(new: D, number)} dref ++ ~ ++!!! error TS1005: '}' expected. * @return {D} + ~ +!!! error TS2749: 'D' refers to a value, but is being used as a type here. Did you mean 'typeof D'? @@ -77,7 +96,7 @@ var z3 = construct(D); z3.length; -@@= skipped -16, +20 lines =@@ +@@= skipped -17, +23 lines =@@ var y3 = id2(E); diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocFunction_missingReturn.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocFunction_missingReturn.errors.txt.diff index 2a4513ad36..4f926c210b 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocFunction_missingReturn.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocFunction_missingReturn.errors.txt.diff @@ -7,9 +7,10 @@ -==== /a.js (1 errors) ==== +/a.js(1,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +/a.js(1,12): error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments. ++/a.js(1,20): error TS1005: '}' expected. + + -+==== /a.js (2 errors) ==== ++==== /a.js (3 errors) ==== /** @type {function(): number} */ - ~~~~~~ -!!! error TS2355: A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value. @@ -18,5 +19,7 @@ +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~~~~~~~~ +!!! error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments. ++ ~ ++!!! error TS1005: '}' expected. function f() {} \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImplements_missingType.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImplements_missingType.errors.txt.diff index 7a27f9d761..9ba145f7a0 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImplements_missingType.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImplements_missingType.errors.txt.diff @@ -1,15 +1,11 @@ --- old.jsdocImplements_missingType.errors.txt +++ new.jsdocImplements_missingType.errors.txt -@@= skipped -0, +0 lines =@@ --/a.js(2,16): error TS1003: Identifier expected. -- -- --==== /a.js (1 errors) ==== -- class A { constructor() { this.x = 0; } } -- /** @implements */ +@@= skipped -3, +3 lines =@@ + ==== /a.js (1 errors) ==== + class A { constructor() { this.x = 0; } } + /** @implements */ - --!!! error TS1003: Identifier expected. -- class B { -- } -- -+ \ No newline at end of file ++ ~ + !!! error TS1003: Identifier expected. + class B { + } \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocOuterTypeParameters1.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocOuterTypeParameters1.errors.txt.diff index 241ccbd587..3469144058 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocOuterTypeParameters1.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocOuterTypeParameters1.errors.txt.diff @@ -5,14 +5,14 @@ Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. jsdocOuterTypeParameters1.js(1,14): error TS2304: Cannot find name 'T'. -jsdocOuterTypeParameters1.js(4,17): error TS2304: Cannot find name 'T'. --jsdocOuterTypeParameters1.js(4,19): error TS1069: Unexpected token. A type parameter name was expected without curly braces. + jsdocOuterTypeParameters1.js(4,19): error TS1069: Unexpected token. A type parameter name was expected without curly braces. jsdocOuterTypeParameters1.js(7,35): error TS2339: Property 'foo' does not exist on type 'Bar'. !!! error TS5055: Cannot write file 'jsdocOuterTypeParameters1.js' because it would overwrite input file. !!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. -==== jsdocOuterTypeParameters1.js (4 errors) ==== -+==== jsdocOuterTypeParameters1.js (2 errors) ==== ++==== jsdocOuterTypeParameters1.js (3 errors) ==== /** @return {T} */ ~ !!! error TS2304: Cannot find name 'T'. @@ -21,8 +21,6 @@ /** @template {T} */ - ~ -!!! error TS2304: Cannot find name 'T'. -- ~ --!!! error TS1069: Unexpected token. A type parameter name was expected without curly braces. - const PropertyAccessors = dedupingMixin(() => { - class Bar { - static bar() { this.prototype.foo(); } \ No newline at end of file + ~ + !!! error TS1069: Unexpected token. A type parameter name was expected without curly braces. + const PropertyAccessors = dedupingMixin(() => { \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocOuterTypeParameters3.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocOuterTypeParameters3.errors.txt.diff index 4622725904..7832110098 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocOuterTypeParameters3.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocOuterTypeParameters3.errors.txt.diff @@ -4,19 +4,17 @@ error TS5055: Cannot write file 'jsdocOuterTypeParameters3.js' because it would overwrite input file. Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. -jsdocOuterTypeParameters3.js(1,16): error TS2304: Cannot find name 'T'. --jsdocOuterTypeParameters3.js(1,18): error TS1069: Unexpected token. A type parameter name was expected without curly braces. + jsdocOuterTypeParameters3.js(1,18): error TS1069: Unexpected token. A type parameter name was expected without curly braces. jsdocOuterTypeParameters3.js(5,43): error TS2339: Property 'foo' does not exist on type 'Bar'. !!! error TS5055: Cannot write file 'jsdocOuterTypeParameters3.js' because it would overwrite input file. !!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. -==== jsdocOuterTypeParameters3.js (3 errors) ==== -+==== jsdocOuterTypeParameters3.js (1 errors) ==== ++==== jsdocOuterTypeParameters3.js (2 errors) ==== /** @template {T} */ - ~ -!!! error TS2304: Cannot find name 'T'. -- ~ --!!! error TS1069: Unexpected token. A type parameter name was expected without curly braces. - class Baz { - m() { - class Bar { \ No newline at end of file + ~ + !!! error TS1069: Unexpected token. A type parameter name was expected without curly braces. + class Baz { \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocParseDotDotDotInJSDocFunction.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocParseDotDotDotInJSDocFunction.errors.txt.diff index 0bed525624..2f955bae63 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocParseDotDotDotInJSDocFunction.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocParseDotDotDotInJSDocFunction.errors.txt.diff @@ -5,15 +5,19 @@ - - -==== a.js (1 errors) ==== ++a.js(2,21): error TS1005: '}' expected. +a.js(3,12): error TS7006: Parameter 'callback' implicitly has an 'any' type. +a.js(8,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++a.js(8,20): error TS1005: '}' expected. + + -+==== a.js (2 errors) ==== ++==== a.js (4 errors) ==== // from bcryptjs /** @param {function(...[*])} callback */ - ~~~~~~~~~~~~~~~~ -!!! error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. ++ ~ ++!!! error TS1005: '}' expected. function g(callback) { + ~~~~~~~~ +!!! error TS7006: Parameter 'callback' implicitly has an 'any' type. @@ -25,6 +29,8 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. * @inner */ var stringFromCharCode = String.fromCharCode; \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocParseHigherOrderFunction.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocParseHigherOrderFunction.errors.txt.diff index 0b43e0d1a6..4017c73d0a 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocParseHigherOrderFunction.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocParseHigherOrderFunction.errors.txt.diff @@ -3,15 +3,18 @@ @@= skipped -0, +0 lines =@@ - +paren.js(1,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++paren.js(1,20): error TS1005: '}' expected. +paren.js(2,10): error TS7006: Parameter 's' implicitly has an 'any' type. +paren.js(2,13): error TS7006: Parameter 'id' implicitly has an 'any' type. + + -+==== paren.js (3 errors) ==== ++==== paren.js (4 errors) ==== + /** @type {function((string), function((string)): string): string} */ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. + var x = (s, id) => id(s) + ~ +!!! error TS7006: Parameter 's' implicitly has an 'any' type. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocParseParenthesizedJSDocParameter.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocParseParenthesizedJSDocParameter.errors.txt.diff index a6dd8192ea..51c92a19c6 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocParseParenthesizedJSDocParameter.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocParseParenthesizedJSDocParameter.errors.txt.diff @@ -3,14 +3,17 @@ @@= skipped -0, +0 lines =@@ - +paren.js(1,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++paren.js(1,20): error TS1005: '}' expected. +paren.js(2,9): error TS7006: Parameter 's' implicitly has an 'any' type. + + -+==== paren.js (2 errors) ==== ++==== paren.js (3 errors) ==== + /** @type {function((string)): string} */ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. + var x = s => s.toString() + ~ +!!! error TS7006: Parameter 's' implicitly has an 'any' type. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocParseStarEquals.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocParseStarEquals.errors.txt.diff index 76fc71ede2..8f3df4dfb4 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocParseStarEquals.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocParseStarEquals.errors.txt.diff @@ -4,10 +4,11 @@ - +a.js(1,5): error TS1047: A rest parameter cannot be optional. +a.js(3,12): error TS2370: A rest parameter must be of an array type. ++a.js(11,21): error TS1005: '}' expected. +a.js(12,14): error TS7006: Parameter 'f' implicitly has an 'any' type. + + -+==== a.js (3 errors) ==== ++==== a.js (4 errors) ==== + /** @param {...*=} args + ~~~~~~~~~~~~~~~~~~~ + @return {*=} */ @@ -24,6 +25,8 @@ + + + /** @param {function():*=} f */ ++ ~ ++!!! error TS1005: '}' expected. + function cbf(f) { + ~ +!!! error TS7006: Parameter 'f' implicitly has an 'any' type. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocPrefixPostfixParsing.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocPrefixPostfixParsing.errors.txt.diff index cd4ecc1839..309d3d89d4 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocPrefixPostfixParsing.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocPrefixPostfixParsing.errors.txt.diff @@ -2,23 +2,23 @@ +++ new.jsdocPrefixPostfixParsing.errors.txt @@= skipped -0, +0 lines =@@ -prefixPostfix.js(5,18): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. --prefixPostfix.js(5,18): error TS1005: '}' expected. + prefixPostfix.js(5,18): error TS1005: '}' expected. -prefixPostfix.js(8,12): error TS1014: A rest parameter must be last in a parameter list. -prefixPostfix.js(9,12): error TS1014: A rest parameter must be last in a parameter list. -prefixPostfix.js(10,12): error TS1014: A rest parameter must be last in a parameter list. -prefixPostfix.js(11,21): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. --prefixPostfix.js(11,21): error TS1005: '}' expected. + prefixPostfix.js(11,21): error TS1005: '}' expected. -prefixPostfix.js(12,12): error TS1014: A rest parameter must be last in a parameter list. -prefixPostfix.js(13,12): error TS1014: A rest parameter must be last in a parameter list. -prefixPostfix.js(14,21): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. --prefixPostfix.js(14,21): error TS1005: '}' expected. + prefixPostfix.js(14,21): error TS1005: '}' expected. prefixPostfix.js(18,21): error TS7006: Parameter 'a' implicitly has an 'any' type. prefixPostfix.js(18,39): error TS7006: Parameter 'h' implicitly has an 'any' type. prefixPostfix.js(18,48): error TS7006: Parameter 'k' implicitly has an 'any' type. -==== prefixPostfix.js (14 errors) ==== -+==== prefixPostfix.js (3 errors) ==== ++==== prefixPostfix.js (6 errors) ==== /** * @param {number![]} x - number[] * @param {!number[]} y - number[] @@ -26,8 +26,8 @@ * @param {number?[]} a - parse error without parentheses - -!!! error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. -- ~ --!!! error TS1005: '}' expected. + ~ + !!! error TS1005: '}' expected. * @param {?number[]} b - number[] | null * @param {(number[])?} c - number[] | null * @param {...?number} e - (number | null)[] @@ -42,8 +42,8 @@ * @param {...number?!} h - parse error without parentheses (also nonsensical) - -!!! error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. -- ~ --!!! error TS1005: '}' expected. + ~ + !!! error TS1005: '}' expected. * @param {...number[]} i - number[][] - ~~~~~~~~~~~ -!!! error TS1014: A rest parameter must be last in a parameter list. @@ -53,8 +53,6 @@ * @param {...number?[]!} k - parse error without parentheses - -!!! error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. -- ~ --!!! error TS1005: '}' expected. - * @param {number extends number ? true : false} l - conditional types work - * @param {[number, number?]} m - [number, (number | undefined)?] - */ \ No newline at end of file + ~ + !!! error TS1005: '}' expected. + * @param {number extends number ? true : false} l - conditional types work \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocPrivateName2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocPrivateName2.errors.txt.diff index 01d7e10957..feb3c736b8 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocPrivateName2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocPrivateName2.errors.txt.diff @@ -1,18 +1,11 @@ --- old.jsdocPrivateName2.errors.txt +++ new.jsdocPrivateName2.errors.txt -@@= skipped -0, +0 lines =@@ --jsdocPrivateName1.js(6,23): error TS1003: Identifier expected. -- -- --==== jsdocPrivateName1.js (1 errors) ==== -- // Expecting parse error for private field -- -- /** -- * @typedef A -- * @type {object} -- * @property {string} #id +@@= skipped -7, +7 lines =@@ + * @typedef A + * @type {object} + * @property {string} #id - --!!! error TS1003: Identifier expected. -- */ -- -+ \ No newline at end of file ++ ~ + !!! error TS1003: Identifier expected. + */ + \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag.errors.txt.diff index 716047469c..bd9d4ecccb 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag.errors.txt.diff @@ -3,26 +3,29 @@ @@= skipped -0, +0 lines =@@ -forgot.js(23,1): error TS2322: Type '(keyframes: any[]) => void' is not assignable to type '(keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions) => Animation'. +forgot.js(13,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++forgot.js(13,22): error TS1005: '}' expected. +forgot.js(23,1): error TS2322: Type '(keyframes: Keyframe[] | PropertyIndexedKeyframes) => void' is not assignable to type '(keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions) => Animation'. Type 'void' is not assignable to type 'Animation'. -==== forgot.js (1 errors) ==== -+==== forgot.js (2 errors) ==== ++==== forgot.js (3 errors) ==== /** * @param {T} a * @template T -@@= skipped -15, +16 lines =@@ +@@= skipped -15, +17 lines =@@ * @param {T} a * @template T * @returns {function(): T} + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. */ function g(a) { return () => a -@@= skipped -11, +14 lines =@@ +@@= skipped -11, +16 lines =@@ */ Element.prototype.animate = function(keyframes) {}; ~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag3.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag3.errors.txt.diff index a30dd9f14c..d7bb83cb38 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag3.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag3.errors.txt.diff @@ -6,18 +6,16 @@ -a.js(21,3): error TS2345: Argument of type '{ a: number; }' is not assignable to parameter of type '{ a: number; b: string; }'. - Property 'b' is missing in type '{ a: number; }' but required in type '{ a: number; b: string; }'. -a.js(24,15): error TS2304: Cannot find name 'NoLongerAllowed'. --a.js(25,2): error TS1069: Unexpected token. A type parameter name was expected without curly braces. -- -- --==== a.js (5 errors) ==== +a.js(21,3): error TS2741: Property 'b' is missing in type '{ a: number; }' but required in type '{ a: number; b: string; }'. -+ -+ -+==== a.js (3 errors) ==== + a.js(25,2): error TS1069: Unexpected token. A type parameter name was expected without curly braces. + + +-==== a.js (5 errors) ==== ++==== a.js (4 errors) ==== /** * @template {{ a: number, b: string }} T,U A Comment * @template {{ c: boolean }} V uh ... are comments even supported?? -@@= skipped -32, +29 lines =@@ +@@= skipped -32, +30 lines =@@ f({ a: 12, b: 'hi', c: null }, undefined, { c: false, d: 12, b: undefined }, 101, 'nope'); f({ a: 12 }, undefined, undefined, 101, 'nope'); ~~~~~~~~~~ @@ -31,8 +29,5 @@ - ~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'NoLongerAllowed'. * @template T preceding line's syntax is no longer allowed -- ~ --!!! error TS1069: Unexpected token. A type parameter name was expected without curly braces. - * @param {T} x - */ - function g(x) { } \ No newline at end of file + ~ + !!! error TS1069: Unexpected token. A type parameter name was expected without curly braces. \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTagDefault.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTagDefault.errors.txt.diff deleted file mode 100644 index 31ea3f1da6..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTagDefault.errors.txt.diff +++ /dev/null @@ -1,33 +0,0 @@ ---- old.jsdocTemplateTagDefault.errors.txt -+++ new.jsdocTemplateTagDefault.errors.txt -@@= skipped -0, +0 lines =@@ - file.js(9,20): error TS2322: Type 'number' is not assignable to type 'string'. --file.js(22,34): error TS1005: '=' expected. --file.js(27,35): error TS1110: Type expected. - file.js(33,14): error TS2706: Required type parameters may not follow optional type parameters. - file.js(38,17): error TS2744: Type parameter defaults can only reference previously declared type parameters. - file.js(53,14): error TS2706: Required type parameters may not follow optional type parameters. - file.js(60,17): error TS2744: Type parameter defaults can only reference previously declared type parameters. - - --==== file.js (7 errors) ==== -+==== file.js (5 errors) ==== - /** - * @template {string | number} [T=string] - ok: defaults are permitted - * @typedef {[T]} A -@@= skipped -31, +29 lines =@@ - - /** - * @template {string | number} [T] - error: default requires an `=type` -- ~ --!!! error TS1005: '=' expected. - * @typedef {[T]} C - */ - - /** - * @template {string | number} [T=] - error: default requires a `type` -- ~ --!!! error TS1110: Type expected. - * @typedef {[T]} D - */ - \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocThisType.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocThisType.errors.txt.diff index 9c0639589d..2543da1a5c 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocThisType.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocThisType.errors.txt.diff @@ -7,17 +7,19 @@ -/a.js(23,10): error TS2339: Property 'test' does not exist on type 'Foo'. -/a.js(28,10): error TS2339: Property 'test' does not exist on type 'Foo'. +/a.js(21,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++/a.js(21,20): error TS1005: '}' expected. +/a.js(26,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? +/a.js(26,12): error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments. ++/a.js(26,20): error TS1005: '}' expected. ==== /types.d.ts (0 errors) ==== -@@= skipped -11, +12 lines =@@ +@@= skipped -11, +14 lines =@@ export type M = (this: Foo) => void; -==== /a.js (6 errors) ==== -+==== /a.js (7 errors) ==== ++==== /a.js (9 errors) ==== /** @type {import('./types').M} */ export const f1 = function() { this.test(); @@ -28,6 +30,8 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. export const f5 = function() { this.test(); - ~~~~ @@ -40,6 +44,8 @@ +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. + ~~~~~~~~ +!!! error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments. ++ ~ ++!!! error TS1005: '}' expected. export function f6() { this.test(); - ~~~~ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeTagParameterType.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeTagParameterType.errors.txt.diff index d787b3e33e..5af503e217 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeTagParameterType.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeTagParameterType.errors.txt.diff @@ -3,16 +3,19 @@ @@= skipped -0, +0 lines =@@ -a.js(3,5): error TS2322: Type 'number' is not assignable to type 'string'. +a.js(1,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++a.js(1,20): error TS1005: '}' expected. +a.js(2,12): error TS7006: Parameter 'value' implicitly has an 'any' type. a.js(7,5): error TS2322: Type 'number' is not assignable to type 'string'. -==== a.js (2 errors) ==== -+==== a.js (3 errors) ==== ++==== a.js (4 errors) ==== /** @type {function(string): void} */ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. const f = (value) => { + ~~~~~ +!!! error TS7006: Parameter 'value' implicitly has an 'any' type. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeTagRequiredParameters.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeTagRequiredParameters.errors.txt.diff index 75b452f94e..efc34c532f 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeTagRequiredParameters.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeTagRequiredParameters.errors.txt.diff @@ -3,24 +3,27 @@ @@= skipped -0, +0 lines =@@ -a.js(11,1): error TS2554: Expected 1 arguments, but got 0. +a.js(1,12): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++a.js(1,20): error TS1005: '}' expected. +a.js(2,12): error TS7006: Parameter 'value' implicitly has an 'any' type. a.js(12,1): error TS2554: Expected 1 arguments, but got 0. a.js(13,1): error TS2554: Expected 1 arguments, but got 0. -==== a.js (3 errors) ==== -+==== a.js (4 errors) ==== ++==== a.js (5 errors) ==== /** @type {function(string): void} */ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. const f = (value) => { + ~~~~~ +!!! error TS7006: Parameter 'value' implicitly has an 'any' type. }; /** @type {(s: string) => void} */ function g(s) { -@@= skipped -14, +20 lines =@@ +@@= skipped -14, +23 lines =@@ } f() // should error diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocVariadicType.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocVariadicType.errors.txt.diff index a79f41e4ea..6ce480620b 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocVariadicType.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocVariadicType.errors.txt.diff @@ -3,14 +3,17 @@ @@= skipped -0, +0 lines =@@ - +a.js(2,11): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++a.js(2,19): error TS1005: '}' expected. + + -+==== a.js (1 errors) ==== ++==== a.js (2 errors) ==== + /** + * @type {function(boolean, string, ...*):void} + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. + */ + const foo = function (a, b, ...r) { }; + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/noAssertForUnparseableTypedefs.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/noAssertForUnparseableTypedefs.errors.txt.diff index 5e9e331de6..b9fb76f3f4 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/noAssertForUnparseableTypedefs.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/noAssertForUnparseableTypedefs.errors.txt.diff @@ -2,14 +2,17 @@ +++ new.noAssertForUnparseableTypedefs.errors.txt @@= skipped -0, +0 lines =@@ +bug26693.js(1,15): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++bug26693.js(1,21): error TS1005: '}' expected. bug26693.js(2,22): error TS2307: Cannot find module 'nope' or its corresponding type declarations. -==== bug26693.js (1 errors) ==== -+==== bug26693.js (2 errors) ==== ++==== bug26693.js (3 errors) ==== /** @typedef {module:locale} hi */ + ~~~~~~ +!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~ ++!!! error TS1005: '}' expected. import { nope } from 'nope'; ~~~~~~ !!! error TS2307: Cannot find module 'nope' or its corresponding type declarations. \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/paramTagWrapping.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/paramTagWrapping.errors.txt.diff index c7b1b74daa..0e7b04a15c 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/paramTagWrapping.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/paramTagWrapping.errors.txt.diff @@ -1,34 +1,37 @@ --- old.paramTagWrapping.errors.txt +++ new.paramTagWrapping.errors.txt @@= skipped -0, +0 lines =@@ --bad.js(2,11): error TS1003: Identifier expected. --bad.js(5,4): error TS1003: Identifier expected. + bad.js(2,11): error TS1003: Identifier expected. + bad.js(5,4): error TS1003: Identifier expected. -bad.js(5,4): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. --bad.js(6,20): error TS1003: Identifier expected. + bad.js(6,20): error TS1003: Identifier expected. -bad.js(6,20): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. bad.js(9,14): error TS7006: Parameter 'x' implicitly has an 'any' type. bad.js(9,17): error TS7006: Parameter 'y' implicitly has an 'any' type. bad.js(9,20): error TS7006: Parameter 'z' implicitly has an 'any' type. -@@= skipped -22, +17 lines =@@ +@@= skipped -22, +20 lines =@@ good(1, 2, 3) -==== bad.js (8 errors) ==== -+==== bad.js (3 errors) ==== ++==== bad.js (6 errors) ==== /** * @param * - --!!! error TS1003: Identifier expected. ++ ~ + !!! error TS1003: Identifier expected. * {number} x Arg x. * @param {number} * * y Arg y. - --!!! error TS1003: Identifier expected. ++ ~ + !!! error TS1003: Identifier expected. - -!!! error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. * @param {number} * z - --!!! error TS1003: Identifier expected. ++ ~ + !!! error TS1003: Identifier expected. - -!!! error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. * Arg z. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/templateInsideCallback.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/templateInsideCallback.errors.txt.diff index 2164c25069..c8db475455 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/templateInsideCallback.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/templateInsideCallback.errors.txt.diff @@ -3,16 +3,18 @@ @@= skipped -0, +0 lines =@@ -error TS-1: Pre-emit (11) and post-emit (13) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! -templateInsideCallback.js(2,13): error TS8021: JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags. --templateInsideCallback.js(9,5): error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag + templateInsideCallback.js(9,5): error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag -templateInsideCallback.js(10,12): error TS2304: Cannot find name 'T'. templateInsideCallback.js(15,11): error TS2315: Type 'Call' is not generic. +templateInsideCallback.js(15,16): error TS2304: Cannot find name 'T'. templateInsideCallback.js(17,18): error TS7006: Parameter 'x' implicitly has an 'any' type. --templateInsideCallback.js(23,5): error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag --templateInsideCallback.js(30,5): error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag + templateInsideCallback.js(23,5): error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag ++templateInsideCallback.js(29,5): error TS7012: This overload implicitly returns the type 'any' because it lacks a return type annotation. + templateInsideCallback.js(30,5): error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag -templateInsideCallback.js(32,12): error TS2304: Cannot find name 'T'. -templateInsideCallback.js(33,16): error TS2304: Cannot find name 'T'. --templateInsideCallback.js(38,5): error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag ++templateInsideCallback.js(37,5): error TS7012: This overload implicitly returns the type 'any' because it lacks a return type annotation. + templateInsideCallback.js(38,5): error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag -templateInsideCallback.js(39,12): error TS2304: Cannot find name 'T'. - - @@ -21,11 +23,9 @@ -!!! related TS7012 templateInsideCallback.js:29:5: This overload implicitly returns the type 'any' because it lacks a return type annotation. -!!! related TS7012 templateInsideCallback.js:37:5: This overload implicitly returns the type 'any' because it lacks a return type annotation. -==== templateInsideCallback.js (11 errors) ==== -+templateInsideCallback.js(29,5): error TS7012: This overload implicitly returns the type 'any' because it lacks a return type annotation. -+templateInsideCallback.js(37,5): error TS7012: This overload implicitly returns the type 'any' because it lacks a return type annotation. + + -+==== templateInsideCallback.js (5 errors) ==== ++==== templateInsideCallback.js (9 errors) ==== /** * @typedef Oops - ~~~~ @@ -33,19 +33,16 @@ * @template T * @property {T} a * @property {T} b -@@= skipped -27, +14 lines =@@ - /** - * @callback Call - * @template T -- ~~~~~~~~ --!!! error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag +@@= skipped -30, +21 lines =@@ + ~~~~~~~~ + !!! error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag * @param {T} x - ~ -!!! error TS2304: Cannot find name 'T'. * @returns {T} */ /** -@@= skipped -12, +8 lines =@@ +@@= skipped -9, +7 lines =@@ * @type {Call} ~~~~~~~ !!! error TS2315: Type 'Call' is not generic. @@ -54,23 +51,15 @@ */ const identity = x => x; ~ -@@= skipped -10, +12 lines =@@ - * @property {Object} oh - * @property {number} oh.no - * @template T -- ~~~~~~~~ --!!! error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag - * @property {string} oh.noooooo - */ - +@@= skipped -18, +20 lines =@@ /** * @overload -- * @template T - ~~~~~~~~ --!!! error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag ++ ~~~~~~~~ +!!! error TS7012: This overload implicitly returns the type 'any' because it lacks a return type annotation. -+ * @template T + * @template T + ~~~~~~~~ + !!! error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag * @template U * @param {T[]} array - ~ @@ -82,11 +71,11 @@ */ /** * @overload -- * @template T - ~~~~~~~~ --!!! error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag ++ ~~~~~~~~ +!!! error TS7012: This overload implicitly returns the type 'any' because it lacks a return type annotation. -+ * @template T + * @template T + ~~~~~~~~ + !!! error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag * @param {T[][]} array - ~ -!!! error TS2304: Cannot find name 'T'. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typedefDuplicateTypeDeclaration.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typedefDuplicateTypeDeclaration.errors.txt.diff deleted file mode 100644 index eb4c54bdd8..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typedefDuplicateTypeDeclaration.errors.txt.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.typedefDuplicateTypeDeclaration.errors.txt -+++ new.typedefDuplicateTypeDeclaration.errors.txt -@@= skipped -0, +0 lines =@@ --typedefDuplicateTypeDeclaration.js(4,16): error TS8033: A JSDoc '@typedef' comment may not contain multiple '@type' tags. -- -- --==== typedefDuplicateTypeDeclaration.js (1 errors) ==== -- /** -- * @typedef Name -- * @type {string} -- * @type {Oops} -- -- */ -- --!!! error TS8033: A JSDoc '@typedef' comment may not contain multiple '@type' tags. --!!! related TS8034 typedefDuplicateTypeDeclaration.js:1:1: The tag was first specified here. -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typedefInnerNamepaths.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typedefInnerNamepaths.errors.txt.diff index 0cbf38e973..668a3e4dd1 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typedefInnerNamepaths.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typedefInnerNamepaths.errors.txt.diff @@ -2,31 +2,28 @@ +++ new.typedefInnerNamepaths.errors.txt @@= skipped -0, +0 lines =@@ -bug25104.js(1,7): error TS2300: Duplicate identifier 'C'. --bug25104.js(3,19): error TS1005: '}' expected. + bug25104.js(3,19): error TS1005: '}' expected. -bug25104.js(4,26): error TS2300: Duplicate identifier 'C'. -bug25104.js(6,18): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. --bug25104.js(6,18): error TS1005: '}' expected. -- -- + bug25104.js(6,18): error TS1005: '}' expected. + + -==== bug25104.js (5 errors) ==== -- class C { ++==== bug25104.js (2 errors) ==== + class C { - ~ -!!! error TS2300: Duplicate identifier 'C'. -- /** -- * @typedef {C~A} C~B -- ~ --!!! error TS1005: '}' expected. -- * @typedef {object} C~A + /** + * @typedef {C~A} C~B + ~ + !!! error TS1005: '}' expected. + * @typedef {object} C~A - ~ -!!! error TS2300: Duplicate identifier 'C'. -- */ -- /** @param {C~A} o */ + */ + /** @param {C~A} o */ - -!!! error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. -- ~ --!!! error TS1005: '}' expected. -- constructor(o) { -- } -- } -- -+ \ No newline at end of file + ~ + !!! error TS1005: '}' expected. + constructor(o) { \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typedefTagWrapping.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typedefTagWrapping.errors.txt.diff index eaa71cd329..42766d987e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typedefTagWrapping.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typedefTagWrapping.errors.txt.diff @@ -1,29 +1,32 @@ --- old.typedefTagWrapping.errors.txt +++ new.typedefTagWrapping.errors.txt @@= skipped -0, +0 lines =@@ --mod7.js(5,7): error TS1110: Type expected. --mod7.js(8,4): error TS1110: Type expected. -- -- --==== mod1.js (0 errors) ==== +mod1.js(2,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++mod1.js(2,22): error TS1005: '}' expected. +mod1.js(9,12): error TS2304: Cannot find name 'Type1'. +mod3.js(4,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++mod3.js(4,22): error TS1005: '}' expected. +mod3.js(10,12): error TS2304: Cannot find name 'StringOrNumber1'. +mod4.js(4,14): error TS2552: Cannot find name 'function'. Did you mean 'Function'? ++mod4.js(4,22): error TS1005: '}' expected. +mod4.js(11,12): error TS2304: Cannot find name 'StringOrNumber2'. -+ -+ -+==== mod1.js (2 errors) ==== + mod7.js(5,7): error TS1110: Type expected. + mod7.js(8,4): error TS1110: Type expected. + + +-==== mod1.js (0 errors) ==== ++==== mod1.js (3 errors) ==== /** * @typedef {function(string): boolean} + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. * Type1 */ -@@= skipped -11, +18 lines =@@ +@@= skipped -11, +25 lines =@@ * Tries to use a type whose name is on a different * line than the typedef tag. * @param {Type1} func The function to call. @@ -37,7 +40,7 @@ } -==== mod3.js (0 errors) ==== -+==== mod3.js (2 errors) ==== ++==== mod3.js (3 errors) ==== /** * A function whose signature is very long. * @@ -45,6 +48,8 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. * (string|number)} StringOrNumber1 */ @@ -56,12 +61,12 @@ * @param {boolean} bool The condition. * @param {string} str The string. * @param {number} num The number. -@@= skipped -20, +25 lines =@@ +@@= skipped -20, +27 lines =@@ return func(bool, str, num) } -==== mod4.js (0 errors) ==== -+==== mod4.js (2 errors) ==== ++==== mod4.js (3 errors) ==== /** * A function whose signature is very long. * @@ -69,10 +74,12 @@ + ~~~~~~~~ +!!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 lib.es5.d.ts:--:--: 'Function' is declared here. ++ ~ ++!!! error TS1005: '}' expected. * number): * (string|number)} StringOrNumber2 */ -@@= skipped -12, +15 lines =@@ +@@= skipped -12, +17 lines =@@ /** * Makes use of a function type with a long signature. * @param {StringOrNumber2} func The function. @@ -80,24 +87,4 @@ +!!! error TS2304: Cannot find name 'StringOrNumber2'. * @param {boolean} bool The condition. * @param {string} str The string. - * @param {number} num The number. -@@= skipped -50, +52 lines =@@ - } - - --==== mod7.js (2 errors) ==== -+==== mod7.js (0 errors) ==== - /** - Multiline type expressions in comments without leading * are not supported. - @typedef {{ - foo: - *, -- ~ --!!! error TS1110: Type expected. - bar: - * - }} Type7 -- ~ --!!! error TS1110: Type expected. - */ - \ No newline at end of file + * @param {number} num The number. \ No newline at end of file diff --git a/testdata/tests/cases/compiler/invalidJsdocType.ts b/testdata/tests/cases/compiler/invalidJsdocType.ts new file mode 100644 index 0000000000..9697abdb1b --- /dev/null +++ b/testdata/tests/cases/compiler/invalidJsdocType.ts @@ -0,0 +1,6 @@ +// @allowJs: true +// @checkJs: true +// @noEmit: true +// @filename: a.js +/** @type {@import("a").Type} */ +let x; \ No newline at end of file From 7a4a79f8e6b278e7d8cf805d219f2579b14b4fb5 Mon Sep 17 00:00:00 2001 From: Matt Bierner <12821956+mjbvz@users.noreply.github.com> Date: Fri, 17 Oct 2025 09:08:24 -0700 Subject: [PATCH 26/69] Add vscode editor issue template (#1893) Co-authored-by: Ryan Cavanaugh --- .../ISSUE_TEMPLATE/03-vscode-editor-issue.yml | 49 +++++++++++++++++++ .../{03-other.md => 04-other.md} | 0 ...pr-porting.md => 05-copilot-pr-porting.md} | 0 3 files changed, 49 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/03-vscode-editor-issue.yml rename .github/ISSUE_TEMPLATE/{03-other.md => 04-other.md} (100%) rename .github/ISSUE_TEMPLATE/{04-copilot-pr-porting.md => 05-copilot-pr-porting.md} (100%) diff --git a/.github/ISSUE_TEMPLATE/03-vscode-editor-issue.yml b/.github/ISSUE_TEMPLATE/03-vscode-editor-issue.yml new file mode 100644 index 0000000000..d50d09f0c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/03-vscode-editor-issue.yml @@ -0,0 +1,49 @@ +name: 'VS Code Editor Issue' +about: 'Issue using tsgo in VS Code' +title: '' +labels: 'Domain: Editor' +assignees: '' +body: + - type: input + id: extension_version + attributes: + label: Extension Version + description: The version of the TypeScript (native preview) extension + placeholder: '0.20251016.x' + validations: + required: true + - type: input + id: vscode_version + attributes: + label: VS Code Version + description: The version of the VS Code you are using + placeholder: '1.105.x' + validations: + required: true + - type: input + id: os_version + attributes: + label: Operating system Version + description: Your operating system and version + validations: + required: true + - type: textarea + id: steps + attributes: + label: 'Steps to reproduce' + description: | + Information about how to reproduce the issue and expected behavior + value: | + 1. + 2. + 3. + validations: + required: true + - type: textarea + id: bug_info + attributes: + label: 'Issue' + description: | + Information about the bug, such as expected vs actual behavior + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/03-other.md b/.github/ISSUE_TEMPLATE/04-other.md similarity index 100% rename from .github/ISSUE_TEMPLATE/03-other.md rename to .github/ISSUE_TEMPLATE/04-other.md diff --git a/.github/ISSUE_TEMPLATE/04-copilot-pr-porting.md b/.github/ISSUE_TEMPLATE/05-copilot-pr-porting.md similarity index 100% rename from .github/ISSUE_TEMPLATE/04-copilot-pr-porting.md rename to .github/ISSUE_TEMPLATE/05-copilot-pr-porting.md From 5207eb8f8022fccc8d5c1806c712fbd502581ba1 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Oct 2025 13:15:14 -0700 Subject: [PATCH 27/69] Add "Report Issue" button to TSGO status bar commands (#1889) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com> Co-authored-by: Daniel Rosenwasser --- _extension/package.json | 6 ++++++ _extension/src/commands.ts | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/_extension/package.json b/_extension/package.json index 6fd7113d63..b218b3496a 100644 --- a/_extension/package.json +++ b/_extension/package.json @@ -85,6 +85,12 @@ "title": "Show LSP Trace", "enablement": "typescript.native-preview.serverRunning", "category": "TypeScript Native Preview" + }, + { + "command": "typescript.native-preview.reportIssue", + "title": "Report Issue", + "enablement": "typescript.native-preview.serverRunning", + "category": "TypeScript Native Preview" } ] }, diff --git a/_extension/src/commands.ts b/_extension/src/commands.ts index 18da6a3ca1..a2e0a58065 100644 --- a/_extension/src/commands.ts +++ b/_extension/src/commands.ts @@ -34,6 +34,12 @@ export function registerLanguageCommands(context: vscode.ExtensionContext, clien disposables.push(vscode.commands.registerCommand("typescript.native-preview.showMenu", showCommands)); + disposables.push(vscode.commands.registerCommand("typescript.native-preview.reportIssue", () => { + vscode.commands.executeCommand("workbench.action.openIssueReporter", { + extensionId: "TypeScriptTeam.native-preview", + }); + })); + return disposables; } @@ -74,6 +80,11 @@ async function showCommands(): Promise { description: "Show the LSP communication trace", command: "typescript.native-preview.lsp-trace.focus", }, + { + label: "$(report) Report Issue", + description: "Report an issue with TypeScript Native Preview", + command: "typescript.native-preview.reportIssue", + }, { label: "$(stop-circle) Disable TypeScript Native Preview", description: "Switch back to the built-in TypeScript extension", From ae272f16e2024b1221878883eafd07dbbef28182 Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Sat, 18 Oct 2025 22:01:41 +0900 Subject: [PATCH 28/69] apply codereview --- internal/compiler/host.go | 4 +- .../{pnpvfs/pnpvfs.go => zipvfs/zipvfs.go} | 102 +++++++++++------- 2 files changed, 64 insertions(+), 42 deletions(-) rename internal/vfs/{pnpvfs/pnpvfs.go => zipvfs/zipvfs.go} (80%) diff --git a/internal/compiler/host.go b/internal/compiler/host.go index a34f6edd27..be41733402 100644 --- a/internal/compiler/host.go +++ b/internal/compiler/host.go @@ -9,7 +9,7 @@ import ( "github.com/microsoft/typescript-go/internal/tspath" "github.com/microsoft/typescript-go/internal/vfs" "github.com/microsoft/typescript-go/internal/vfs/cachedvfs" - "github.com/microsoft/typescript-go/internal/vfs/pnpvfs" + "github.com/microsoft/typescript-go/internal/vfs/zipvfs" ) type CompilerHost interface { @@ -57,7 +57,7 @@ func NewCompilerHost( pnpResolutionConfig := TryGetPnpResolutionConfig(currentDirectory) if pnpResolutionConfig != nil { - fs = pnpvfs.From(fs) + fs = zipvfs.From(fs) } return &compilerHost{ diff --git a/internal/vfs/pnpvfs/pnpvfs.go b/internal/vfs/zipvfs/zipvfs.go similarity index 80% rename from internal/vfs/pnpvfs/pnpvfs.go rename to internal/vfs/zipvfs/zipvfs.go index 9fb45c1fac..7b366c3462 100644 --- a/internal/vfs/pnpvfs/pnpvfs.go +++ b/internal/vfs/zipvfs/zipvfs.go @@ -1,4 +1,4 @@ -package pnpvfs +package zipvfs import ( "archive/zip" @@ -18,7 +18,7 @@ const ( FileEntry EntryKind = 2 ) -type PNPFS struct { +type ZipFS struct { inner vfs.FS zipFilesMutex sync.Mutex @@ -31,7 +31,7 @@ type zipFile struct { dirs map[string]*compressedDir files map[string]*compressedFile - wait sync.WaitGroup + once sync.Once } type compressedDir struct { @@ -50,22 +50,20 @@ type compressedFile struct { wasRead bool } -func From(baseFS vfs.FS) *PNPFS { - return &PNPFS{ - inner: baseFS, - - zipFilesMutex: sync.Mutex{}, - zipFiles: make(map[string]*zipFile), +func From(baseFS vfs.FS) *ZipFS { + return &ZipFS{ + inner: baseFS, + zipFiles: make(map[string]*zipFile), } } -func (fs *PNPFS) checkForZip(path string, kind EntryKind) (*zipFile, string) { +func (fs *ZipFS) checkForZip(path string, kind EntryKind) (*zipFile, string) { var zipPath string var pathTail string - if i := strings.Index(path, ".zip/"); i != -1 { - zipPath = path[:i+len(".zip")] - pathTail = path[i+len(".zip/"):] + if before, after, ok := strings.Cut(path, ".zip/"); ok { + zipPath = before + ".zip" + pathTail = after } else if kind == DirEntry && strings.HasSuffix(path, ".zip") { zipPath = path } else { @@ -77,16 +75,17 @@ func (fs *PNPFS) checkForZip(path string, kind EntryKind) (*zipFile, string) { archive := fs.zipFiles[zipPath] if archive != nil { fs.zipFilesMutex.Unlock() - archive.wait.Wait() + archive.once.Do(func() { + // wait if another goroutine is initializing the archive + }) } else { archive = &zipFile{} - archive.wait.Add(1) - fs.zipFiles[zipPath] = archive - fs.zipFilesMutex.Unlock() - defer archive.wait.Done() + archive.once.Do(func() { + fs.zipFiles[zipPath] = archive + fs.zipFilesMutex.Unlock() - // Try reading the zip archive if it's not in the cache - tryToReadZipArchive(zipPath, archive) + tryToReadZipArchive(zipPath, archive) + }) } if archive.err != nil { @@ -178,11 +177,11 @@ func tryToReadZipArchive(zipPath string, archive *zipFile) { archive.reader = reader } -func (fs *PNPFS) UseCaseSensitiveFileNames() bool { +func (fs *ZipFS) UseCaseSensitiveFileNames() bool { return fs.inner.UseCaseSensitiveFileNames() } -func (fs *PNPFS) FileExists(path string) bool { +func (fs *ZipFS) FileExists(path string) bool { path = mangleYarnPnPVirtualPath(path) if fs.inner.FileExists(path) { @@ -198,7 +197,7 @@ func (fs *PNPFS) FileExists(path string) bool { return ok } -func (fs *PNPFS) ReadFile(path string) (contents string, ok bool) { +func (fs *ZipFS) ReadFile(path string) (contents string, ok bool) { path = mangleYarnPnPVirtualPath(path) contents, ok = fs.inner.ReadFile(path) @@ -247,19 +246,34 @@ func (fs *PNPFS) ReadFile(path string) (contents string, ok bool) { return file.contents, true } -func (fs *PNPFS) WriteFile(path string, data string, writeByteOrderMark bool) error { - return fs.inner.WriteFile(path, data, writeByteOrderMark) +func (fs *ZipFS) WriteFile(path string, data string, writeByteOrderMark bool) error { + err := fs.inner.WriteFile(path, data, writeByteOrderMark) + if err != nil { + fs.tryZipFileAssertion(path) + return err + } + return nil } -func (fs *PNPFS) Remove(path string) error { - return fs.inner.Remove(path) +func (fs *ZipFS) Remove(path string) error { + err := fs.inner.Remove(path) + if err != nil { + fs.tryZipFileAssertion(path) + return err + } + return nil } -func (fs *PNPFS) Chtimes(path string, aTime time.Time, mTime time.Time) error { - return fs.inner.Chtimes(path, aTime, mTime) +func (fs *ZipFS) Chtimes(path string, aTime time.Time, mTime time.Time) error { + err := fs.inner.Chtimes(path, aTime, mTime) + if err != nil { + fs.tryZipFileAssertion(path) + return err + } + return nil } -func (fs *PNPFS) DirectoryExists(path string) bool { +func (fs *ZipFS) DirectoryExists(path string) bool { path = mangleYarnPnPVirtualPath(path) if fs.inner.DirectoryExists(path) { @@ -275,7 +289,7 @@ func (fs *PNPFS) DirectoryExists(path string) bool { return ok } -func (fs *PNPFS) GetAccessibleEntries(path string) vfs.Entries { +func (fs *ZipFS) GetAccessibleEntries(path string) vfs.Entries { path = mangleYarnPnPVirtualPath(path) entries := fs.inner.GetAccessibleEntries(path) @@ -293,16 +307,17 @@ func (fs *PNPFS) GetAccessibleEntries(path string) vfs.Entries { return entries } - files := make([]string, 0) - dirs := make([]string, 0) + var files []string + var dirs []string dir.mutex.Lock() defer dir.mutex.Unlock() for name, kind := range dir.entries { - if kind == FileEntry { + switch kind { + case FileEntry: files = append(files, name) - } else if kind == DirEntry { + case DirEntry: dirs = append(dirs, name) } } @@ -313,17 +328,24 @@ func (fs *PNPFS) GetAccessibleEntries(path string) vfs.Entries { } } -func (fs *PNPFS) Stat(path string) vfs.FileInfo { +func (fs *ZipFS) Stat(path string) vfs.FileInfo { return fs.inner.Stat(path) } -func (fs *PNPFS) WalkDir(root string, walkFn vfs.WalkDirFunc) error { +func (fs *ZipFS) WalkDir(root string, walkFn vfs.WalkDirFunc) error { return fs.inner.WalkDir(root, walkFn) } -func (fs *PNPFS) Realpath(path string) string { - realPath := fs.inner.Realpath(path) - return realPath +func (fs *ZipFS) Realpath(path string) string { + return fs.inner.Realpath(path) +} + +func (fs *ZipFS) tryZipFileAssertion(path string) { + zip, _ := fs.checkForZip(path, FileEntry) + if zip == nil { + return + } + panic("do not use this method for zip file: " + path) } func ParseYarnPnPVirtualPath(path string) (string, string, bool) { From 67752dcd841cfc9901ee38f8d09a9a3354af21c1 Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Sun, 19 Oct 2025 02:08:05 +0900 Subject: [PATCH 29/69] generate error message --- internal/compiler/pnp.go | 12 +- internal/diagnostics/diagnostics_generated.go | 30 ++++ .../diagnostics/extraDiagnosticMessages.json | 60 ++++++++ internal/module/pnp/lib.go | 138 +++--------------- internal/module/pnp/lib_test.go | 4 +- 5 files changed, 117 insertions(+), 127 deletions(-) diff --git a/internal/compiler/pnp.go b/internal/compiler/pnp.go index fbae9873d8..dda77fde75 100644 --- a/internal/compiler/pnp.go +++ b/internal/compiler/pnp.go @@ -5,22 +5,22 @@ import ( "os" "path/filepath" - module "github.com/microsoft/typescript-go/internal/module/pnp" + "github.com/microsoft/typescript-go/internal/module/pnp" ) -func TryGetPnpResolutionConfig(path string) *module.ResolutionConfig { +func TryGetPnpResolutionConfig(path string) *pnp.ResolutionConfig { pnpManifestPath, err := findNearestPNPPath(path) if err != nil { return nil } - pnpManifest, err := module.LoadPNPManifest(pnpManifestPath) + pnpManifest, err := pnp.LoadPNPManifest(pnpManifestPath) if err != nil { return nil } - return &module.ResolutionConfig{ - Host: module.ResolutionHost{ - FindPNPManifest: func(_ string) (*module.Manifest, error) { + return &pnp.ResolutionConfig{ + Host: pnp.PNPResolutionHost{ + FindPNPManifest: func(_ string) (*pnp.Manifest, error) { return &pnpManifest, nil }, }, diff --git a/internal/diagnostics/diagnostics_generated.go b/internal/diagnostics/diagnostics_generated.go index 5c32430d2b..23de1b09a4 100644 --- a/internal/diagnostics/diagnostics_generated.go +++ b/internal/diagnostics/diagnostics_generated.go @@ -4253,3 +4253,33 @@ var Do_not_print_diagnostics = &Message{code: 100000, category: CategoryMessage, var Run_in_single_threaded_mode = &Message{code: 100001, category: CategoryMessage, key: "Run_in_single_threaded_mode_100001", text: "Run in single threaded mode."} var Generate_pprof_CPU_Slashmemory_profiles_to_the_given_directory = &Message{code: 100002, category: CategoryMessage, key: "Generate_pprof_CPU_Slashmemory_profiles_to_the_given_directory_100002", text: "Generate pprof CPU/memory profiles to the given directory."} + +var Invalid_specifier = &Message{code: 100010, category: CategoryError, key: "Invalid_specifier_100010", text: "Invalid specifier"} + +var X_assertion_failed_Colon_should_have_a_top_level_name_key = &Message{code: 100011, category: CategoryError, key: "assertion_failed_Colon_should_have_a_top_level_name_key_100011", text: "assertion failed: should have a top-level name key"} + +var X_assertion_failed_Colon_should_have_a_top_level_range_key = &Message{code: 100012, category: CategoryError, key: "assertion_failed_Colon_should_have_a_top_level_range_key_100012", text: "assertion failed: should have a top-level range key"} + +var We_failed_to_read_the_content_of_the_manifest = &Message{code: 100013, category: CategoryError, key: "We_failed_to_read_the_content_of_the_manifest_100013", text: "We failed to read the content of the manifest."} + +var We_failed_to_locate_the_PnP_data_payload_inside_its_manifest_file_Did_you_manually_edit_the_file = &Message{code: 100014, category: CategoryError, key: "We_failed_to_locate_the_PnP_data_payload_inside_its_manifest_file_Did_you_manually_edit_the_file_100014", text: "We failed to locate the PnP data payload inside its manifest file. Did you manually edit the file?"} + +var We_failed_to_parse_the_PnP_data_payload_as_proper_JSON_Did_you_manually_edit_the_file = &Message{code: 100015, category: CategoryError, key: "We_failed_to_parse_the_PnP_data_payload_as_proper_JSON_Did_you_manually_edit_the_file_100015", text: "We failed to parse the PnP data payload as proper JSON; Did you manually edit the file?"} + +var We_failed_to_init_the_PnP_manifest = &Message{code: 100016, category: CategoryError, key: "We_failed_to_init_the_PnP_manifest_100016", text: "We failed to init the PnP manifest"} + +var X_should_have_an_entry_in_the_package_registry_for_0 = &Message{code: 100017, category: CategoryError, key: "should_have_an_entry_in_the_package_registry_for_0_100017", text: "should have an entry in the package registry for {0}"} + +var X_via_0 = &Message{code: 100018, category: CategoryError, key: "via_0_100018", text: " (via \"{0}\")"} + +var Your_application_tried_to_access_0_While_this_module_is_usually_interpreted_as_a_Node_builtin_your_resolver_is_running_inside_a_non_Node_resolution_context_where_such_builtins_are_ignored_Since_0_isn_t_otherwise_declared_in_your_dependencies_this_makes_the_require_call_ambiguous_and_unsound_Required_package_Colon_0_1_Required_by_Colon_2 = &Message{code: 100019, category: CategoryError, key: "Your_application_tried_to_access_0_While_this_module_is_usually_interpreted_as_a_Node_builtin_your_r_100019", text: "Your application tried to access {0}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since {0} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: {0}{1}\nRequired by: {2}"} + +var X_0_tried_to_access_1_While_this_module_is_usually_interpreted_as_a_Node_builtin_your_resolver_is_running_inside_a_non_Node_resolution_context_where_such_builtins_are_ignored_Since_1_isn_t_otherwise_declared_in_0_s_dependencies_this_makes_the_require_call_ambiguous_and_unsound_Required_package_Colon_1_2_Required_by_Colon_3 = &Message{code: 100020, category: CategoryError, key: "_0_tried_to_access_1_While_this_module_is_usually_interpreted_as_a_Node_builtin_your_resolver_is_run_100020", text: "{0} tried to access {1}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since {1} isn't otherwise declared in {0}'s dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: {1}{2}\nRequired by: {3}"} + +var Your_application_tried_to_access_0_but_it_isn_t_declared_in_your_dependencies_this_makes_the_require_call_ambiguous_and_unsound_Required_package_Colon_0_1_Required_by_Colon_2 = &Message{code: 100021, category: CategoryError, key: "Your_application_tried_to_access_0_but_it_isn_t_declared_in_your_dependencies_this_makes_the_require_100021", text: "Your application tried to access {0}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.\n\nRequired package: {0}{1}\nRequired by: {2}"} + +var X_0_tried_to_access_1_a_peer_dependency_but_it_isn_t_provided_by_your_application_this_makes_the_require_call_ambiguous_and_unsound_Required_package_Colon_1_2_Required_by_Colon_0_3_via_4 = &Message{code: 100022, category: CategoryError, key: "_0_tried_to_access_1_a_peer_dependency_but_it_isn_t_provided_by_your_application_this_makes_the_requ_100022", text: "{0} tried to access {1} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.\n\nRequired package: {1}{2}\nRequired by: {0}@{3} (via {4})"} + +var X_0_tried_to_access_1_a_peer_dependency_but_it_isn_t_provided_by_its_ancestors_this_makes_the_require_call_ambiguous_and_unsound_Required_package_Colon_1_2_Required_by_Colon_0_3_via_4 = &Message{code: 100023, category: CategoryError, key: "_0_tried_to_access_1_a_peer_dependency_but_it_isn_t_provided_by_its_ancestors_this_makes_the_require_100023", text: "{0} tried to access {1} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.\n\nRequired package: {1}{2}\nRequired by: {0}@{3} (via {4})"} + +var X_no_host_configured = &Message{code: 100024, category: CategoryError, key: "no_host_configured_100024", text: "no host configured"} diff --git a/internal/diagnostics/extraDiagnosticMessages.json b/internal/diagnostics/extraDiagnosticMessages.json index b735a67695..5be8240dfb 100644 --- a/internal/diagnostics/extraDiagnosticMessages.json +++ b/internal/diagnostics/extraDiagnosticMessages.json @@ -38,5 +38,65 @@ "Project '{0}' is out of date because it has errors.": { "category": "Message", "code": 6423 + }, + "Invalid specifier": { + "category": "Error", + "code": 100010 + }, + "assertion failed: should have a top-level name key": { + "category": "Error", + "code": 100011 + }, + "assertion failed: should have a top-level range key": { + "category": "Error", + "code": 100012 + }, + "We failed to read the content of the manifest.": { + "category": "Error", + "code": 100013 + }, + "We failed to locate the PnP data payload inside its manifest file. Did you manually edit the file?": { + "category": "Error", + "code": 100014 + }, + "We failed to parse the PnP data payload as proper JSON; Did you manually edit the file?": { + "category": "Error", + "code": 100015 + }, + "We failed to init the PnP manifest": { + "category": "Error", + "code": 100016 + }, + "should have an entry in the package registry for {0}": { + "category": "Error", + "code": 100017 + }, + " (via \"{0}\")": { + "category": "Error", + "code": 100018 + }, + "Your application tried to access {0}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since {0} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: {0}{1}\nRequired by: {2}": { + "category": "Error", + "code": 100019 + }, + "{0} tried to access {1}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since {1} isn't otherwise declared in {0}'s dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: {1}{2}\nRequired by: {3}": { + "category": "Error", + "code": 100020 + }, + "Your application tried to access {0}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.\n\nRequired package: {0}{1}\nRequired by: {2}": { + "category": "Error", + "code": 100021 + }, + "{0} tried to access {1} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.\n\nRequired package: {1}{2}\nRequired by: {0}@{3} (via {4})": { + "category": "Error", + "code": 100022 + }, + "{0} tried to access {1} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.\n\nRequired package: {1}{2}\nRequired by: {0}@{3} (via {4})": { + "category": "Error", + "code": 100023 + }, + "no host configured": { + "category": "Error", + "code": 100024 } } diff --git a/internal/module/pnp/lib.go b/internal/module/pnp/lib.go index 98981d591f..e70ff29052 100644 --- a/internal/module/pnp/lib.go +++ b/internal/module/pnp/lib.go @@ -35,6 +35,7 @@ import ( "github.com/go-json-experiment/json" "github.com/microsoft/typescript-go/internal/core" + "github.com/microsoft/typescript-go/internal/diagnostics" "github.com/microsoft/typescript-go/internal/tspath" ) @@ -45,12 +46,12 @@ const ( ResolutionResolved ) -type ResolutionHost struct { +type PNPResolutionHost struct { FindPNPManifest func(start string) (*Manifest, error) } type ResolutionConfig struct { - Host ResolutionHost + Host PNPResolutionHost } type Resolution struct { @@ -59,41 +60,6 @@ type Resolution struct { ModulePath *string } -type UndeclaredDependencyError struct { - Message string - Request string - DependencyName string - IssuerLocator PackageLocator - IssuerPath string -} - -func (e *UndeclaredDependencyError) Error() string { return e.Message } - -type MissingPeerDependencyError struct { - Message string - Request string - DependencyName string - IssuerLocator PackageLocator - IssuerPath string - BrokenAncestors []PackageLocator -} - -func (e *MissingPeerDependencyError) Error() string { return e.Message } - -type FailedManifestHydrationError struct { - Message string - ManifestPath string - Err error -} - -func (e *FailedManifestHydrationError) Error() string { - if e.Err != nil { - return fmt.Sprintf("%s\n\nOriginal error: %v", e.Message, e.Err) - } - return e.Message -} -func (e *FailedManifestHydrationError) Unwrap() error { return e.Err } - func isNodeJSBuiltin(name string) bool { return core.NodeCoreModules()[name] } @@ -140,10 +106,7 @@ func ParseBareIdentifier(spec string) (string, *string, error) { pkg, sub, ok = parseGlobalPackageName(spec) } if !ok { - return "", nil, &FailedManifestHydrationError{ - Message: "Invalid specifier", - ManifestPath: spec, - } + return "", nil, errors.New(diagnostics.Invalid_specifier.Format()) } return pkg, sub, nil } @@ -193,11 +156,11 @@ func InitPNPManifest(m *Manifest, manifestPath string) error { ranges, ok := m.PackageRegistryData[""] if !ok { - return errors.New("assertion failed: should have a top-level name key") + return errors.New(diagnostics.X_assertion_failed_Colon_should_have_a_top_level_name_key.Format()) } top, ok := ranges[""] if !ok { - return errors.New("assertion failed: should have a top-level range key") + return errors.New(diagnostics.X_assertion_failed_Colon_should_have_a_top_level_range_key.Format()) } if m.FallbackPool == nil { @@ -215,19 +178,12 @@ func InitPNPManifest(m *Manifest, manifestPath string) error { func LoadPNPManifest(p string) (Manifest, error) { content, err := os.ReadFile(p) if err != nil { - return Manifest{}, &FailedManifestHydrationError{ - Message: "We failed to read the content of the manifest.", - Err: err, - ManifestPath: p, - } + return Manifest{}, fmt.Errorf("%s: %w", diagnostics.We_failed_to_read_the_content_of_the_manifest.Format(), err) } loc := rePNP.FindIndex(content) if loc == nil { - return Manifest{}, &FailedManifestHydrationError{ - Message: "We failed to locate the PnP data payload inside its manifest file. Did you manually edit the file?", - ManifestPath: p, - } + return Manifest{}, errors.New(diagnostics.We_failed_to_locate_the_PnP_data_payload_inside_its_manifest_file_Did_you_manually_edit_the_file.Format()) } i := loc[1] @@ -249,20 +205,12 @@ func LoadPNPManifest(p string) (Manifest, error) { var manifest Manifest if err = json.Unmarshal(jsonBuf, &manifest); err != nil { - return Manifest{}, &FailedManifestHydrationError{ - Message: "We failed to parse the PnP data payload as proper JSON; Did you manually edit the file?", - ManifestPath: p, - Err: err, - } + return Manifest{}, fmt.Errorf("%s: %w", diagnostics.We_failed_to_parse_the_PnP_data_payload_as_proper_JSON_Did_you_manually_edit_the_file.Format(), err) } err = InitPNPManifest(&manifest, p) if err != nil { - return Manifest{}, &FailedManifestHydrationError{ - Message: "We failed to init the PnP manifest", - ManifestPath: p, - Err: err, - } + return Manifest{}, fmt.Errorf("%s: %w", diagnostics.We_failed_to_init_the_PnP_manifest.Format(), err) } return manifest, nil } @@ -306,11 +254,11 @@ func FindLocator(manifest *Manifest, path string) *PackageLocator { func GetPackage(manifest *Manifest, locator *PackageLocator) (*PackageInformation, error) { refs, ok := manifest.PackageRegistryData[locator.Name] if !ok { - return nil, fmt.Errorf("should have an entry in the package registry for %s", locator.Name) + return nil, errors.New(diagnostics.X_should_have_an_entry_in_the_package_registry_for_0.Format(locator.Name)) } info, ok := refs[locator.Reference] if !ok { - return nil, fmt.Errorf("should have an entry in the package registry for %s", locator.Reference) + return nil, errors.New(diagnostics.X_should_have_an_entry_in_the_package_registry_for_0.Format(locator.Reference)) } return &info, nil } @@ -332,7 +280,7 @@ func FindBrokenPeerDependencies(specifier string, parent *PackageLocator) []Pack func viaSuffix(specifier string, ident string) string { if ident != specifier { - return fmt.Sprintf(" (via \"%s\")", ident) + return diagnostics.X_via_0.Format(ident) } return "" } @@ -372,43 +320,13 @@ func ResolveToUnqualifiedViaManifest( if refOrAlias == nil { if isNodeJSBuiltin(specifier) { if IsDependencyTreeRoot(manifest, parentLocator) { - msg := fmt.Sprintf( - "Your application tried to access %s. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since %s isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: %s%s\nRequired by: %s", - ident, ident, ident, viaSuffix(specifier, ident), parentPath, - ) - return Resolution{}, &UndeclaredDependencyError{ - Message: msg, - Request: specifier, - DependencyName: ident, - IssuerLocator: *parentLocator, - IssuerPath: parentPath, - } - } - msg := fmt.Sprintf( - "%s tried to access %s. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since %s isn't otherwise declared in %s's dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: %s%s\nRequired by: %s", - parentLocator.Name, ident, ident, parentLocator.Name, ident, viaSuffix(specifier, ident), parentPath, - ) - return Resolution{}, &UndeclaredDependencyError{ - Message: msg, - Request: specifier, - DependencyName: ident, - IssuerLocator: *parentLocator, - IssuerPath: parentPath, + return Resolution{}, errors.New(diagnostics.Your_application_tried_to_access_0_While_this_module_is_usually_interpreted_as_a_Node_builtin_your_resolver_is_running_inside_a_non_Node_resolution_context_where_such_builtins_are_ignored_Since_0_isn_t_otherwise_declared_in_your_dependencies_this_makes_the_require_call_ambiguous_and_unsound_Required_package_Colon_0_1_Required_by_Colon_2.Format(ident, ident, viaSuffix(specifier, ident), parentPath)) } + return Resolution{}, errors.New(diagnostics.X_0_tried_to_access_1_While_this_module_is_usually_interpreted_as_a_Node_builtin_your_resolver_is_running_inside_a_non_Node_resolution_context_where_such_builtins_are_ignored_Since_1_isn_t_otherwise_declared_in_0_s_dependencies_this_makes_the_require_call_ambiguous_and_unsound_Required_package_Colon_1_2_Required_by_Colon_3.Format(parentLocator.Name, ident, ident, parentLocator.Name, viaSuffix(specifier, ident), parentPath)) } if IsDependencyTreeRoot(manifest, parentLocator) { - msg := fmt.Sprintf( - "Your application tried to access %s, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.\n\nRequired package: %s%s\nRequired by: %s", - ident, ident, viaSuffix(specifier, ident), parentPath, - ) - return Resolution{}, &UndeclaredDependencyError{ - Message: msg, - Request: specifier, - DependencyName: ident, - IssuerLocator: *parentLocator, - IssuerPath: parentPath, - } + return Resolution{}, errors.New(diagnostics.Your_application_tried_to_access_0_but_it_isn_t_declared_in_your_dependencies_this_makes_the_require_call_ambiguous_and_unsound_Required_package_Colon_0_1_Required_by_Colon_2.Format(ident, viaSuffix(specifier, ident), parentPath)) } brokenAncestors := FindBrokenPeerDependencies(specifier, parentLocator) @@ -422,28 +340,10 @@ func ResolveToUnqualifiedViaManifest( } } - var msg string if len(brokenAncestors) > 0 && allBrokenAreRoots { - msg = fmt.Sprintf( - "%s tried to access %s (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.\n\nRequired package: %s%s\nRequired by: %s@%s (via %s)", - parentLocator.Name, ident, ident, viaSuffix(specifier, ident), - parentLocator.Name, parentLocator.Reference, parentPath, - ) + return Resolution{}, errors.New(diagnostics.X_0_tried_to_access_1_a_peer_dependency_but_it_isn_t_provided_by_your_application_this_makes_the_require_call_ambiguous_and_unsound_Required_package_Colon_1_2_Required_by_Colon_0_3_via_4.Format(parentLocator.Name, ident, viaSuffix(specifier, ident), parentLocator.Reference, parentPath)) } else { - msg = fmt.Sprintf( - "%s tried to access %s (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.\n\nRequired package: %s%s\nRequired by: %s@%s (via %s)", - parentLocator.Name, ident, ident, viaSuffix(specifier, ident), - parentLocator.Name, parentLocator.Reference, parentPath, - ) - } - - return Resolution{}, &MissingPeerDependencyError{ - Message: msg, - Request: specifier, - DependencyName: ident, - IssuerLocator: *parentLocator, - IssuerPath: parentPath, - BrokenAncestors: brokenAncestors, + return Resolution{}, errors.New(diagnostics.X_0_tried_to_access_1_a_peer_dependency_but_it_isn_t_provided_by_its_ancestors_this_makes_the_require_call_ambiguous_and_unsound_Required_package_Colon_1_2_Required_by_Colon_0_3_via_4.Format(parentLocator.Name, ident, viaSuffix(specifier, ident), parentLocator.Reference, parentPath)) } } @@ -473,7 +373,7 @@ func ResolveToUnqualifiedViaManifest( func ResolveToUnqualified(specifier, parentPath string, cfg *ResolutionConfig) (Resolution, error) { if cfg == nil || cfg.Host.FindPNPManifest == nil { - return Resolution{}, errors.New("no host configured") + return Resolution{}, errors.New(diagnostics.X_no_host_configured.Format()) } m, err := cfg.Host.FindPNPManifest(parentPath) if err != nil { diff --git a/internal/module/pnp/lib_test.go b/internal/module/pnp/lib_test.go index e1508ceda0..7e73a51f11 100644 --- a/internal/module/pnp/lib_test.go +++ b/internal/module/pnp/lib_test.go @@ -34,7 +34,7 @@ func TestResolveToUnqualifiedExample(t *testing.T) { log.Fatalf("Expected to load the .pnp.cjs file generated by Yarn 3: %v", err) } - host := ResolutionHost{ + host := PNPResolutionHost{ FindPNPManifest: func(_ string) (*Manifest, error) { return &m, nil }, @@ -118,7 +118,7 @@ func TestResolveUnqualified(t *testing.T) { parent := filepath.Join(tc.Importer, "fooo") manifestCopy := *manifest - host := ResolutionHost{ + host := PNPResolutionHost{ FindPNPManifest: func(_ string) (*Manifest, error) { cp := manifestCopy return &cp, nil From 1f06041bc8227bcbebc19df80773bbfaaa41875e Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Sun, 19 Oct 2025 02:17:41 +0900 Subject: [PATCH 30/69] add error message --- internal/diagnostics/diagnostics_generated.go | 6 +++--- internal/diagnostics/extraDiagnosticMessages.json | 6 +++--- internal/module/pnp/lib.go | 7 +++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/internal/diagnostics/diagnostics_generated.go b/internal/diagnostics/diagnostics_generated.go index 23de1b09a4..008fe890c3 100644 --- a/internal/diagnostics/diagnostics_generated.go +++ b/internal/diagnostics/diagnostics_generated.go @@ -4260,13 +4260,13 @@ var X_assertion_failed_Colon_should_have_a_top_level_name_key = &Message{code: 1 var X_assertion_failed_Colon_should_have_a_top_level_range_key = &Message{code: 100012, category: CategoryError, key: "assertion_failed_Colon_should_have_a_top_level_range_key_100012", text: "assertion failed: should have a top-level range key"} -var We_failed_to_read_the_content_of_the_manifest = &Message{code: 100013, category: CategoryError, key: "We_failed_to_read_the_content_of_the_manifest_100013", text: "We failed to read the content of the manifest."} +var We_failed_to_read_the_content_of_the_manifest_Colon_0 = &Message{code: 100013, category: CategoryError, key: "We_failed_to_read_the_content_of_the_manifest_Colon_0_100013", text: "We failed to read the content of the manifest: {0}"} var We_failed_to_locate_the_PnP_data_payload_inside_its_manifest_file_Did_you_manually_edit_the_file = &Message{code: 100014, category: CategoryError, key: "We_failed_to_locate_the_PnP_data_payload_inside_its_manifest_file_Did_you_manually_edit_the_file_100014", text: "We failed to locate the PnP data payload inside its manifest file. Did you manually edit the file?"} -var We_failed_to_parse_the_PnP_data_payload_as_proper_JSON_Did_you_manually_edit_the_file = &Message{code: 100015, category: CategoryError, key: "We_failed_to_parse_the_PnP_data_payload_as_proper_JSON_Did_you_manually_edit_the_file_100015", text: "We failed to parse the PnP data payload as proper JSON; Did you manually edit the file?"} +var We_failed_to_parse_the_PnP_data_payload_as_proper_JSON_Did_you_manually_edit_the_file_Colon_0 = &Message{code: 100015, category: CategoryError, key: "We_failed_to_parse_the_PnP_data_payload_as_proper_JSON_Did_you_manually_edit_the_file_Colon_0_100015", text: "We failed to parse the PnP data payload as proper JSON; Did you manually edit the file?: {0}"} -var We_failed_to_init_the_PnP_manifest = &Message{code: 100016, category: CategoryError, key: "We_failed_to_init_the_PnP_manifest_100016", text: "We failed to init the PnP manifest"} +var We_failed_to_init_the_PnP_manifest_Colon_0 = &Message{code: 100016, category: CategoryError, key: "We_failed_to_init_the_PnP_manifest_Colon_0_100016", text: "We failed to init the PnP manifest: {0}"} var X_should_have_an_entry_in_the_package_registry_for_0 = &Message{code: 100017, category: CategoryError, key: "should_have_an_entry_in_the_package_registry_for_0_100017", text: "should have an entry in the package registry for {0}"} diff --git a/internal/diagnostics/extraDiagnosticMessages.json b/internal/diagnostics/extraDiagnosticMessages.json index 5be8240dfb..007266e63c 100644 --- a/internal/diagnostics/extraDiagnosticMessages.json +++ b/internal/diagnostics/extraDiagnosticMessages.json @@ -51,7 +51,7 @@ "category": "Error", "code": 100012 }, - "We failed to read the content of the manifest.": { + "We failed to read the content of the manifest: {0}": { "category": "Error", "code": 100013 }, @@ -59,11 +59,11 @@ "category": "Error", "code": 100014 }, - "We failed to parse the PnP data payload as proper JSON; Did you manually edit the file?": { + "We failed to parse the PnP data payload as proper JSON; Did you manually edit the file?: {0}": { "category": "Error", "code": 100015 }, - "We failed to init the PnP manifest": { + "We failed to init the PnP manifest: {0}": { "category": "Error", "code": 100016 }, diff --git a/internal/module/pnp/lib.go b/internal/module/pnp/lib.go index e70ff29052..d1c64c3268 100644 --- a/internal/module/pnp/lib.go +++ b/internal/module/pnp/lib.go @@ -27,7 +27,6 @@ package pnp import ( "errors" - "fmt" "os" "regexp" "slices" @@ -178,7 +177,7 @@ func InitPNPManifest(m *Manifest, manifestPath string) error { func LoadPNPManifest(p string) (Manifest, error) { content, err := os.ReadFile(p) if err != nil { - return Manifest{}, fmt.Errorf("%s: %w", diagnostics.We_failed_to_read_the_content_of_the_manifest.Format(), err) + return Manifest{}, errors.New(diagnostics.We_failed_to_read_the_content_of_the_manifest_Colon_0.Format(err.Error())) } loc := rePNP.FindIndex(content) @@ -205,12 +204,12 @@ func LoadPNPManifest(p string) (Manifest, error) { var manifest Manifest if err = json.Unmarshal(jsonBuf, &manifest); err != nil { - return Manifest{}, fmt.Errorf("%s: %w", diagnostics.We_failed_to_parse_the_PnP_data_payload_as_proper_JSON_Did_you_manually_edit_the_file.Format(), err) + return Manifest{}, errors.New(diagnostics.We_failed_to_parse_the_PnP_data_payload_as_proper_JSON_Did_you_manually_edit_the_file_Colon_0.Format(err.Error())) } err = InitPNPManifest(&manifest, p) if err != nil { - return Manifest{}, fmt.Errorf("%s: %w", diagnostics.We_failed_to_init_the_PnP_manifest.Format(), err) + return Manifest{}, errors.New(diagnostics.We_failed_to_init_the_PnP_manifest_Colon_0.Format(err.Error())) } return manifest, nil } From a9dbc68bf4868159b92cd2e267b91eb621fca7ab Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Sun, 19 Oct 2025 03:19:35 +0900 Subject: [PATCH 31/69] parse pnp.cjs file, regex to ast --- internal/module/pnp/lib.go | 103 ++++++++++++++++++++++++++++--------- 1 file changed, 80 insertions(+), 23 deletions(-) diff --git a/internal/module/pnp/lib.go b/internal/module/pnp/lib.go index d1c64c3268..149a06ce74 100644 --- a/internal/module/pnp/lib.go +++ b/internal/module/pnp/lib.go @@ -28,13 +28,14 @@ package pnp import ( "errors" "os" - "regexp" "slices" "strings" "github.com/go-json-experiment/json" + "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/core" "github.com/microsoft/typescript-go/internal/diagnostics" + "github.com/microsoft/typescript-go/internal/parser" "github.com/microsoft/typescript-go/internal/tspath" ) @@ -127,7 +128,80 @@ func FindClosestPNPManifestPath(start string) (string, bool) { return "", false } -var rePNP = regexp.MustCompile(`(?s)(const[\ \r\n]+RAW_RUNTIME_STATE[\ \r\n]*=[\ \r\n]*|hydrateRuntimeState\(JSON\.parse\()'`) +func extractJSONFromPnPFile(path string, content string) (string, error) { + sourceFile := parser.ParseSourceFile(ast.SourceFileParseOptions{ + FileName: tspath.NormalizePath(path), + Path: tspath.Path(path), + }, content, core.ScriptKindJS) + if sourceFile == nil { + return "", errors.New(diagnostics.We_failed_to_locate_the_PnP_data_payload_inside_its_manifest_file_Did_you_manually_edit_the_file.Format()) + } + + var jsonData string + var found bool + + var visitNode func(*ast.Node) bool + visitNode = func(node *ast.Node) bool { + if node == nil { + return false + } + + // Look for variable declaration lists with RAW_RUNTIME_STATE (Yarn v4) + if node.Kind == ast.KindVariableDeclarationList { + declList := node.AsVariableDeclarationList() + if declList != nil && declList.Declarations != nil && len(declList.Declarations.Nodes) > 0 { + declarator := declList.Declarations.Nodes[0] + if declarator != nil && declarator.Name() != nil { + if name := declarator.Name().AsIdentifier(); name != nil && name.Text == "RAW_RUNTIME_STATE" { + if declarator.Initializer() != nil { + if init := declarator.Initializer().AsStringLiteral(); init != nil { + jsonData = init.Text + found = true + return true + } + } + } + } + } + } + + // Look for call expressions with hydrateRuntimeState(JSON.parse('...')) (Yarn v3) + if node.Kind == ast.KindCallExpression { + call := node.AsCallExpression() + if call != nil && call.Expression != nil { + if expr := call.Expression.AsIdentifier(); expr != nil && expr.Text == "hydrateRuntimeState" { + if call.Arguments != nil && len(call.Arguments.Nodes) > 0 && call.Arguments.Nodes[0] != nil { + if arg := call.Arguments.Nodes[0].AsCallExpression(); arg != nil && arg.Expression != nil { + if argExpr := arg.Expression.AsPropertyAccessExpression(); argExpr != nil { + if obj := argExpr.Expression.AsIdentifier(); obj != nil && obj.Text == "JSON" { + if prop := argExpr.Name().AsIdentifier(); prop != nil && prop.Text == "parse" { + if arg.Arguments != nil && len(arg.Arguments.Nodes) > 0 && arg.Arguments.Nodes[0] != nil { + if jsonArg := arg.Arguments.Nodes[0].AsStringLiteral(); jsonArg != nil { + jsonData = jsonArg.Text + found = true + return true + } + } + } + } + } + } + } + } + } + } + + return node.ForEachChild(visitNode) + } + + sourceFile.ForEachChild(visitNode) + + if !found { + return "", errors.New(diagnostics.We_failed_to_locate_the_PnP_data_payload_inside_its_manifest_file_Did_you_manually_edit_the_file.Format()) + } + + return jsonData, nil +} func InitPNPManifest(m *Manifest, manifestPath string) error { m.ManifestPath = manifestPath @@ -180,30 +254,13 @@ func LoadPNPManifest(p string) (Manifest, error) { return Manifest{}, errors.New(diagnostics.We_failed_to_read_the_content_of_the_manifest_Colon_0.Format(err.Error())) } - loc := rePNP.FindIndex(content) - if loc == nil { - return Manifest{}, errors.New(diagnostics.We_failed_to_locate_the_PnP_data_payload_inside_its_manifest_file_Did_you_manually_edit_the_file.Format()) - } - - i := loc[1] - escaped := false - jsonBuf := make([]byte, 0) - - for ; i < len(content); i++ { - c := content[i] - - if c == '\'' && !escaped { - break - } else if c == '\\' && !escaped { - escaped = true - } else { - escaped = false - jsonBuf = append(jsonBuf, c) - } + jsonData, err := extractJSONFromPnPFile(p, string(content)) + if err != nil { + return Manifest{}, err } var manifest Manifest - if err = json.Unmarshal(jsonBuf, &manifest); err != nil { + if err = json.Unmarshal([]byte(jsonData), &manifest); err != nil { return Manifest{}, errors.New(diagnostics.We_failed_to_parse_the_PnP_data_payload_as_proper_JSON_Did_you_manually_edit_the_file_Colon_0.Format(err.Error())) } From df40d62175bc35971a33d2d9a841495a05eb5c24 Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Sun, 19 Oct 2025 03:24:28 +0900 Subject: [PATCH 32/69] make go version 1.25.0 --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index f2907fdfc7..382cd289f2 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/microsoft/typescript-go -go 1.25.1 +go 1.25.0 require ( github.com/dlclark/regexp2 v1.11.5 From 1485fe3fc6467fef9c5c75b201f346b90541c7e6 Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Sun, 19 Oct 2025 03:27:34 +0900 Subject: [PATCH 33/69] remove useless test --- internal/module/pnp/lib_test.go | 49 -------- .../pnp/edge_case_manifest_state.json | 117 ------------------ 2 files changed, 166 deletions(-) delete mode 100644 testdata/fixtures/pnp/edge_case_manifest_state.json diff --git a/internal/module/pnp/lib_test.go b/internal/module/pnp/lib_test.go index 7e73a51f11..c809f5074f 100644 --- a/internal/module/pnp/lib_test.go +++ b/internal/module/pnp/lib_test.go @@ -6,7 +6,6 @@ import ( "os" "path/filepath" "runtime" - "strings" "testing" "github.com/go-json-experiment/json" @@ -151,54 +150,6 @@ func TestResolveUnqualified(t *testing.T) { } } -func TestEdgeCase_OnePkgCachedAndUnplugged(t *testing.T) { - t.Parallel() - manifestJSONPath := filepath.Join(repo.TestDataPath, "fixtures", "pnp", "edge_case_manifest_state.json") - content, err := os.ReadFile(manifestJSONPath) - if err != nil { - t.Fatalf("failed to read manifest json: %v", err) - } - - var manifest Manifest - if err = json.Unmarshal(content, &manifest); err != nil { - t.Fatalf("failed to unmarshal manifest: %v", err) - } - - err = InitPNPManifest(&manifest, manifestJSONPath) - if err != nil { - t.Fatalf("failed to init pnp manifest: %v", err) - } - - issuer := filepath.Join( - repo.TestDataPath, - "fixtures", - "pnp", - ".yarn", - "unplugged", - "@carbon-icons-react-virtual-379302d360", - "node_modules", - "@carbon", - "icons-react", - "es", - ) - - res, err := ResolveToUnqualifiedViaManifest(&manifest, "@carbon/icon-helpers", issuer) - if err != nil { - t.Fatalf("resolve failed: %v", err) - } - - switch res.Kind { - case ResolutionResolved: - suffix := ".yarn/unplugged/@carbon-icon-helpers-npm-10.54.0-a58f8b7b6c/node_modules/@carbon/icon-helpers/" - got := filepath.ToSlash(res.Path) - if !strings.HasSuffix(got, suffix) { - t.Fatalf("expected resolved path to end with %q, got %q", suffix, got) - } - default: - t.Fatalf("unexpected resolution kind: %v", res.Kind) - } -} - func TestParseSinglePackageName(t *testing.T) { t.Parallel() name, sub, err := ParseBareIdentifier("pkg") diff --git a/testdata/fixtures/pnp/edge_case_manifest_state.json b/testdata/fixtures/pnp/edge_case_manifest_state.json deleted file mode 100644 index 6b37bda7ee..0000000000 --- a/testdata/fixtures/pnp/edge_case_manifest_state.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "__info": [ - "This file is automatically generated. Do not touch it, or risk", - "your modifications being lost." - ], - "dependencyTreeRoots": [ - { - "name": "rspack-link", - "reference": "workspace:." - } - ], - "enableTopLevelFallback": true, - "ignorePatternData": "(^(?:\\.yarn\\/sdks(?:\\/(?!\\.{1,2}(?:\\/|$))(?:(?:(?!(?:^|\\/)\\.{1,2}(?:\\/|$)).)*?)|$))$)", - "fallbackExclusionList": [ - [ - "rspack-link", - [ - "workspace:." - ] - ] - ], - "fallbackPool": [], - "packageRegistryData": [ - [ - null, - [ - [ - null, - { - "packageLocation": "./", - "packageDependencies": [ - ], - "linkType": "SOFT" - } - ] - ] - ], - - [ - "@carbon/icon-helpers", - [ - [ - "npm:10.54.0", - { - "packageLocation": "./.yarn/unplugged/@carbon-icon-helpers-npm-10.54.0-a58f8b7b6c/node_modules/@carbon/icon-helpers/", - "packageDependencies": [ - [ - "@carbon/icon-helpers", - "npm:10.54.0" - ], - [ - "@ibm/telemetry-js", - "npm:1.9.1" - ] - ], - "linkType": "HARD" - } - ] - ] - ], - [ - "@carbon/icons-react", - [ - [ - "npm:11.54.0", - { - "packageLocation": "./.yarn/unplugged/@carbon-icons-react-virtual-379302d360/node_modules/@carbon/icons-react/", - "packageDependencies": [ - [ - "@carbon/icons-react", - "npm:11.54.0" - ] - ], - "linkType": "SOFT" - } - ], - [ - "virtual:ed977161de61e6995bdb8c18ad719dac99ebc9dc1b7317c42e54ab394643509c7ea342abb2b214efc589efcb79dc9deae3ca4092870cbe691d6377887658443c#npm:11.54.0", - { - "packageLocation": "./.yarn/unplugged/@carbon-icons-react-virtual-379302d360/node_modules/@carbon/icons-react/", - "packageDependencies": [ - [ - "@carbon/icons-react", - "virtual:ed977161de61e6995bdb8c18ad719dac99ebc9dc1b7317c42e54ab394643509c7ea342abb2b214efc589efcb79dc9deae3ca4092870cbe691d6377887658443c#npm:11.54.0" - ], - [ - "@carbon/icon-helpers", - "npm:10.54.0" - ], - [ - "@ibm/telemetry-js", - "npm:1.9.1" - ], - [ - "@types/react", - null - ], - [ - "prop-types", - "npm:15.8.1" - ], - [ - "react", - "npm:19.0.0" - ] - ], - "packagePeers": [ - "@types/react", - "react" - ], - "linkType": "HARD" - } - ] - ] - ] - ] -} From 80e287b8e3670718a0d427efd44a8e0633aee765 Mon Sep 17 00:00:00 2001 From: "Oleksandr T." Date: Sat, 18 Oct 2025 22:10:24 +0300 Subject: [PATCH 34/69] fix(1898): adjust location handling in find-refs (#1901) --- internal/ls/documenthighlights.go | 2 +- internal/ls/findallreferences.go | 4 + internal/ls/utilities.go | 2 +- ...nstructorFindAllReferences1.baseline.jsonc | 4 +- ...nstructorFindAllReferences2.baseline.jsonc | 4 +- ...nstructorFindAllReferences4.baseline.jsonc | 4 +- ...AllReferencesDynamicImport1.baseline.jsonc | 2 +- ...ndAllReferencesOfJsonModule.baseline.jsonc | 4 +- .../findAllRefsDeclareClass.baseline.jsonc | 2 +- .../findAllRefsEnumAsNamespace.baseline.jsonc | 4 +- .../findAllRefsExportEquals.baseline.jsonc | 4 +- ...ndAllRefsForDefaultExport01.baseline.jsonc | 6 +- ...ndAllRefsForDefaultExport02.baseline.jsonc | 13 +- ...orVariableInExtendsClause01.baseline.jsonc | 4 +- ...orVariableInExtendsClause02.baseline.jsonc | 4 +- .../findAllRefsImportType.baseline.jsonc | 5 +- ...findAllRefsInsideTemplates1.baseline.jsonc | 4 +- ...findAllRefsInsideTemplates2.baseline.jsonc | 4 +- .../findAllRefsInsideWithBlock.baseline.jsonc | 7 +- .../findAllRefsOnDecorators.baseline.jsonc | 11 +- .../findAllRefsOnDefinition.baseline.jsonc | 9 +- .../findAllRefsOnDefinition2.baseline.jsonc | 8 +- ...OnPrivateParameterProperty1.baseline.jsonc | 6 +- ...AllRefsPrivateNameAccessors.baseline.jsonc | 36 ++-- ...WithLeadingUnderscoreNames1.baseline.jsonc | 4 +- ...WithLeadingUnderscoreNames2.baseline.jsonc | 4 +- ...WithLeadingUnderscoreNames3.baseline.jsonc | 4 +- ...WithLeadingUnderscoreNames4.baseline.jsonc | 4 +- ...WithLeadingUnderscoreNames5.baseline.jsonc | 8 +- ...WithLeadingUnderscoreNames6.baseline.jsonc | 9 +- ...WithLeadingUnderscoreNames7.baseline.jsonc | 4 +- ...mportType_meaningAtLocation.baseline.jsonc | 6 +- ...indAllRefs_importType_named.baseline.jsonc | 12 +- ...efs_importType_typeofImport.baseline.jsonc | 4 +- .../findAllRefs_jsEnum.baseline.jsonc | 6 +- ...encesAcrossMultipleProjects.baseline.jsonc | 10 +- .../findReferencesJSXTagName2.baseline.jsonc | 4 +- ...IsDefinitionOfArrowFunction.baseline.jsonc | 4 +- ...urrencesIsDefinitionOfClass.baseline.jsonc | 6 +- ...currencesIsDefinitionOfEnum.baseline.jsonc | 4 +- ...encesIsDefinitionOfFunction.baseline.jsonc | 4 +- ...ncesIsDefinitionOfInterface.baseline.jsonc | 4 +- ...nitionOfInterfaceClassMerge.baseline.jsonc | 39 ++-- ...ncesIsDefinitionOfNamespace.baseline.jsonc | 4 +- ...ncesIsDefinitionOfTypeAlias.baseline.jsonc | 4 +- ...encesIsDefinitionOfVariable.baseline.jsonc | 20 +- ...cTypedefTagSemanticMeaning0.baseline.jsonc | 4 +- ...cTypedefTagSemanticMeaning1.baseline.jsonc | 4 +- .../localGetReferences.baseline.jsonc | 181 +++++++++++++++++- .../referencesForAmbients.baseline.jsonc | 39 ++-- .../referencesForClassLocal.baseline.jsonc | 13 +- ...referencesForClassParameter.baseline.jsonc | 10 +- ...encesForDeclarationKeywords.baseline.jsonc | 51 ++--- ...rencesForExpressionKeywords.baseline.jsonc | 134 ++++++++----- ...encesForExternalModuleNames.baseline.jsonc | 7 +- ...erencesForFunctionOverloads.baseline.jsonc | 12 +- .../referencesForGlobals.baseline.jsonc | 20 +- .../referencesForGlobals2.baseline.jsonc | 5 +- .../referencesForGlobals3.baseline.jsonc | 5 +- .../referencesForGlobals4.baseline.jsonc | 5 +- .../referencesForGlobals5.baseline.jsonc | 5 +- ...sForGlobalsInExternalModule.baseline.jsonc | 25 +-- .../referencesForImports.baseline.jsonc | 6 +- ...rencesForMergedDeclarations.baseline.jsonc | 22 ++- ...encesForMergedDeclarations2.baseline.jsonc | 6 +- ...encesForMergedDeclarations4.baseline.jsonc | 33 +++- ...encesForMergedDeclarations6.baseline.jsonc | 7 +- ...encesForMergedDeclarations8.baseline.jsonc | 4 +- .../referencesForModifiers.baseline.jsonc | 20 +- .../referencesForStatic.baseline.jsonc | 24 ++- ...ticsAndMembersWithSameNames.baseline.jsonc | 35 +++- ...StringLiteralPropertyNames3.baseline.jsonc | 12 +- .../referencesForTypeKeywords.baseline.jsonc | 16 +- .../remoteGetReferences.baseline.jsonc | 175 ++++++++++++++++- .../tsxFindAllReferences4.baseline.jsonc | 7 +- .../tsxFindAllReferences5.baseline.jsonc | 12 +- .../tsxFindAllReferences8.baseline.jsonc | 52 +++-- ...ReferencesUnionElementType1.baseline.jsonc | 4 +- ...ReferencesUnionElementType2.baseline.jsonc | 4 +- 79 files changed, 960 insertions(+), 320 deletions(-) diff --git a/internal/ls/documenthighlights.go b/internal/ls/documenthighlights.go index f0ed4ce0e0..bab0f63b61 100644 --- a/internal/ls/documenthighlights.go +++ b/internal/ls/documenthighlights.go @@ -51,7 +51,7 @@ func (l *LanguageService) ProvideDocumentHighlights(ctx context.Context, documen } func (l *LanguageService) getSemanticDocumentHighlights(ctx context.Context, position int, node *ast.Node, program *compiler.Program, sourceFile *ast.SourceFile) []*lsproto.DocumentHighlight { - options := refOptions{use: referenceUseReferences} + options := refOptions{use: referenceUseNone} referenceEntries := l.getReferencedSymbolsForNode(ctx, position, node, program, []*ast.SourceFile{sourceFile}, options, &collections.Set[string]{}) if referenceEntries == nil { return nil diff --git a/internal/ls/findallreferences.go b/internal/ls/findallreferences.go index 5dc45a5702..4b937d094e 100644 --- a/internal/ls/findallreferences.go +++ b/internal/ls/findallreferences.go @@ -611,6 +611,10 @@ func (l *LanguageService) getReferencedSymbolsForNode(ctx context.Context, posit } } + if options.use == referenceUseReferences || options.use == referenceUseRename { + node = getAdjustedLocation(node, options.use == referenceUseRename, ast.GetSourceFileOfNode(node)) + } + checker, done := program.GetTypeChecker(ctx) defer done() diff --git a/internal/ls/utilities.go b/internal/ls/utilities.go index 86e27a9fb7..a51d0a2fe1 100644 --- a/internal/ls/utilities.go +++ b/internal/ls/utilities.go @@ -917,7 +917,7 @@ func getAdjustedLocation(node *ast.Node, forRename bool, sourceFile *ast.SourceF // specially by `getSymbolAtLocation`. isModifier := func(node *ast.Node) bool { if ast.IsModifier(node) && (forRename || node.Kind != ast.KindDefaultKeyword) { - return ast.CanHaveModifiers(parent) && slices.Contains(parent.Modifiers().NodeList.Nodes, node) + return ast.CanHaveModifiers(parent) && parent.Modifiers() != nil && slices.Contains(parent.Modifiers().NodeList.Nodes, node) } switch node.Kind { case ast.KindClassKeyword: diff --git a/testdata/baselines/reference/fourslash/findAllReferences/constructorFindAllReferences1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/constructorFindAllReferences1.baseline.jsonc index 360000f99d..ee50558949 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/constructorFindAllReferences1.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/constructorFindAllReferences1.baseline.jsonc @@ -1,8 +1,8 @@ // === findAllReferences === // === /constructorFindAllReferences1.ts === // export class C { -// /*FIND ALL REFS*/public constructor() { } +// /*FIND ALL REFS*/public [|constructor|]() { } // public foo() { } // } // -// new C().foo(); \ No newline at end of file +// new [|C|]().foo(); \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/findAllReferences/constructorFindAllReferences2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/constructorFindAllReferences2.baseline.jsonc index ebe82fac1e..a6c3c02e0f 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/constructorFindAllReferences2.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/constructorFindAllReferences2.baseline.jsonc @@ -1,8 +1,8 @@ // === findAllReferences === // === /constructorFindAllReferences2.ts === // export class C { -// /*FIND ALL REFS*/private constructor() { } +// /*FIND ALL REFS*/private [|constructor|]() { } // public foo() { } // } // -// new C().foo(); \ No newline at end of file +// new [|C|]().foo(); \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/findAllReferences/constructorFindAllReferences4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/constructorFindAllReferences4.baseline.jsonc index a9c98eaea2..cf4ebb836b 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/constructorFindAllReferences4.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/constructorFindAllReferences4.baseline.jsonc @@ -1,8 +1,8 @@ // === findAllReferences === // === /constructorFindAllReferences4.ts === // export class C { -// /*FIND ALL REFS*/protected constructor() { } +// /*FIND ALL REFS*/protected [|constructor|]() { } // public foo() { } // } // -// new C().foo(); \ No newline at end of file +// new [|C|]().foo(); \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllReferencesDynamicImport1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllReferencesDynamicImport1.baseline.jsonc index cf2a41e027..af501fac1d 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllReferencesDynamicImport1.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllReferencesDynamicImport1.baseline.jsonc @@ -18,7 +18,7 @@ // === /foo.ts === // export function foo() { return "foo"; } // import("./foo") -// /*FIND ALL REFS*/var x = import("./foo") +// /*FIND ALL REFS*/var [|x|] = import("./foo") diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllReferencesOfJsonModule.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllReferencesOfJsonModule.baseline.jsonc index b573d0da76..2560521003 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllReferencesOfJsonModule.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllReferencesOfJsonModule.baseline.jsonc @@ -1,7 +1,7 @@ // === findAllReferences === // === /foo.ts === -// /*FIND ALL REFS*/import settings from "./settings.json"; -// settings; +// /*FIND ALL REFS*/import [|settings|] from "./settings.json"; +// [|settings|]; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsDeclareClass.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsDeclareClass.baseline.jsonc index a0e7b903e9..4b37e613d9 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsDeclareClass.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsDeclareClass.baseline.jsonc @@ -1,6 +1,6 @@ // === findAllReferences === // === /findAllRefsDeclareClass.ts === -// /*FIND ALL REFS*/declare class C { +// /*FIND ALL REFS*/declare class [|C|] { // static m(): void; // } diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsEnumAsNamespace.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsEnumAsNamespace.baseline.jsonc index 459666328e..4bd7d96f89 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsEnumAsNamespace.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsEnumAsNamespace.baseline.jsonc @@ -1,7 +1,7 @@ // === findAllReferences === // === /findAllRefsEnumAsNamespace.ts === -// /*FIND ALL REFS*/enum E { A } -// let e: E.A; +// /*FIND ALL REFS*/enum [|E|] { A } +// let e: [|E|].A; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsExportEquals.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsExportEquals.baseline.jsonc index 3734653d91..bc114597e4 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsExportEquals.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsExportEquals.baseline.jsonc @@ -8,10 +8,10 @@ // === findAllReferences === // === /a.ts === // type T = number; -// /*FIND ALL REFS*/[|export|] = T; +// /*FIND ALL REFS*/export = [|T|]; // === /b.ts === -// import T = require("[|./a|]"); +// import [|T|] = require("./a"); diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForDefaultExport01.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForDefaultExport01.baseline.jsonc index a7e3cdedf6..f936ce1ea0 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForDefaultExport01.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForDefaultExport01.baseline.jsonc @@ -1,11 +1,11 @@ // === findAllReferences === // === /findAllRefsForDefaultExport01.ts === -// /*FIND ALL REFS*/export default class DefaultExportedClass { +// /*FIND ALL REFS*/export default class [|DefaultExportedClass|] { // } // -// var x: DefaultExportedClass; +// var x: [|DefaultExportedClass|]; // -// var y = new DefaultExportedClass; +// var y = new [|DefaultExportedClass|]; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForDefaultExport02.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForDefaultExport02.baseline.jsonc index 00007d570f..6f553cd654 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForDefaultExport02.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForDefaultExport02.baseline.jsonc @@ -1,10 +1,15 @@ // === findAllReferences === // === /findAllRefsForDefaultExport02.ts === -// /*FIND ALL REFS*/export default function DefaultExportedFunction() { -// return DefaultExportedFunction; +// /*FIND ALL REFS*/export default function [|DefaultExportedFunction|]() { +// return [|DefaultExportedFunction|]; // } // -// // --- (line: 5) skipped --- +// var x: typeof [|DefaultExportedFunction|]; +// +// var y = [|DefaultExportedFunction|](); +// +// namespace DefaultExportedFunction { +// } @@ -74,7 +79,7 @@ // // var y = DefaultExportedFunction(); // -// /*FIND ALL REFS*/namespace DefaultExportedFunction { +// /*FIND ALL REFS*/namespace [|DefaultExportedFunction|] { // } diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForVariableInExtendsClause01.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForVariableInExtendsClause01.baseline.jsonc index e63980b63d..4064c53b01 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForVariableInExtendsClause01.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForVariableInExtendsClause01.baseline.jsonc @@ -1,7 +1,7 @@ // === findAllReferences === // === /findAllRefsForVariableInExtendsClause01.ts === -// /*FIND ALL REFS*/var Base = class { }; -// class C extends Base { } +// /*FIND ALL REFS*/var [|Base|] = class { }; +// class C extends [|Base|] { } diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForVariableInExtendsClause02.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForVariableInExtendsClause02.baseline.jsonc index 635f9d38cb..692886f089 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForVariableInExtendsClause02.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForVariableInExtendsClause02.baseline.jsonc @@ -1,9 +1,9 @@ // === findAllReferences === // === /findAllRefsForVariableInExtendsClause02.ts === -// /*FIND ALL REFS*/interface Base { } +// /*FIND ALL REFS*/interface [|Base|] { } // namespace n { // var Base = class { }; -// interface I extends Base { } +// interface I extends [|Base|] { } // } diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsImportType.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsImportType.baseline.jsonc index d7491ce03c..479db50506 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsImportType.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsImportType.baseline.jsonc @@ -1,7 +1,10 @@ // === findAllReferences === // === /a.js === // module.exports = 0; -// /*FIND ALL REFS*/export type N = number; +// /*FIND ALL REFS*/export type [|N|] = number; + +// === /b.js === +// type T = import("./a").[|N|]; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsInsideTemplates1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsInsideTemplates1.baseline.jsonc index d70f81e56a..b433189590 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsInsideTemplates1.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsInsideTemplates1.baseline.jsonc @@ -1,7 +1,7 @@ // === findAllReferences === // === /findAllRefsInsideTemplates1.ts === -// /*FIND ALL REFS*/var x = 10; -// var y = `${ x } ${ x }` +// /*FIND ALL REFS*/var [|x|] = 10; +// var y = `${ [|x|] } ${ [|x|] }` diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsInsideTemplates2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsInsideTemplates2.baseline.jsonc index 9d2e0aa91d..8ca4acea24 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsInsideTemplates2.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsInsideTemplates2.baseline.jsonc @@ -1,7 +1,7 @@ // === findAllReferences === // === /findAllRefsInsideTemplates2.ts === -// /*FIND ALL REFS*/function f(...rest: any[]) { } -// f `${ f } ${ f }` +// /*FIND ALL REFS*/function [|f|](...rest: any[]) { } +// [|f|] `${ [|f|] } ${ [|f|] }` diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsInsideWithBlock.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsInsideWithBlock.baseline.jsonc index 118d6ab98c..19b1d2ba3d 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsInsideWithBlock.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsInsideWithBlock.baseline.jsonc @@ -1,10 +1,13 @@ // === findAllReferences === // === /findAllRefsInsideWithBlock.ts === -// /*FIND ALL REFS*/var x = 0; +// /*FIND ALL REFS*/var [|x|] = 0; // // with ({}) { // var y = x; // Reference of x here should not be picked -// // --- (line: 5) skipped --- +// y++; // also reference for y should be ignored +// } +// +// [|x|] = [|x|] + 1; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsOnDecorators.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsOnDecorators.baseline.jsonc index 8cef99ffaa..a362eb779e 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsOnDecorators.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsOnDecorators.baseline.jsonc @@ -1,9 +1,16 @@ // === findAllReferences === // === /a.ts === -// /*FIND ALL REFS*/function decorator(target) { +// /*FIND ALL REFS*/function [|decorator|](target) { // return target; // } -// decorator(); +// [|decorator|](); + +// === /b.ts === +// @[|decorator|] @[|decorator|]("again") +// class C { +// @[|decorator|] +// method() {} +// } diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsOnDefinition.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsOnDefinition.baseline.jsonc index c27ee5460e..1ce9c15254 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsOnDefinition.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsOnDefinition.baseline.jsonc @@ -4,12 +4,19 @@ // // } // -// /*FIND ALL REFS*/public start(){ +// /*FIND ALL REFS*/public [|start|](){ // return this; // } // // // --- (line: 11) skipped --- +// === /findAllRefsOnDefinition.ts === +// import Second = require("./findAllRefsOnDefinition-import"); +// +// var second = new Second.Test() +// second.[|start|](); +// second.stop(); + // === findAllReferences === diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsOnDefinition2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsOnDefinition2.baseline.jsonc index 97030d14d0..948c4ea942 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsOnDefinition2.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsOnDefinition2.baseline.jsonc @@ -2,11 +2,17 @@ // === /findAllRefsOnDefinition2-import.ts === // export module Test{ // -// /*FIND ALL REFS*/export interface start { } +// /*FIND ALL REFS*/export interface [|start|] { } // // export interface stop { } // } +// === /findAllRefsOnDefinition2.ts === +// import Second = require("./findAllRefsOnDefinition2-import"); +// +// var start: Second.Test.[|start|]; +// var stop: Second.Test.stop; + // === findAllReferences === diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsOnPrivateParameterProperty1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsOnPrivateParameterProperty1.baseline.jsonc index a353dee861..ff228b6549 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsOnPrivateParameterProperty1.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsOnPrivateParameterProperty1.baseline.jsonc @@ -1,11 +1,13 @@ // === findAllReferences === // === /findAllRefsOnPrivateParameterProperty1.ts === // class ABCD { -// constructor(private x: number, public y: number, /*FIND ALL REFS*/private z: number) { +// constructor(private x: number, public y: number, /*FIND ALL REFS*/private [|z|]: number) { // } // // func() { -// // --- (line: 6) skipped --- +// return this.[|z|]; +// } +// } diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsPrivateNameAccessors.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsPrivateNameAccessors.baseline.jsonc index 450a19bbe9..590bc48285 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsPrivateNameAccessors.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsPrivateNameAccessors.baseline.jsonc @@ -1,11 +1,14 @@ // === findAllReferences === // === /findAllRefsPrivateNameAccessors.ts === // class C { -// /*FIND ALL REFS*/get #foo(){ return 1; } -// set #foo(value: number){ } +// /*FIND ALL REFS*/get [|#foo|](){ return 1; } +// set [|#foo|](value: number){ } // constructor() { -// this.#foo(); -// // --- (line: 6) skipped --- +// this.[|#foo|](); +// } +// } +// class D extends C { +// // --- (line: 9) skipped --- @@ -26,12 +29,14 @@ // === findAllReferences === // === /findAllRefsPrivateNameAccessors.ts === // class C { -// get #foo(){ return 1; } -// /*FIND ALL REFS*/set #foo(value: number){ } +// get [|#foo|](){ return 1; } +// /*FIND ALL REFS*/set [|#foo|](value: number){ } // constructor() { -// this.#foo(); +// this.[|#foo|](); // } -// // --- (line: 7) skipped --- +// } +// class D extends C { +// // --- (line: 9) skipped --- @@ -69,10 +74,10 @@ // } // } // class E { -// /*FIND ALL REFS*/get #foo(){ return 1; } -// set #foo(value: number){ } +// /*FIND ALL REFS*/get [|#foo|](){ return 1; } +// set [|#foo|](value: number){ } // constructor() { -// this.#foo(); +// this.[|#foo|](); // } // } @@ -95,13 +100,14 @@ // === findAllReferences === // === /findAllRefsPrivateNameAccessors.ts === -// --- (line: 12) skipped --- +// --- (line: 11) skipped --- +// } // } // class E { -// get #foo(){ return 1; } -// /*FIND ALL REFS*/set #foo(value: number){ } +// get [|#foo|](){ return 1; } +// /*FIND ALL REFS*/set [|#foo|](value: number){ } // constructor() { -// this.#foo(); +// this.[|#foo|](); // } // } diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames1.baseline.jsonc index 275b2415e7..38bc2fe401 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames1.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames1.baseline.jsonc @@ -1,11 +1,11 @@ // === findAllReferences === // === /findAllRefsWithLeadingUnderscoreNames1.ts === // class Foo { -// /*FIND ALL REFS*/public _bar() { return 0; } +// /*FIND ALL REFS*/public [|_bar|]() { return 0; } // } // // var x: Foo; -// x._bar; +// x.[|_bar|]; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames2.baseline.jsonc index 0627485bd8..def74d86dd 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames2.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames2.baseline.jsonc @@ -1,11 +1,11 @@ // === findAllReferences === // === /findAllRefsWithLeadingUnderscoreNames2.ts === // class Foo { -// /*FIND ALL REFS*/public __bar() { return 0; } +// /*FIND ALL REFS*/public [|__bar|]() { return 0; } // } // // var x: Foo; -// x.__bar; +// x.[|__bar|]; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames3.baseline.jsonc index ba2b00295d..b1c169241e 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames3.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames3.baseline.jsonc @@ -1,11 +1,11 @@ // === findAllReferences === // === /findAllRefsWithLeadingUnderscoreNames3.ts === // class Foo { -// /*FIND ALL REFS*/public ___bar() { return 0; } +// /*FIND ALL REFS*/public [|___bar|]() { return 0; } // } // // var x: Foo; -// x.___bar; +// x.[|___bar|]; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames4.baseline.jsonc index 4c995ceb99..ba04ab6467 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames4.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames4.baseline.jsonc @@ -1,11 +1,11 @@ // === findAllReferences === // === /findAllRefsWithLeadingUnderscoreNames4.ts === // class Foo { -// /*FIND ALL REFS*/public ____bar() { return 0; } +// /*FIND ALL REFS*/public [|____bar|]() { return 0; } // } // // var x: Foo; -// x.____bar; +// x.[|____bar|]; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames5.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames5.baseline.jsonc index 68b9058871..18e8118cfb 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames5.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames5.baseline.jsonc @@ -3,11 +3,15 @@ // class Foo { // public _bar; // public __bar; -// /*FIND ALL REFS*/public ___bar; +// /*FIND ALL REFS*/public [|___bar|]; // public ____bar; // } // -// // --- (line: 8) skipped --- +// var x: Foo; +// x._bar; +// x.__bar; +// x.[|___bar|]; +// x.____bar; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames6.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames6.baseline.jsonc index 5cea661dd5..371052938b 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames6.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames6.baseline.jsonc @@ -2,11 +2,16 @@ // === /findAllRefsWithLeadingUnderscoreNames6.ts === // class Foo { // public _bar; -// /*FIND ALL REFS*/public __bar; +// /*FIND ALL REFS*/public [|__bar|]; // public ___bar; // public ____bar; // } -// // --- (line: 7) skipped --- +// +// var x: Foo; +// x._bar; +// x.[|__bar|]; +// x.___bar; +// x.____bar; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames7.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames7.baseline.jsonc index 761a4899a3..46abb67ad4 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames7.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsWithLeadingUnderscoreNames7.baseline.jsonc @@ -1,7 +1,7 @@ // === findAllReferences === // === /findAllRefsWithLeadingUnderscoreNames7.ts === -// /*FIND ALL REFS*/function __foo() { -// __foo(); +// /*FIND ALL REFS*/function [|__foo|]() { +// [|__foo|](); // } diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefs_importType_meaningAtLocation.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefs_importType_meaningAtLocation.baseline.jsonc index 41f5903eec..a39cb0e4e4 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefs_importType_meaningAtLocation.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefs_importType_meaningAtLocation.baseline.jsonc @@ -1,8 +1,12 @@ // === findAllReferences === // === /a.ts === -// /*FIND ALL REFS*/export type T = 0; +// /*FIND ALL REFS*/export type [|T|] = 0; // export const T = 0; +// === /b.ts === +// const x: import("./a").[|T|] = 0; +// const x: typeof import("./a").T = 0; + // === findAllReferences === diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefs_importType_named.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefs_importType_named.baseline.jsonc index 55c3e1d76c..2d8b8e38a2 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefs_importType_named.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefs_importType_named.baseline.jsonc @@ -1,8 +1,12 @@ // === findAllReferences === // === /a.ts === -// /*FIND ALL REFS*/export type T = number; +// /*FIND ALL REFS*/export type [|T|] = number; // export type U = string; +// === /b.ts === +// const x: import("./a").[|T|] = 0; +// const x: import("./a").U = 0; + // === findAllReferences === @@ -19,7 +23,11 @@ // === findAllReferences === // === /a.ts === // export type T = number; -// /*FIND ALL REFS*/export type U = string; +// /*FIND ALL REFS*/export type [|U|] = string; + +// === /b.ts === +// const x: import("./a").T = 0; +// const x: import("./a").[|U|] = 0; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefs_importType_typeofImport.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefs_importType_typeofImport.baseline.jsonc index 33e67cb257..b1dc44da2b 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefs_importType_typeofImport.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefs_importType_typeofImport.baseline.jsonc @@ -1,6 +1,6 @@ // === findAllReferences === // === /b.ts === -// /*FIND ALL REFS*/const x: typeof import("./a") = { x: 0 }; +// /*FIND ALL REFS*/const [|x|]: typeof import("./a") = { x: 0 }; // const y: typeof import("./a") = { x: 0 }; @@ -15,7 +15,7 @@ // === findAllReferences === // === /b.ts === // const x: typeof import("./a") = { x: 0 }; -// /*FIND ALL REFS*/const y: typeof import("./a") = { x: 0 }; +// /*FIND ALL REFS*/const [|y|]: typeof import("./a") = { x: 0 }; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefs_jsEnum.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefs_jsEnum.baseline.jsonc index 14c23a2f5f..77cd5d46e7 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefs_jsEnum.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefs_jsEnum.baseline.jsonc @@ -1,10 +1,10 @@ // === findAllReferences === // === /a.js === // /** @enum {string} */ -// /*FIND ALL REFS*/const E = { A: "" }; -// E["A"]; +// /*FIND ALL REFS*/const [|E|] = { A: "" }; +// [|E|]["A"]; // /** @type {E} */ -// const e = E.A; +// const e = [|E|].A; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findReferencesAcrossMultipleProjects.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findReferencesAcrossMultipleProjects.baseline.jsonc index ec494e6888..2b80f1d44d 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findReferencesAcrossMultipleProjects.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findReferencesAcrossMultipleProjects.baseline.jsonc @@ -1,6 +1,14 @@ // === findAllReferences === // === /a.ts === -// /*FIND ALL REFS*/var x: number; +// /*FIND ALL REFS*/var [|x|]: number; + +// === /b.ts === +// /// +// [|x|]++; + +// === /c.ts === +// /// +// [|x|]++; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findReferencesJSXTagName2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findReferencesJSXTagName2.baseline.jsonc index a3b65b722a..aac6454a10 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findReferencesJSXTagName2.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findReferencesJSXTagName2.baseline.jsonc @@ -1,7 +1,7 @@ // === findAllReferences === // === /index.tsx === -// /*FIND ALL REFS*/const obj = {Component: () =>
}; -// const element = ; +// /*FIND ALL REFS*/const [|obj|] = {Component: () =>
}; +// const element = <[|obj|].Component/>; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfArrowFunction.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfArrowFunction.baseline.jsonc index d47a9cd615..45d4e9154c 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfArrowFunction.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfArrowFunction.baseline.jsonc @@ -1,7 +1,7 @@ // === findAllReferences === // === /getOccurrencesIsDefinitionOfArrowFunction.ts === -// /*FIND ALL REFS*/var f = x => x + 1; -// f(12); +// /*FIND ALL REFS*/var [|f|] = x => x + 1; +// [|f|](12); diff --git a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfClass.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfClass.baseline.jsonc index 66aa26aa9b..250b824282 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfClass.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfClass.baseline.jsonc @@ -1,10 +1,12 @@ // === findAllReferences === // === /getOccurrencesIsDefinitionOfClass.ts === -// /*FIND ALL REFS*/class C { +// /*FIND ALL REFS*/class [|C|] { // n: number; // constructor() { // this.n = 12; -// // --- (line: 5) skipped --- +// } +// } +// let c = new [|C|](); diff --git a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfEnum.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfEnum.baseline.jsonc index e0b28c98c1..fc51da704e 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfEnum.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfEnum.baseline.jsonc @@ -1,10 +1,10 @@ // === findAllReferences === // === /getOccurrencesIsDefinitionOfEnum.ts === -// /*FIND ALL REFS*/enum E { +// /*FIND ALL REFS*/enum [|E|] { // First, // Second // } -// let first = E.First; +// let first = [|E|].First; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfFunction.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfFunction.baseline.jsonc index 93a9afb726..fb25553e8f 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfFunction.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfFunction.baseline.jsonc @@ -1,8 +1,8 @@ // === findAllReferences === // === /getOccurrencesIsDefinitionOfFunction.ts === -// /*FIND ALL REFS*/function func(x: number) { +// /*FIND ALL REFS*/function [|func|](x: number) { // } -// func(x) +// [|func|](x) diff --git a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfInterface.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfInterface.baseline.jsonc index 1d3cb221db..3465e29156 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfInterface.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfInterface.baseline.jsonc @@ -1,9 +1,9 @@ // === findAllReferences === // === /getOccurrencesIsDefinitionOfInterface.ts === -// /*FIND ALL REFS*/interface I { +// /*FIND ALL REFS*/interface [|I|] { // p: number; // } -// let i: I = { p: 12 }; +// let i: [|I|] = { p: 12 }; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfInterfaceClassMerge.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfInterfaceClassMerge.baseline.jsonc index 0482d27845..06b881e54c 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfInterfaceClassMerge.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfInterfaceClassMerge.baseline.jsonc @@ -1,10 +1,18 @@ // === findAllReferences === // === /getOccurrencesIsDefinitionOfInterfaceClassMerge.ts === -// /*FIND ALL REFS*/interface Numbers { +// /*FIND ALL REFS*/interface [|Numbers|] { // p: number; // } -// interface Numbers { -// // --- (line: 5) skipped --- +// interface [|Numbers|] { +// m: number; +// } +// class [|Numbers|] { +// f(n: number) { +// return this.p + this.m + n; +// } +// } +// let i: [|Numbers|] = new [|Numbers|](); +// let x = i.f(i.p + i.m); @@ -28,14 +36,19 @@ // === findAllReferences === // === /getOccurrencesIsDefinitionOfInterfaceClassMerge.ts === -// interface Numbers { +// interface [|Numbers|] { // p: number; // } -// /*FIND ALL REFS*/interface Numbers { +// /*FIND ALL REFS*/interface [|Numbers|] { // m: number; // } -// class Numbers { -// // --- (line: 8) skipped --- +// class [|Numbers|] { +// f(n: number) { +// return this.p + this.m + n; +// } +// } +// let i: [|Numbers|] = new [|Numbers|](); +// let x = i.f(i.p + i.m); @@ -59,15 +72,19 @@ // === findAllReferences === // === /getOccurrencesIsDefinitionOfInterfaceClassMerge.ts === -// --- (line: 3) skipped --- -// interface Numbers { +// interface [|Numbers|] { +// p: number; +// } +// interface [|Numbers|] { // m: number; // } -// /*FIND ALL REFS*/class Numbers { +// /*FIND ALL REFS*/class [|Numbers|] { // f(n: number) { // return this.p + this.m + n; // } -// // --- (line: 11) skipped --- +// } +// let i: [|Numbers|] = new [|Numbers|](); +// let x = i.f(i.p + i.m); diff --git a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfNamespace.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfNamespace.baseline.jsonc index bba65c8c91..1ea8914044 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfNamespace.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfNamespace.baseline.jsonc @@ -1,9 +1,9 @@ // === findAllReferences === // === /getOccurrencesIsDefinitionOfNamespace.ts === -// /*FIND ALL REFS*/namespace Numbers { +// /*FIND ALL REFS*/namespace [|Numbers|] { // export var n = 12; // } -// let x = Numbers.n + 1; +// let x = [|Numbers|].n + 1; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfTypeAlias.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfTypeAlias.baseline.jsonc index 588c2d0769..7dfa3f7a3b 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfTypeAlias.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfTypeAlias.baseline.jsonc @@ -1,7 +1,7 @@ // === findAllReferences === // === /getOccurrencesIsDefinitionOfTypeAlias.ts === -// /*FIND ALL REFS*/type Alias= number; -// let n: Alias = 12; +// /*FIND ALL REFS*/type [|Alias|]= number; +// let n: [|Alias|] = 12; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfVariable.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfVariable.baseline.jsonc index 3e18059318..9ee407ef13 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfVariable.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/getOccurrencesIsDefinitionOfVariable.baseline.jsonc @@ -1,10 +1,22 @@ // === findAllReferences === // === /getOccurrencesIsDefinitionOfVariable.ts === -// /*FIND ALL REFS*/var x = 0; -// var assignmentRightHandSide = x; -// var assignmentRightHandSide2 = 1 + x; +// /*FIND ALL REFS*/var [|x|] = 0; +// var assignmentRightHandSide = [|x|]; +// var assignmentRightHandSide2 = 1 + [|x|]; +// +// [|x|] = 1; +// [|x|] = [|x|] + [|x|]; +// +// [|x|] == 1; +// [|x|] <= 1; // -// // --- (line: 5) skipped --- +// var preIncrement = ++[|x|]; +// var postIncrement = [|x|]++; +// var preDecrement = --[|x|]; +// var postDecrement = [|x|]--; +// +// [|x|] += 1; +// [|x|] <<= 1; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/jsdocTypedefTagSemanticMeaning0.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/jsdocTypedefTagSemanticMeaning0.baseline.jsonc index 662ccb87d3..db5fd49cb4 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/jsdocTypedefTagSemanticMeaning0.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/jsdocTypedefTagSemanticMeaning0.baseline.jsonc @@ -19,9 +19,9 @@ // === findAllReferences === // === /a.js === // /** @typedef {number} T */ -// /*FIND ALL REFS*/const T = 1; +// /*FIND ALL REFS*/const [|T|] = 1; // /** @type {T} */ -// const n = T; +// const n = [|T|]; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/jsdocTypedefTagSemanticMeaning1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/jsdocTypedefTagSemanticMeaning1.baseline.jsonc index 72f2f31da3..f67cbe6091 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/jsdocTypedefTagSemanticMeaning1.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/jsdocTypedefTagSemanticMeaning1.baseline.jsonc @@ -1,9 +1,9 @@ // === findAllReferences === // === /a.js === // /** @typedef {number} */ -// /*FIND ALL REFS*/const T = 1; +// /*FIND ALL REFS*/const [|T|] = 1; // /** @type {T} */ -// const n = T; +// const n = [|T|]; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/localGetReferences.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/localGetReferences.baseline.jsonc index 3dd7634782..11a750c0a7 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/localGetReferences.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/localGetReferences.baseline.jsonc @@ -2,11 +2,71 @@ // === /localGetReferences_1.ts === // // Comment Refence Test: globalVar // // References to a variable declared in global. -// /*FIND ALL REFS*/var globalVar: number = 2; +// /*FIND ALL REFS*/var [|globalVar|]: number = 2; // // class fooCls { // // References to static variable declared in a class. -// // --- (line: 7) skipped --- +// static clsSVar = 1; +// // References to a variable declared in a class. +// clsVar = 1; +// +// constructor (public clsParam: number) { +// //Increments +// [|globalVar|]++; +// this.clsVar++; +// fooCls.clsSVar++; +// // References to a class parameter. +// // --- (line: 17) skipped --- + +// --- (line: 25) skipped --- +// +// //Increments +// fooCls.clsSVar++; +// [|globalVar|]++; +// modTest.modVar++; +// fnVar++; +// +// // --- (line: 33) skipped --- + +// --- (line: 38) skipped --- +// export var modVar:number; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// +// // --- (line: 46) skipped --- + +// --- (line: 50) skipped --- +// static boo = foo; +// +// //Increments +// [|globalVar|]++; +// fooCls.clsSVar++; +// modVar++; +// } +// // --- (line: 58) skipped --- + +// --- (line: 65) skipped --- +// +// //Arguments +// // References to a class argument. +// clsTest = new fooCls([|globalVar|]); +// // References to a function argument. +// foo([|globalVar|]); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// [|globalVar|] = [|globalVar|] + [|globalVar|]; +// +// //ETC - Other cases +// [|globalVar|] = 3; +// // References to illegal assignment. +// foo = foo + 1; +// err = err++; +// // --- (line: 83) skipped --- @@ -88,11 +148,59 @@ // // class fooCls { // // References to static variable declared in a class. -// /*FIND ALL REFS*/static clsSVar = 1; +// /*FIND ALL REFS*/static [|clsSVar|] = 1; // // References to a variable declared in a class. // clsVar = 1; // -// // --- (line: 11) skipped --- +// constructor (public clsParam: number) { +// //Increments +// globalVar++; +// this.clsVar++; +// fooCls.[|clsSVar|]++; +// // References to a class parameter. +// this.clsParam++; +// modTest.modVar++; +// // --- (line: 19) skipped --- + +// --- (line: 24) skipped --- +// var fnVar = 1; +// +// //Increments +// fooCls.[|clsSVar|]++; +// globalVar++; +// modTest.modVar++; +// fnVar++; +// // --- (line: 32) skipped --- + +// --- (line: 39) skipped --- +// +// //Increments +// globalVar++; +// fooCls.[|clsSVar|]++; +// modVar++; +// +// class testCls { +// // --- (line: 47) skipped --- + +// --- (line: 51) skipped --- +// +// //Increments +// globalVar++; +// fooCls.[|clsSVar|]++; +// modVar++; +// } +// +// // --- (line: 59) skipped --- + +// --- (line: 70) skipped --- +// foo(globalVar); +// +// //Increments +// fooCls.[|clsSVar|]++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// // --- (line: 78) skipped --- @@ -183,11 +291,17 @@ // // References to a variable declared in a class. // clsVar = 1; // -// constructor (/*FIND ALL REFS*/public clsParam: number) { +// constructor (/*FIND ALL REFS*/public [|clsParam|]: number) { // //Increments // globalVar++; // this.clsVar++; -// // --- (line: 15) skipped --- +// fooCls.clsSVar++; +// // References to a class parameter. +// this.[|clsParam|]++; +// modTest.modVar++; +// } +// } +// // --- (line: 21) skipped --- @@ -390,12 +504,55 @@ // } // // // References to a function parameter. -// /*FIND ALL REFS*/function foo(x: number) { +// /*FIND ALL REFS*/function [|foo|](x: number) { // // References to a variable declared in a function. // var fnVar = 1; // // // --- (line: 27) skipped --- +// --- (line: 43) skipped --- +// modVar++; +// +// class testCls { +// static boo = [|foo|]; +// } +// +// function testFn(){ +// static boo = [|foo|]; +// +// //Increments +// globalVar++; +// fooCls.clsSVar++; +// modVar++; +// } +// +// module testMod { +// var boo = [|foo|]; +// } +// } +// +// // --- (line: 64) skipped --- + +// --- (line: 67) skipped --- +// // References to a class argument. +// clsTest = new fooCls(globalVar); +// // References to a function argument. +// [|foo|](globalVar); +// +// //Increments +// fooCls.clsSVar++; +// modTest.modVar++; +// globalVar = globalVar + globalVar; +// +// //ETC - Other cases +// globalVar = 3; +// // References to illegal assignment. +// [|foo|] = [|foo|] + 1; +// err = err++; +// +// //Shadowed fn Parameter +// // --- (line: 85) skipped --- + // === findAllReferences === @@ -485,11 +642,17 @@ // // References to a function parameter. // function foo(x: number) { // // References to a variable declared in a function. -// /*FIND ALL REFS*/var fnVar = 1; +// /*FIND ALL REFS*/var [|fnVar|] = 1; // // //Increments // fooCls.clsSVar++; -// // --- (line: 29) skipped --- +// globalVar++; +// modTest.modVar++; +// [|fnVar|]++; +// +// //Return +// return x++; +// // --- (line: 35) skipped --- diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForAmbients.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForAmbients.baseline.jsonc index b70c6b36cd..9643fbc873 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForAmbients.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForAmbients.baseline.jsonc @@ -1,10 +1,15 @@ // === findAllReferences === // === /referencesForAmbients.ts === -// /*FIND ALL REFS*/declare module "foo" { +// /*FIND ALL REFS*/declare module "[|foo|]" { // var f: number; // } // -// // --- (line: 5) skipped --- +// declare module "bar" { +// export import foo = require("[|foo|]"); +// var f2: typeof foo.f; +// } +// +// // --- (line: 10) skipped --- @@ -26,11 +31,16 @@ // === findAllReferences === // === /referencesForAmbients.ts === // declare module "foo" { -// /*FIND ALL REFS*/var f: number; +// /*FIND ALL REFS*/var [|f|]: number; // } // // declare module "bar" { -// // --- (line: 6) skipped --- +// export import foo = require("foo"); +// var f2: typeof foo.[|f|]; +// } +// +// declare module "baz" { +// // --- (line: 11) skipped --- @@ -56,11 +66,15 @@ // var f: number; // } // -// /*FIND ALL REFS*/declare module "bar" { +// /*FIND ALL REFS*/declare module "[|bar|]" { // export import foo = require("foo"); // var f2: typeof foo.f; // } -// // --- (line: 9) skipped --- +// +// declare module "baz" { +// import bar = require("[|bar|]"); +// var f2: typeof bar.foo; +// } @@ -89,11 +103,14 @@ // } // // declare module "bar" { -// /*FIND ALL REFS*/export import foo = require("foo"); -// var f2: typeof foo.f; +// /*FIND ALL REFS*/export import [|foo|] = require("foo"); +// var f2: typeof [|foo|].f; // } // -// // --- (line: 10) skipped --- +// declare module "baz" { +// import bar = require("bar"); +// var f2: typeof bar.[|foo|]; +// } @@ -170,8 +187,8 @@ // } // // declare module "baz" { -// /*FIND ALL REFS*/import bar = require("bar"); -// var f2: typeof bar.foo; +// /*FIND ALL REFS*/import [|bar|] = require("bar"); +// var f2: typeof [|bar|].foo; // } diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForClassLocal.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForClassLocal.baseline.jsonc index 6eba7c7b66..1644f2ca65 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForClassLocal.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForClassLocal.baseline.jsonc @@ -3,11 +3,18 @@ // var n = 14; // // class foo { -// /*FIND ALL REFS*/private n = 0; +// /*FIND ALL REFS*/private [|n|] = 0; // // public bar() { -// this.n = 9; -// // --- (line: 8) skipped --- +// this.[|n|] = 9; +// } +// +// constructor() { +// this.[|n|] = 4; +// } +// +// public bar2() { +// // --- (line: 15) skipped --- diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForClassParameter.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForClassParameter.baseline.jsonc index e5b662d166..b1565d329a 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForClassParameter.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForClassParameter.baseline.jsonc @@ -5,11 +5,17 @@ // class p { } // // class foo { -// constructor (/*FIND ALL REFS*/public p: any) { +// constructor (/*FIND ALL REFS*/public [|p|]: any) { // } // // public f(p) { -// // --- (line: 10) skipped --- +// this.[|p|] = p; +// } +// +// } +// +// var n = new foo(undefined); +// n.[|p|] = null; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForDeclarationKeywords.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForDeclarationKeywords.baseline.jsonc index 1eaba5ce64..f690bc1ada 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForDeclarationKeywords.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForDeclarationKeywords.baseline.jsonc @@ -2,7 +2,7 @@ // === /referencesForDeclarationKeywords.ts === // class Base {} // interface Implemented1 {} -// /*FIND ALL REFS*/class C1 extends Base implements Implemented1 { +// /*FIND ALL REFS*/class [|C1|] extends Base implements Implemented1 { // get e() { return 1; } // set e(v) {} // } @@ -12,21 +12,25 @@ // === findAllReferences === // === /referencesForDeclarationKeywords.ts === -// class Base {} +// class [|Base|] {} // interface Implemented1 {} -// class C1 /*FIND ALL REFS*/extends Base implements Implemented1 { +// class C1 /*FIND ALL REFS*/extends [|Base|] implements Implemented1 { // get e() { return 1; } // set e(v) {} // } -// // --- (line: 7) skipped --- +// interface I1 extends [|Base|] { } +// type T = { } +// enum E { } +// namespace N { } +// // --- (line: 11) skipped --- // === findAllReferences === // === /referencesForDeclarationKeywords.ts === // class Base {} -// interface Implemented1 {} -// class C1 extends Base /*FIND ALL REFS*/implements Implemented1 { +// interface [|Implemented1|] {} +// class C1 extends Base /*FIND ALL REFS*/implements [|Implemented1|] { // get e() { return 1; } // set e(v) {} // } @@ -50,11 +54,12 @@ // class Base {} // interface Implemented1 {} // class C1 extends Base implements Implemented1 { -// /*FIND ALL REFS*/get e() { return 1; } -// set e(v) {} +// /*FIND ALL REFS*/get [|e|]() { return 1; } +// set [|e|](v) {} // } // interface I1 extends Base { } -// // --- (line: 8) skipped --- +// type T = { } +// // --- (line: 9) skipped --- @@ -63,8 +68,8 @@ // class Base {} // interface Implemented1 {} // class C1 extends Base implements Implemented1 { -// get e() { return 1; } -// /*FIND ALL REFS*/set e(v) {} +// get [|e|]() { return 1; } +// /*FIND ALL REFS*/set [|e|](v) {} // } // interface I1 extends Base { } // type T = { } @@ -78,7 +83,7 @@ // get e() { return 1; } // set e(v) {} // } -// /*FIND ALL REFS*/interface I1 extends Base { } +// /*FIND ALL REFS*/interface [|I1|] extends Base { } // type T = { } // enum E { } // namespace N { } @@ -88,11 +93,13 @@ // === findAllReferences === // === /referencesForDeclarationKeywords.ts === -// --- (line: 3) skipped --- +// class [|Base|] {} +// interface Implemented1 {} +// class C1 extends [|Base|] implements Implemented1 { // get e() { return 1; } // set e(v) {} // } -// interface I1 /*FIND ALL REFS*/extends Base { } +// interface I1 /*FIND ALL REFS*/extends [|Base|] { } // type T = { } // enum E { } // namespace N { } @@ -116,7 +123,7 @@ // set e(v) {} // } // interface I1 extends Base { } -// /*FIND ALL REFS*/type T = { } +// /*FIND ALL REFS*/type [|T|] = { } // enum E { } // namespace N { } // module M { } @@ -130,7 +137,7 @@ // } // interface I1 extends Base { } // type T = { } -// /*FIND ALL REFS*/enum E { } +// /*FIND ALL REFS*/enum [|E|] { } // namespace N { } // module M { } // function fn() {} @@ -144,7 +151,7 @@ // interface I1 extends Base { } // type T = { } // enum E { } -// /*FIND ALL REFS*/namespace N { } +// /*FIND ALL REFS*/namespace [|N|] { } // module M { } // function fn() {} // var x; @@ -158,7 +165,7 @@ // type T = { } // enum E { } // namespace N { } -// /*FIND ALL REFS*/module M { } +// /*FIND ALL REFS*/module [|M|] { } // function fn() {} // var x; // let y; @@ -172,7 +179,7 @@ // enum E { } // namespace N { } // module M { } -// /*FIND ALL REFS*/function fn() {} +// /*FIND ALL REFS*/function [|fn|]() {} // var x; // let y; // const z = 1; @@ -186,7 +193,7 @@ // namespace N { } // module M { } // function fn() {} -// /*FIND ALL REFS*/var x; +// /*FIND ALL REFS*/var [|x|]; // let y; // const z = 1; // interface Implemented2 {} @@ -200,7 +207,7 @@ // module M { } // function fn() {} // var x; -// /*FIND ALL REFS*/let y; +// /*FIND ALL REFS*/let [|y|]; // const z = 1; // interface Implemented2 {} // interface Implemented3 {} @@ -215,7 +222,7 @@ // function fn() {} // var x; // let y; -// /*FIND ALL REFS*/const z = 1; +// /*FIND ALL REFS*/const [|z|] = 1; // interface Implemented2 {} // interface Implemented3 {} // class C2 implements Implemented2, Implemented3 {} diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForExpressionKeywords.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForExpressionKeywords.baseline.jsonc index 845f1c7ced..c7d0181ab8 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForExpressionKeywords.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForExpressionKeywords.baseline.jsonc @@ -1,83 +1,114 @@ // === findAllReferences === // === /referencesForExpressionKeywords.ts === -// class C { +// class [|C|] { // static x = 1; // } -// /*FIND ALL REFS*/new C(); -// void C; -// typeof C; -// delete C.x; -// // --- (line: 8) skipped --- +// /*FIND ALL REFS*/new [|C|](); +// void [|C|]; +// typeof [|C|]; +// delete [|C|].x; +// async function* f() { +// yield [|C|]; +// await [|C|]; +// } +// "x" in [|C|]; +// undefined instanceof [|C|]; +// undefined as [|C|]; // === findAllReferences === // === /referencesForExpressionKeywords.ts === -// class C { +// class [|C|] { // static x = 1; // } -// new C(); -// /*FIND ALL REFS*/void C; -// typeof C; -// delete C.x; +// new [|C|](); +// /*FIND ALL REFS*/void [|C|]; +// typeof [|C|]; +// delete [|C|].x; // async function* f() { -// // --- (line: 9) skipped --- +// yield [|C|]; +// await [|C|]; +// } +// "x" in [|C|]; +// undefined instanceof [|C|]; +// undefined as [|C|]; // === findAllReferences === // === /referencesForExpressionKeywords.ts === -// class C { +// class [|C|] { // static x = 1; // } -// new C(); -// void C; -// /*FIND ALL REFS*/[|typeof|] C; -// delete C.x; +// new [|C|](); +// void [|C|]; +// /*FIND ALL REFS*/typeof [|C|]; +// delete [|C|].x; // async function* f() { -// yield C; -// // --- (line: 10) skipped --- +// yield [|C|]; +// await [|C|]; +// } +// "x" in [|C|]; +// undefined instanceof [|C|]; +// undefined as [|C|]; // === findAllReferences === // === /referencesForExpressionKeywords.ts === -// --- (line: 5) skipped --- -// typeof C; -// delete C.x; +// class [|C|] { +// static x = 1; +// } +// new [|C|](); +// void [|C|]; +// typeof [|C|]; +// delete [|C|].x; // async function* f() { -// /*FIND ALL REFS*/yield C; -// await C; +// /*FIND ALL REFS*/yield [|C|]; +// await [|C|]; // } -// "x" in C; -// undefined instanceof C; -// undefined as C; +// "x" in [|C|]; +// undefined instanceof [|C|]; +// undefined as [|C|]; // === findAllReferences === // === /referencesForExpressionKeywords.ts === -// --- (line: 6) skipped --- -// delete C.x; +// class [|C|] { +// static x = 1; +// } +// new [|C|](); +// void [|C|]; +// typeof [|C|]; +// delete [|C|].x; // async function* f() { -// yield C; -// /*FIND ALL REFS*/await C; +// yield [|C|]; +// /*FIND ALL REFS*/await [|C|]; // } -// "x" in C; -// undefined instanceof C; -// undefined as C; +// "x" in [|C|]; +// undefined instanceof [|C|]; +// undefined as [|C|]; // === findAllReferences === // === /referencesForExpressionKeywords.ts === -// --- (line: 8) skipped --- -// yield C; -// await C; +// class [|C|] { +// static x = 1; // } -// "x" /*FIND ALL REFS*/in C; -// undefined instanceof C; -// undefined as C; +// new [|C|](); +// void [|C|]; +// typeof [|C|]; +// delete [|C|].x; +// async function* f() { +// yield [|C|]; +// await [|C|]; +// } +// "x" /*FIND ALL REFS*/in [|C|]; +// undefined instanceof [|C|]; +// undefined as [|C|]; @@ -102,21 +133,32 @@ // === findAllReferences === // === /referencesForExpressionKeywords.ts === -// --- (line: 10) skipped --- +// class [|C|] { +// static x = 1; // } -// "x" in C; -// undefined instanceof C; -// undefined /*FIND ALL REFS*/as C; +// new [|C|](); +// void [|C|]; +// typeof [|C|]; +// delete [|C|].x; +// async function* f() { +// yield [|C|]; +// await [|C|]; +// } +// "x" in [|C|]; +// undefined instanceof [|C|]; +// undefined /*FIND ALL REFS*/as [|C|]; // === findAllReferences === // === /referencesForExpressionKeywords.ts === -// --- (line: 3) skipped --- +// class C { +// static [|x|] = 1; +// } // new C(); // void C; // typeof C; -// /*FIND ALL REFS*/delete C.x; +// /*FIND ALL REFS*/delete C.[|x|]; // async function* f() { // yield C; // await C; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForExternalModuleNames.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForExternalModuleNames.baseline.jsonc index 6f1cb201fe..cdbcdc4593 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForExternalModuleNames.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForExternalModuleNames.baseline.jsonc @@ -1,9 +1,12 @@ // === findAllReferences === // === /referencesForGlobals_1.ts === -// /*FIND ALL REFS*/declare module "foo" { +// /*FIND ALL REFS*/declare module "[|foo|]" { // var f: number; // } +// === /referencesForGlobals_2.ts === +// import f = require("[|foo|]"); + // === findAllReferences === @@ -19,7 +22,7 @@ // === findAllReferences === // === /referencesForGlobals_2.ts === -// /*FIND ALL REFS*/import f = require("foo"); +// /*FIND ALL REFS*/import [|f|] = require("foo"); diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForFunctionOverloads.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForFunctionOverloads.baseline.jsonc index 86de4ff51c..02172bb86d 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForFunctionOverloads.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForFunctionOverloads.baseline.jsonc @@ -1,8 +1,8 @@ // === findAllReferences === // === /referencesForFunctionOverloads.ts === -// /*FIND ALL REFS*/function foo(x: string); -// function foo(x: string, y: number) { -// foo('', 43); +// /*FIND ALL REFS*/function [|foo|](x: string); +// function [|foo|](x: string, y: number) { +// [|foo|]('', 43); // } @@ -18,9 +18,9 @@ // === findAllReferences === // === /referencesForFunctionOverloads.ts === -// function foo(x: string); -// /*FIND ALL REFS*/function foo(x: string, y: number) { -// foo('', 43); +// function [|foo|](x: string); +// /*FIND ALL REFS*/function [|foo|](x: string, y: number) { +// [|foo|]('', 43); // } diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals.baseline.jsonc index 54bec186f0..7942e20845 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals.baseline.jsonc @@ -1,10 +1,26 @@ // === findAllReferences === // === /referencesForGlobals_1.ts === -// /*FIND ALL REFS*/var global = 2; +// /*FIND ALL REFS*/var [|global|] = 2; // // class foo { // constructor (public global) { } -// // --- (line: 5) skipped --- +// public f(global) { } +// public f2(global) { } +// } +// +// class bar { +// constructor () { +// var n = [|global|]; +// +// var f = new foo(''); +// f.global = ''; +// } +// } +// +// var k = [|global|]; + +// === /referencesForGlobals_2.ts === +// var m = [|global|]; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals2.baseline.jsonc index 31467511fe..d610d04261 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals2.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals2.baseline.jsonc @@ -1,9 +1,12 @@ // === findAllReferences === // === /referencesForGlobals_1.ts === -// /*FIND ALL REFS*/class globalClass { +// /*FIND ALL REFS*/class [|globalClass|] { // public f() { } // } +// === /referencesForGlobals_2.ts === +// var c = [|globalClass|](); + // === findAllReferences === diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals3.baseline.jsonc index 79f09ba209..900a8652b7 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals3.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals3.baseline.jsonc @@ -1,9 +1,12 @@ // === findAllReferences === // === /referencesForGlobals_1.ts === -// /*FIND ALL REFS*/interface globalInterface { +// /*FIND ALL REFS*/interface [|globalInterface|] { // f(); // } +// === /referencesForGlobals_2.ts === +// var i: [|globalInterface|]; + // === findAllReferences === diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals4.baseline.jsonc index 92d11768c4..0d1e16d30b 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals4.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals4.baseline.jsonc @@ -1,9 +1,12 @@ // === findAllReferences === // === /referencesForGlobals_1.ts === -// /*FIND ALL REFS*/module globalModule { +// /*FIND ALL REFS*/module [|globalModule|] { // export f() { }; // } +// === /referencesForGlobals_2.ts === +// var m = [|globalModule|]; + // === findAllReferences === diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals5.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals5.baseline.jsonc index 1345e76576..1fe53ef3aa 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals5.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobals5.baseline.jsonc @@ -4,7 +4,10 @@ // export var x; // } // -// /*FIND ALL REFS*/import globalAlias = globalModule; +// /*FIND ALL REFS*/import [|globalAlias|] = globalModule; + +// === /referencesForGlobals_2.ts === +// var m = [|globalAlias|]; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobalsInExternalModule.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobalsInExternalModule.baseline.jsonc index 73e1bc6410..f676331fc7 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobalsInExternalModule.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForGlobalsInExternalModule.baseline.jsonc @@ -1,10 +1,11 @@ // === findAllReferences === // === /referencesForGlobalsInExternalModule.ts === -// /*FIND ALL REFS*/var topLevelVar = 2; -// var topLevelVar2 = topLevelVar; +// /*FIND ALL REFS*/var [|topLevelVar|] = 2; +// var topLevelVar2 = [|topLevelVar|]; // // class topLevelClass { } -// // --- (line: 5) skipped --- +// var c = new topLevelClass(); +// // --- (line: 6) skipped --- @@ -35,11 +36,12 @@ // var topLevelVar = 2; // var topLevelVar2 = topLevelVar; // -// /*FIND ALL REFS*/class topLevelClass { } -// var c = new topLevelClass(); +// /*FIND ALL REFS*/class [|topLevelClass|] { } +// var c = new [|topLevelClass|](); // // interface topLevelInterface { } -// // --- (line: 8) skipped --- +// var i: topLevelInterface; +// // --- (line: 9) skipped --- @@ -77,11 +79,12 @@ // class topLevelClass { } // var c = new topLevelClass(); // -// /*FIND ALL REFS*/interface topLevelInterface { } -// var i: topLevelInterface; +// /*FIND ALL REFS*/interface [|topLevelInterface|] { } +// var i: [|topLevelInterface|]; // // module topLevelModule { -// // --- (line: 11) skipped --- +// export var x; +// // --- (line: 12) skipped --- @@ -121,10 +124,10 @@ // interface topLevelInterface { } // var i: topLevelInterface; // -// /*FIND ALL REFS*/module topLevelModule { +// /*FIND ALL REFS*/module [|topLevelModule|] { // export var x; // } -// var x = topLevelModule.x; +// var x = [|topLevelModule|].x; // // export = x; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForImports.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForImports.baseline.jsonc index 81aaedb024..bd03e117e5 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForImports.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForImports.baseline.jsonc @@ -4,8 +4,8 @@ // function $(s: string): any; // export = $; // } -// /*FIND ALL REFS*/import $ = require("jquery"); -// $("a"); +// /*FIND ALL REFS*/import [|$|] = require("jquery"); +// [|$|]("a"); // import $ = require("jquery"); @@ -40,7 +40,7 @@ // } // import $ = require("jquery"); // $("a"); -// /*FIND ALL REFS*/import $ = require("jquery"); +// /*FIND ALL REFS*/import [|$|] = require("jquery"); diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations.baseline.jsonc index 9a876c8f4b..d6508f7d33 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations.baseline.jsonc @@ -1,11 +1,18 @@ // === findAllReferences === // === /referencesForMergedDeclarations.ts === -// /*FIND ALL REFS*/interface Foo { +// /*FIND ALL REFS*/interface [|Foo|] { // } // // module Foo { // // --- (line: 5) skipped --- +// --- (line: 8) skipped --- +// } +// +// var f1: Foo.Bar; +// var f2: [|Foo|]; +// Foo.bind(this); + // === findAllReferences === @@ -30,11 +37,16 @@ // interface Foo { // } // -// /*FIND ALL REFS*/module Foo { +// /*FIND ALL REFS*/module [|Foo|] { // export interface Bar { } // } // -// // --- (line: 8) skipped --- +// function Foo(): void { +// } +// +// var f1: [|Foo|].Bar; +// var f2: Foo; +// Foo.bind(this); @@ -62,12 +74,12 @@ // export interface Bar { } // } // -// /*FIND ALL REFS*/function Foo(): void { +// /*FIND ALL REFS*/function [|Foo|](): void { // } // // var f1: Foo.Bar; // var f2: Foo; -// Foo.bind(this); +// [|Foo|].bind(this); diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations2.baseline.jsonc index 377113b9d1..fa095d184e 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations2.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations2.baseline.jsonc @@ -4,10 +4,10 @@ // // function ATest() { } // -// /*FIND ALL REFS*/import alias = ATest; // definition +// /*FIND ALL REFS*/import [|alias|] = ATest; // definition // -// var a: alias.Bar; // namespace -// alias.call(this); // value +// var a: [|alias|].Bar; // namespace +// [|alias|].call(this); // value diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations4.baseline.jsonc index fc54de7f4b..5896510ddb 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations4.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations4.baseline.jsonc @@ -1,10 +1,24 @@ // === findAllReferences === // === /referencesForMergedDeclarations4.ts === -// /*FIND ALL REFS*/class testClass { +// /*FIND ALL REFS*/class [|testClass|] { // static staticMethod() { } // method() { } // } -// // --- (line: 5) skipped --- +// +// module [|testClass|] { +// export interface Bar { +// +// } +// export var s = 0; +// } +// +// var c1: [|testClass|]; +// var c2: [|testClass|].Bar; +// [|testClass|].staticMethod(); +// [|testClass|].prototype.method(); +// [|testClass|].bind(this); +// [|testClass|].s; +// new [|testClass|](); @@ -34,16 +48,25 @@ // === findAllReferences === // === /referencesForMergedDeclarations4.ts === -// class testClass { +// class [|testClass|] { // static staticMethod() { } // method() { } // } // -// /*FIND ALL REFS*/module testClass { +// /*FIND ALL REFS*/module [|testClass|] { // export interface Bar { // // } -// // --- (line: 10) skipped --- +// export var s = 0; +// } +// +// var c1: [|testClass|]; +// var c2: [|testClass|].Bar; +// [|testClass|].staticMethod(); +// [|testClass|].prototype.method(); +// [|testClass|].bind(this); +// [|testClass|].s; +// new [|testClass|](); diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations6.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations6.baseline.jsonc index f7f9fd6965..7746adb1e4 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations6.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations6.baseline.jsonc @@ -1,11 +1,14 @@ // === findAllReferences === // === /referencesForMergedDeclarations6.ts === // interface Foo { } -// /*FIND ALL REFS*/module Foo { +// /*FIND ALL REFS*/module [|Foo|] { // export interface Bar { } // export module Bar { export interface Baz { } } // export function Bar() { } -// // --- (line: 6) skipped --- +// } +// +// // module +// import a1 = [|Foo|]; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations8.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations8.baseline.jsonc index ce8d974534..01b41d14f3 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations8.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForMergedDeclarations8.baseline.jsonc @@ -3,12 +3,12 @@ // interface Foo { } // module Foo { // export interface Bar { } -// /*FIND ALL REFS*/export module Bar { export interface Baz { } } +// /*FIND ALL REFS*/export module [|Bar|] { export interface Baz { } } // export function Bar() { } // } // // // module -// import a3 = Foo.Bar.Baz; +// import a3 = Foo.[|Bar|].Baz; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForModifiers.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForModifiers.baseline.jsonc index b4505a6fce..5edfd5392f 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForModifiers.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForModifiers.baseline.jsonc @@ -1,6 +1,6 @@ // === findAllReferences === // === /referencesForModifiers.ts === -// /*FIND ALL REFS*/declare abstract class C1 { +// /*FIND ALL REFS*/declare abstract class [|C1|] { // static a; // readonly b; // public c; @@ -10,7 +10,7 @@ // === findAllReferences === // === /referencesForModifiers.ts === -// declare /*FIND ALL REFS*/abstract class C1 { +// declare /*FIND ALL REFS*/abstract class [|C1|] { // static a; // readonly b; // public c; @@ -21,7 +21,7 @@ // === findAllReferences === // === /referencesForModifiers.ts === // declare abstract class C1 { -// /*FIND ALL REFS*/static a; +// /*FIND ALL REFS*/static [|a|]; // readonly b; // public c; // protected d; @@ -33,7 +33,7 @@ // === /referencesForModifiers.ts === // declare abstract class C1 { // static a; -// /*FIND ALL REFS*/readonly b; +// /*FIND ALL REFS*/readonly [|b|]; // public c; // protected d; // private e; @@ -46,7 +46,7 @@ // declare abstract class C1 { // static a; // readonly b; -// /*FIND ALL REFS*/public c; +// /*FIND ALL REFS*/public [|c|]; // protected d; // private e; // } @@ -60,7 +60,7 @@ // static a; // readonly b; // public c; -// /*FIND ALL REFS*/protected d; +// /*FIND ALL REFS*/protected [|d|]; // private e; // } // const enum E { @@ -75,7 +75,7 @@ // readonly b; // public c; // protected d; -// /*FIND ALL REFS*/private e; +// /*FIND ALL REFS*/private [|e|]; // } // const enum E { // } @@ -90,7 +90,7 @@ // protected d; // private e; // } -// /*FIND ALL REFS*/const enum E { +// /*FIND ALL REFS*/const enum [|E|] { // } // async function fn() {} // export default class C2 {} @@ -103,7 +103,7 @@ // } // const enum E { // } -// /*FIND ALL REFS*/async function fn() {} +// /*FIND ALL REFS*/async function [|fn|]() {} // export default class C2 {} @@ -114,7 +114,7 @@ // const enum E { // } // async function fn() {} -// /*FIND ALL REFS*/export default class C2 {} +// /*FIND ALL REFS*/export default class [|C2|] {} diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForStatic.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForStatic.baseline.jsonc index d51eb433e8..05be2ced9c 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForStatic.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForStatic.baseline.jsonc @@ -3,11 +3,29 @@ // var n = 43; // // class foo { -// /*FIND ALL REFS*/static n = ''; +// /*FIND ALL REFS*/static [|n|] = ''; // // public bar() { -// foo.n = "'"; -// // --- (line: 8) skipped --- +// foo.[|n|] = "'"; +// if(foo.[|n|]) { +// var x = foo.[|n|]; +// } +// } +// } +// +// class foo2 { +// private x = foo.[|n|]; +// constructor() { +// foo.[|n|] = x; +// } +// +// function b(n) { +// n = foo.[|n|]; +// } +// } + +// === /referencesOnStatic_2.ts === +// var q = foo.[|n|]; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForStaticsAndMembersWithSameNames.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForStaticsAndMembersWithSameNames.baseline.jsonc index 84334b385e..98a98b58e6 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForStaticsAndMembersWithSameNames.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForStaticsAndMembersWithSameNames.baseline.jsonc @@ -27,12 +27,20 @@ // module MixedStaticsClassTest { // export class Foo { // bar: Foo; -// /*FIND ALL REFS*/static bar: Foo; +// /*FIND ALL REFS*/static [|bar|]: Foo; // // public foo(): void { // } // // --- (line: 9) skipped --- +// --- (line: 18) skipped --- +// +// // static function +// MixedStaticsClassTest.Foo.foo(); +// MixedStaticsClassTest.Foo.[|bar|]; +// } +// } + // === findAllReferences === @@ -63,11 +71,21 @@ // bar: Foo; // static bar: Foo; // -// /*FIND ALL REFS*/public foo(): void { +// /*FIND ALL REFS*/public [|foo|](): void { // } // public static foo(): void { // } -// // --- (line: 11) skipped --- +// } +// } +// +// function test() { +// // instance function +// var x = new MixedStaticsClassTest.Foo(); +// x.[|foo|](); +// x.bar; +// +// // static function +// // --- (line: 21) skipped --- @@ -101,12 +119,21 @@ // // public foo(): void { // } -// /*FIND ALL REFS*/public static foo(): void { +// /*FIND ALL REFS*/public static [|foo|](): void { // } // } // } // // --- (line: 13) skipped --- +// --- (line: 17) skipped --- +// x.bar; +// +// // static function +// MixedStaticsClassTest.Foo.[|foo|](); +// MixedStaticsClassTest.Foo.bar; +// } +// } + // === findAllReferences === diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForStringLiteralPropertyNames3.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForStringLiteralPropertyNames3.baseline.jsonc index 3a61f5954d..d2ff4badc6 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForStringLiteralPropertyNames3.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForStringLiteralPropertyNames3.baseline.jsonc @@ -1,12 +1,12 @@ // === findAllReferences === // === /referencesForStringLiteralPropertyNames3.ts === // class Foo2 { -// /*FIND ALL REFS*/get "42"() { return 0; } -// set 42(n) { } +// /*FIND ALL REFS*/get "[|42|]"() { return 0; } +// set [|42|](n) { } // } // // var y: Foo2; -// y[42]; +// y[[|42|]]; @@ -25,12 +25,12 @@ // === findAllReferences === // === /referencesForStringLiteralPropertyNames3.ts === // class Foo2 { -// get "42"() { return 0; } -// /*FIND ALL REFS*/set 42(n) { } +// get "[|42|]"() { return 0; } +// /*FIND ALL REFS*/set [|42|](n) { } // } // // var y: Foo2; -// y[42]; +// y[[|42|]]; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/referencesForTypeKeywords.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/referencesForTypeKeywords.baseline.jsonc index e458b9c5e7..343a4a0883 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/referencesForTypeKeywords.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/referencesForTypeKeywords.baseline.jsonc @@ -1,7 +1,7 @@ // === findAllReferences === // === /referencesForTypeKeywords.ts === -// interface I {} -// function f() {} +// interface [|I|] {} +// function f() {} // type A1 = T extends U ? 1 : 0; // type A2 = T extends infer U ? 1 : 0; // type A3 = { [P in keyof T]: 1 }; @@ -14,7 +14,7 @@ // === /referencesForTypeKeywords.ts === // interface I {} // function f() {} -// type A1 = T /*FIND ALL REFS*/extends U ? 1 : 0; +// type A1 = T /*FIND ALL REFS*/extends [|U|] ? 1 : 0; // type A2 = T extends infer U ? 1 : 0; // type A3 = { [P in keyof T]: 1 }; // type A4 = keyof T; @@ -27,7 +27,7 @@ // interface I {} // function f() {} // type A1 = T extends U ? 1 : 0; -// type A2 = T extends /*FIND ALL REFS*/[|infer|] U ? 1 : 0; +// type A2 = T extends /*FIND ALL REFS*/infer [|U|] ? 1 : 0; // type A3 = { [P in keyof T]: 1 }; // type A4 = keyof T; // type A5 = readonly T[]; @@ -40,7 +40,7 @@ // function f() {} // type A1 = T extends U ? 1 : 0; // type A2 = T extends infer U ? 1 : 0; -// type A3 = { [P /*FIND ALL REFS*/in keyof T]: 1 }; +// type A3 = { [[|P|] /*FIND ALL REFS*/in keyof T]: 1 }; // type A4 = keyof T; // type A5 = readonly T[]; @@ -52,8 +52,8 @@ // function f() {} // type A1 = T extends U ? 1 : 0; // type A2 = T extends infer U ? 1 : 0; -// type A3 = { [P in [|keyof|] T]: 1 }; -// type A4 = /*FIND ALL REFS*/[|keyof|] T; +// type A3 = { [P in keyof T]: 1 }; +// type A4<[|T|]> = /*FIND ALL REFS*/keyof [|T|]; // type A5 = readonly T[]; @@ -64,4 +64,4 @@ // type A2 = T extends infer U ? 1 : 0; // type A3 = { [P in keyof T]: 1 }; // type A4 = keyof T; -// type A5 = /*FIND ALL REFS*/[|readonly|] T[]; \ No newline at end of file +// type A5<[|T|]> = /*FIND ALL REFS*/readonly [|T|][]; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/findAllReferences/remoteGetReferences.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/remoteGetReferences.baseline.jsonc index 2515a755e4..3858ed4b25 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/remoteGetReferences.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/remoteGetReferences.baseline.jsonc @@ -682,12 +682,71 @@ // === findAllReferences === +// === /remoteGetReferences_1.ts === +// --- (line: 85) skipped --- +// var remoteclsTest: remotefooCls; +// +// //Arguments +// remoteclsTest = new remotefooCls([|remoteglobalVar|]); +// remotefoo([|remoteglobalVar|]); +// +// //Increments +// remotefooCls.remoteclsSVar++; +// remotemodTest.remotemodVar++; +// [|remoteglobalVar|] = [|remoteglobalVar|] + [|remoteglobalVar|]; +// +// //ETC - Other cases +// [|remoteglobalVar|] = 3; +// +// //Find References misses method param +// var +// // --- (line: 102) skipped --- + // === /remoteGetReferences_2.ts === -// /*FIND ALL REFS*/var remoteglobalVar: number = 2; +// /*FIND ALL REFS*/var [|remoteglobalVar|]: number = 2; // // class remotefooCls { // //Declare -// // --- (line: 5) skipped --- +// remoteclsVar = 1; +// static remoteclsSVar = 1; +// +// constructor(public remoteclsParam: number) { +// //Increments +// [|remoteglobalVar|]++; +// this.remoteclsVar++; +// remotefooCls.remoteclsSVar++; +// this.remoteclsParam++; +// // --- (line: 14) skipped --- + +// --- (line: 20) skipped --- +// +// //Increments +// remotefooCls.remoteclsSVar++; +// [|remoteglobalVar|]++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// +// // --- (line: 28) skipped --- + +// --- (line: 33) skipped --- +// export var remotemodVar: number; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// +// // --- (line: 41) skipped --- + +// --- (line: 45) skipped --- +// static remoteboo = remotefoo; +// +// //Increments +// [|remoteglobalVar|]++; +// remotefooCls.remoteclsSVar++; +// remotemodVar++; +// } +// // --- (line: 53) skipped --- @@ -761,14 +820,71 @@ // === findAllReferences === +// === /remoteGetReferences_1.ts === +// --- (line: 82) skipped --- +// +// //Remotes +// //Type test +// var remoteclsTest: [|remotefooCls|]; +// +// //Arguments +// remoteclsTest = new [|remotefooCls|](remoteglobalVar); +// remotefoo(remoteglobalVar); +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// // --- (line: 97) skipped --- + // === /remoteGetReferences_2.ts === // var remoteglobalVar: number = 2; // -// /*FIND ALL REFS*/class remotefooCls { +// /*FIND ALL REFS*/class [|remotefooCls|] { // //Declare // remoteclsVar = 1; // static remoteclsSVar = 1; -// // --- (line: 7) skipped --- +// +// constructor(public remoteclsParam: number) { +// //Increments +// remoteglobalVar++; +// this.remoteclsVar++; +// [|remotefooCls|].remoteclsSVar++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// // --- (line: 16) skipped --- + +// --- (line: 19) skipped --- +// var remotefnVar = 1; +// +// //Increments +// [|remotefooCls|].remoteclsSVar++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// // --- (line: 27) skipped --- + +// --- (line: 34) skipped --- +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// +// class remotetestCls { +// // --- (line: 42) skipped --- + +// --- (line: 46) skipped --- +// +// //Increments +// remoteglobalVar++; +// [|remotefooCls|].remoteclsSVar++; +// remotemodVar++; +// } +// +// // --- (line: 54) skipped --- @@ -862,17 +978,64 @@ // === findAllReferences === +// === /remoteGetReferences_1.ts === +// --- (line: 89) skipped --- +// remotefoo(remoteglobalVar); +// +// //Increments +// remotefooCls.[|remoteclsSVar|]++; +// remotemodTest.remotemodVar++; +// remoteglobalVar = remoteglobalVar + remoteglobalVar; +// +// // --- (line: 97) skipped --- + // === /remoteGetReferences_2.ts === // var remoteglobalVar: number = 2; // // class remotefooCls { // //Declare // remoteclsVar = 1; -// /*FIND ALL REFS*/static remoteclsSVar = 1; +// /*FIND ALL REFS*/static [|remoteclsSVar|] = 1; // // constructor(public remoteclsParam: number) { // //Increments -// // --- (line: 10) skipped --- +// remoteglobalVar++; +// this.remoteclsVar++; +// remotefooCls.[|remoteclsSVar|]++; +// this.remoteclsParam++; +// remotemodTest.remotemodVar++; +// } +// // --- (line: 16) skipped --- + +// --- (line: 19) skipped --- +// var remotefnVar = 1; +// +// //Increments +// remotefooCls.[|remoteclsSVar|]++; +// remoteglobalVar++; +// remotemodTest.remotemodVar++; +// remotefnVar++; +// // --- (line: 27) skipped --- + +// --- (line: 34) skipped --- +// +// //Increments +// remoteglobalVar++; +// remotefooCls.[|remoteclsSVar|]++; +// remotemodVar++; +// +// class remotetestCls { +// // --- (line: 42) skipped --- + +// --- (line: 46) skipped --- +// +// //Increments +// remoteglobalVar++; +// remotefooCls.[|remoteclsSVar|]++; +// remotemodVar++; +// } +// +// // --- (line: 54) skipped --- diff --git a/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferences4.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferences4.baseline.jsonc index a65332382e..2fb055c836 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferences4.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferences4.baseline.jsonc @@ -4,11 +4,14 @@ // } // interface ElementAttributesProperty { props } // } -// /*FIND ALL REFS*/class MyClass { +// /*FIND ALL REFS*/class [|MyClass|] { // props: { // name?: string; // size?: number; -// // --- (line: 11) skipped --- +// } +// +// +// var x = <[|MyClass|] name='hello'>; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferences5.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferences5.baseline.jsonc index 8c15f502a3..c7fa566bf2 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferences5.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferences5.baseline.jsonc @@ -4,12 +4,12 @@ // propString: string // optional?: boolean // } -// /*FIND ALL REFS*/declare function Opt(attributes: OptionPropBag): JSX.Element; -// let opt = ; -// let opt1 = ; -// let opt2 = ; -// let opt3 = ; -// let opt4 = ; +// /*FIND ALL REFS*/declare function [|Opt|](attributes: OptionPropBag): JSX.Element; +// let opt = <[|Opt|] />; +// let opt1 = <[|Opt|] propx={100} propString />; +// let opt2 = <[|Opt|] propx={100} optional/>; +// let opt3 = <[|Opt|] wrong />; +// let opt4 = <[|Opt|] propx={100} propString="hi" />; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferences8.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferences8.baseline.jsonc index 4cce5cf782..dac2cf2682 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferences8.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferences8.baseline.jsonc @@ -4,11 +4,15 @@ // interface LinkProps extends ClickableProps { // goTo: string; // } -// /*FIND ALL REFS*/declare function MainButton(buttonProps: ButtonProps): JSX.Element; -// declare function MainButton(linkProps: LinkProps): JSX.Element; -// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element; -// let opt = ; -// // --- (line: 21) skipped --- +// /*FIND ALL REFS*/declare function [|MainButton|](buttonProps: ButtonProps): JSX.Element; +// declare function [|MainButton|](linkProps: LinkProps): JSX.Element; +// declare function [|MainButton|](props: ButtonProps | LinkProps): JSX.Element; +// let opt = <[|MainButton|] />; +// let opt = <[|MainButton|] children="chidlren" />; +// let opt = <[|MainButton|] onClick={()=>{}} />; +// let opt = <[|MainButton|] onClick={()=>{}} ignore-prop />; +// let opt = <[|MainButton|] goTo="goTo" />; +// let opt = <[|MainButton|] wrong />; @@ -32,15 +36,19 @@ // === findAllReferences === // === /file.tsx === -// --- (line: 14) skipped --- +// --- (line: 13) skipped --- +// interface LinkProps extends ClickableProps { // goTo: string; // } -// declare function MainButton(buttonProps: ButtonProps): JSX.Element; -// /*FIND ALL REFS*/declare function MainButton(linkProps: LinkProps): JSX.Element; -// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element; -// let opt = ; -// let opt = ; -// // --- (line: 22) skipped --- +// declare function [|MainButton|](buttonProps: ButtonProps): JSX.Element; +// /*FIND ALL REFS*/declare function [|MainButton|](linkProps: LinkProps): JSX.Element; +// declare function [|MainButton|](props: ButtonProps | LinkProps): JSX.Element; +// let opt = <[|MainButton|] />; +// let opt = <[|MainButton|] children="chidlren" />; +// let opt = <[|MainButton|] onClick={()=>{}} />; +// let opt = <[|MainButton|] onClick={()=>{}} ignore-prop />; +// let opt = <[|MainButton|] goTo="goTo" />; +// let opt = <[|MainButton|] wrong />; @@ -64,15 +72,19 @@ // === findAllReferences === // === /file.tsx === -// --- (line: 15) skipped --- +// --- (line: 13) skipped --- +// interface LinkProps extends ClickableProps { +// goTo: string; // } -// declare function MainButton(buttonProps: ButtonProps): JSX.Element; -// declare function MainButton(linkProps: LinkProps): JSX.Element; -// /*FIND ALL REFS*/declare function MainButton(props: ButtonProps | LinkProps): JSX.Element; -// let opt = ; -// let opt = ; -// let opt = {}} />; -// // --- (line: 23) skipped --- +// declare function [|MainButton|](buttonProps: ButtonProps): JSX.Element; +// declare function [|MainButton|](linkProps: LinkProps): JSX.Element; +// /*FIND ALL REFS*/declare function [|MainButton|](props: ButtonProps | LinkProps): JSX.Element; +// let opt = <[|MainButton|] />; +// let opt = <[|MainButton|] children="chidlren" />; +// let opt = <[|MainButton|] onClick={()=>{}} />; +// let opt = <[|MainButton|] onClick={()=>{}} ignore-prop />; +// let opt = <[|MainButton|] goTo="goTo" />; +// let opt = <[|MainButton|] wrong />; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferencesUnionElementType1.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferencesUnionElementType1.baseline.jsonc index f93c9e0604..590e0bcf5c 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferencesUnionElementType1.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferencesUnionElementType1.baseline.jsonc @@ -4,8 +4,8 @@ // function SFC2(prop: { x: boolean }) { // return

World

; // } -// /*FIND ALL REFS*/var SFCComp = SFC1 || SFC2; -// +// /*FIND ALL REFS*/var [|SFCComp|] = SFC1 || SFC2; +// <[|SFCComp|] x={ "hi" } /> diff --git a/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferencesUnionElementType2.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferencesUnionElementType2.baseline.jsonc index fa4cc25d78..b02df6df6e 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferencesUnionElementType2.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/tsxFindAllReferencesUnionElementType2.baseline.jsonc @@ -4,8 +4,8 @@ // } // private method() { } // } -// /*FIND ALL REFS*/var RCComp = RC1 || RC2; -// +// /*FIND ALL REFS*/var [|RCComp|] = RC1 || RC2; +// <[|RCComp|] /> From 30cbd102b372758990b8f22e08f9b9eec5767dce Mon Sep 17 00:00:00 2001 From: Twacqwq <69360546+Twacqwq@users.noreply.github.com> Date: Tue, 21 Oct 2025 02:40:52 +0800 Subject: [PATCH 35/69] Fix panic of empty string in type reference directive (#1908) --- internal/module/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/module/util.go b/internal/module/util.go index 7f6d093d05..04f75150f4 100644 --- a/internal/module/util.go +++ b/internal/module/util.go @@ -45,7 +45,7 @@ func ParsePackageName(moduleName string) (packageName, rest string) { } func MangleScopedPackageName(packageName string) string { - if packageName[0] == '@' { + if len(packageName) > 0 && packageName[0] == '@' { idx := strings.Index(packageName, "/") if idx == -1 { return packageName From 7ee8b4e44f88f92c5691683f4a0fb8c8c9bfdffd Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 20 Oct 2025 14:48:14 -0400 Subject: [PATCH 36/69] Consistently error on full circle of circular import aliases (#1904) --- internal/ast/symbol.go | 1 - internal/checker/checker.go | 23 +++++++-------- internal/testrunner/compiler_runner.go | 5 ---- .../compiler/circularModuleImports.errors.txt | 5 +++- .../circularModuleImports.errors.txt.diff | 23 +++++++++++++++ .../declarationEmitUnknownImport.errors.txt | 7 +++-- ...clarationEmitUnknownImport.errors.txt.diff | 22 ++++++++++++++ .../declarationEmitUnknownImport2.errors.txt | 7 +++-- ...larationEmitUnknownImport2.errors.txt.diff | 22 ++++++++++++++ .../exportAsNamespaceConflict.errors.txt | 5 +++- .../exportAsNamespaceConflict.errors.txt.diff | 16 ++++++++++ .../conformance/circular1.errors.txt | 5 +++- .../conformance/circular1.errors.txt.diff | 15 ++++++++++ .../conformance/circular3.errors.txt | 13 +++++++-- .../conformance/circular3.errors.txt.diff | 29 +++++++++++++++++++ 15 files changed, 170 insertions(+), 28 deletions(-) create mode 100644 testdata/baselines/reference/submodule/compiler/circularModuleImports.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/exportAsNamespaceConflict.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/circular1.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/circular3.errors.txt.diff diff --git a/internal/ast/symbol.go b/internal/ast/symbol.go index 926d9bd53a..56cfb2ba1b 100644 --- a/internal/ast/symbol.go +++ b/internal/ast/symbol.go @@ -43,7 +43,6 @@ const ( InternalSymbolNameClass = InternalSymbolNamePrefix + "class" // Unnamed class expression InternalSymbolNameFunction = InternalSymbolNamePrefix + "function" // Unnamed function expression InternalSymbolNameComputed = InternalSymbolNamePrefix + "computed" // Computed property name declaration with dynamic name - InternalSymbolNameResolving = InternalSymbolNamePrefix + "resolving" // Indicator symbol used to mark partially resolved type aliases InternalSymbolNameInstantiationExpression = InternalSymbolNamePrefix + "instantiationExpression" // Instantiation expressions InternalSymbolNameImportAttributes = InternalSymbolNamePrefix + "importAttributes" InternalSymbolNameExportEquals = "export=" // Export assignment symbol diff --git a/internal/checker/checker.go b/internal/checker/checker.go index ddf31c26ec..da46eb8d95 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -61,6 +61,7 @@ const ( TypeSystemPropertyNameResolvedBaseTypes TypeSystemPropertyNameWriteType TypeSystemPropertyNameInitializerIsUndefined + TypeSystemPropertyNameAliasTarget ) type TypeResolution struct { @@ -618,7 +619,6 @@ type Checker struct { argumentsSymbol *ast.Symbol requireSymbol *ast.Symbol unknownSymbol *ast.Symbol - resolvingSymbol *ast.Symbol unresolvedSymbols map[string]*ast.Symbol errorTypes map[string]*Type globalThisSymbol *ast.Symbol @@ -915,7 +915,6 @@ func NewChecker(program Program) *Checker { c.argumentsSymbol = c.newSymbol(ast.SymbolFlagsProperty, "arguments") c.requireSymbol = c.newSymbol(ast.SymbolFlagsProperty, "require") c.unknownSymbol = c.newSymbol(ast.SymbolFlagsProperty, "unknown") - c.resolvingSymbol = c.newSymbol(ast.SymbolFlagsNone, ast.InternalSymbolNameResolving) c.unresolvedSymbols = make(map[string]*ast.Symbol) c.errorTypes = make(map[string]*Type) c.globalThisSymbol = c.newSymbolEx(ast.SymbolFlagsModule, "globalThis", ast.CheckFlagsReadonly) @@ -15652,29 +15651,25 @@ func (c *Checker) resolveAlias(symbol *ast.Symbol) *ast.Symbol { } links := c.aliasSymbolLinks.Get(symbol) if links.aliasTarget == nil { - links.aliasTarget = c.resolvingSymbol + if !c.pushTypeResolution(symbol, TypeSystemPropertyNameAliasTarget) { + return c.unknownSymbol + } node := c.getDeclarationOfAliasSymbol(symbol) if node == nil { panic("Unexpected nil in resolveAlias for symbol: " + c.symbolToString(symbol)) } - target := c.getTargetOfAliasDeclaration(node, false /*dontRecursivelyResolve*/) - if links.aliasTarget == c.resolvingSymbol { - if target == nil { - target = c.unknownSymbol - } - links.aliasTarget = target - } else { + links.aliasTarget = core.OrElse(c.getTargetOfAliasDeclaration(node, false /*dontRecursivelyResolve*/), c.unknownSymbol) + if !c.popTypeResolution() { c.error(node, diagnostics.Circular_definition_of_import_alias_0, c.symbolToString(symbol)) + links.aliasTarget = c.unknownSymbol } - } else if links.aliasTarget == c.resolvingSymbol { - links.aliasTarget = c.unknownSymbol } return links.aliasTarget } func (c *Checker) tryResolveAlias(symbol *ast.Symbol) *ast.Symbol { links := c.aliasSymbolLinks.Get(symbol) - if links.aliasTarget != c.resolvingSymbol { + if links.aliasTarget != nil || c.findResolutionCycleStartIndex(symbol, TypeSystemPropertyNameAliasTarget) < 0 { return c.resolveAlias(symbol) } return nil @@ -18097,6 +18092,8 @@ func (c *Checker) typeResolutionHasProperty(r *TypeResolution) bool { return c.nodeLinks.Get(r.target.(*ast.Node)).flags&NodeCheckFlagsInitializerIsUndefinedComputed != 0 case TypeSystemPropertyNameWriteType: return c.valueSymbolLinks.Get(r.target.(*ast.Symbol)).writeType != nil + case TypeSystemPropertyNameAliasTarget: + return c.aliasSymbolLinks.Get(r.target.(*ast.Symbol)).aliasTarget != nil } panic("Unhandled case in typeResolutionHasProperty") } diff --git a/internal/testrunner/compiler_runner.go b/internal/testrunner/compiler_runner.go index 215cba9c8d..35eac30102 100644 --- a/internal/testrunner/compiler_runner.go +++ b/internal/testrunner/compiler_runner.go @@ -337,11 +337,6 @@ func newCompilerTest( } var concurrentSkippedErrorBaselines = map[string]string{ - "circular1.ts": "Circular error reported in an extra position.", - "circular3.ts": "Circular error reported in an extra position.", - "recursiveExportAssignmentAndFindAliasedType1.ts": "Circular error reported in an extra position.", - "recursiveExportAssignmentAndFindAliasedType2.ts": "Circular error reported in an extra position.", - "recursiveExportAssignmentAndFindAliasedType3.ts": "Circular error reported in an extra position.", "typeOnlyMerge2.ts": "Type-only merging is not detected when files are checked on different checkers.", "typeOnlyMerge3.ts": "Type-only merging is not detected when files are checked on different checkers.", } diff --git a/testdata/baselines/reference/submodule/compiler/circularModuleImports.errors.txt b/testdata/baselines/reference/submodule/compiler/circularModuleImports.errors.txt index d7fdcefcfd..2629296c6b 100644 --- a/testdata/baselines/reference/submodule/compiler/circularModuleImports.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/circularModuleImports.errors.txt @@ -1,7 +1,8 @@ circularModuleImports.ts(5,5): error TS2303: Circular definition of import alias 'A'. +circularModuleImports.ts(7,5): error TS2303: Circular definition of import alias 'B'. -==== circularModuleImports.ts (1 errors) ==== +==== circularModuleImports.ts (2 errors) ==== module M { @@ -11,6 +12,8 @@ circularModuleImports.ts(5,5): error TS2303: Circular definition of import alias !!! error TS2303: Circular definition of import alias 'A'. import B = A; + ~~~~~~~~~~~~~ +!!! error TS2303: Circular definition of import alias 'B'. } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/circularModuleImports.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/circularModuleImports.errors.txt.diff new file mode 100644 index 0000000000..dd48f7b787 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/circularModuleImports.errors.txt.diff @@ -0,0 +1,23 @@ +--- old.circularModuleImports.errors.txt ++++ new.circularModuleImports.errors.txt +@@= skipped -0, +0 lines =@@ + circularModuleImports.ts(5,5): error TS2303: Circular definition of import alias 'A'. +- +- +-==== circularModuleImports.ts (1 errors) ==== ++circularModuleImports.ts(7,5): error TS2303: Circular definition of import alias 'B'. ++ ++ ++==== circularModuleImports.ts (2 errors) ==== + module M + + { +@@= skipped -10, +11 lines =@@ + !!! error TS2303: Circular definition of import alias 'A'. + + import B = A; ++ ~~~~~~~~~~~~~ ++!!! error TS2303: Circular definition of import alias 'B'. + + } + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport.errors.txt index ffde8f5e80..1826289e03 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport.errors.txt @@ -1,9 +1,10 @@ declarationEmitUnknownImport.ts(1,1): error TS2303: Circular definition of import alias 'Foo'. declarationEmitUnknownImport.ts(1,14): error TS2304: Cannot find name 'SomeNonExistingName'. declarationEmitUnknownImport.ts(1,14): error TS2503: Cannot find namespace 'SomeNonExistingName'. +declarationEmitUnknownImport.ts(2,9): error TS2303: Circular definition of import alias 'Foo'. -==== declarationEmitUnknownImport.ts (3 errors) ==== +==== declarationEmitUnknownImport.ts (4 errors) ==== import Foo = SomeNonExistingName ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2303: Circular definition of import alias 'Foo'. @@ -11,4 +12,6 @@ declarationEmitUnknownImport.ts(1,14): error TS2503: Cannot find namespace 'Some !!! error TS2304: Cannot find name 'SomeNonExistingName'. ~~~~~~~~~~~~~~~~~~~ !!! error TS2503: Cannot find namespace 'SomeNonExistingName'. - export {Foo} \ No newline at end of file + export {Foo} + ~~~ +!!! error TS2303: Circular definition of import alias 'Foo'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport.errors.txt.diff new file mode 100644 index 0000000000..486c3ff82d --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport.errors.txt.diff @@ -0,0 +1,22 @@ +--- old.declarationEmitUnknownImport.errors.txt ++++ new.declarationEmitUnknownImport.errors.txt +@@= skipped -0, +0 lines =@@ + declarationEmitUnknownImport.ts(1,1): error TS2303: Circular definition of import alias 'Foo'. + declarationEmitUnknownImport.ts(1,14): error TS2304: Cannot find name 'SomeNonExistingName'. + declarationEmitUnknownImport.ts(1,14): error TS2503: Cannot find namespace 'SomeNonExistingName'. +- +- +-==== declarationEmitUnknownImport.ts (3 errors) ==== ++declarationEmitUnknownImport.ts(2,9): error TS2303: Circular definition of import alias 'Foo'. ++ ++ ++==== declarationEmitUnknownImport.ts (4 errors) ==== + import Foo = SomeNonExistingName + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + !!! error TS2303: Circular definition of import alias 'Foo'. +@@= skipped -11, +12 lines =@@ + ~~~~~~~~~~~~~~~~~~~ + !!! error TS2503: Cannot find namespace 'SomeNonExistingName'. + export {Foo} ++ ~~~ ++!!! error TS2303: Circular definition of import alias 'Foo'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2.errors.txt index 37d7841f4b..f52b6fd9af 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2.errors.txt @@ -3,9 +3,10 @@ declarationEmitUnknownImport2.ts(1,12): error TS1005: '=' expected. declarationEmitUnknownImport2.ts(1,12): error TS2304: Cannot find name 'From'. declarationEmitUnknownImport2.ts(1,12): error TS2503: Cannot find namespace 'From'. declarationEmitUnknownImport2.ts(1,17): error TS1005: ';' expected. +declarationEmitUnknownImport2.ts(2,1): error TS2303: Circular definition of import alias 'Foo'. -==== declarationEmitUnknownImport2.ts (5 errors) ==== +==== declarationEmitUnknownImport2.ts (6 errors) ==== import Foo From './Foo'; // Syntax error ~~~~~~~~~~~~~~~ !!! error TS2303: Circular definition of import alias 'Foo'. @@ -17,4 +18,6 @@ declarationEmitUnknownImport2.ts(1,17): error TS1005: ';' expected. !!! error TS2503: Cannot find namespace 'From'. ~~~~~~~ !!! error TS1005: ';' expected. - export default Foo \ No newline at end of file + export default Foo + ~~~~~~~~~~~~~~~~~~ +!!! error TS2303: Circular definition of import alias 'Foo'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2.errors.txt.diff new file mode 100644 index 0000000000..00d4874583 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2.errors.txt.diff @@ -0,0 +1,22 @@ +--- old.declarationEmitUnknownImport2.errors.txt ++++ new.declarationEmitUnknownImport2.errors.txt +@@= skipped -2, +2 lines =@@ + declarationEmitUnknownImport2.ts(1,12): error TS2304: Cannot find name 'From'. + declarationEmitUnknownImport2.ts(1,12): error TS2503: Cannot find namespace 'From'. + declarationEmitUnknownImport2.ts(1,17): error TS1005: ';' expected. +- +- +-==== declarationEmitUnknownImport2.ts (5 errors) ==== ++declarationEmitUnknownImport2.ts(2,1): error TS2303: Circular definition of import alias 'Foo'. ++ ++ ++==== declarationEmitUnknownImport2.ts (6 errors) ==== + import Foo From './Foo'; // Syntax error + ~~~~~~~~~~~~~~~ + !!! error TS2303: Circular definition of import alias 'Foo'. +@@= skipped -15, +16 lines =@@ + ~~~~~~~ + !!! error TS1005: ';' expected. + export default Foo ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS2303: Circular definition of import alias 'Foo'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/exportAsNamespaceConflict.errors.txt b/testdata/baselines/reference/submodule/compiler/exportAsNamespaceConflict.errors.txt index 4b08c73606..0008df30a8 100644 --- a/testdata/baselines/reference/submodule/compiler/exportAsNamespaceConflict.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/exportAsNamespaceConflict.errors.txt @@ -1,9 +1,12 @@ +/a.d.ts(2,1): error TS2303: Circular definition of import alias 'N'. /a.d.ts(3,1): error TS2303: Circular definition of import alias 'N'. -==== /a.d.ts (1 errors) ==== +==== /a.d.ts (2 errors) ==== declare global { namespace N {} } export = N; + ~~~~~~~~~~~ +!!! error TS2303: Circular definition of import alias 'N'. export as namespace N; ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2303: Circular definition of import alias 'N'. diff --git a/testdata/baselines/reference/submodule/compiler/exportAsNamespaceConflict.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/exportAsNamespaceConflict.errors.txt.diff new file mode 100644 index 0000000000..78e304bf69 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/exportAsNamespaceConflict.errors.txt.diff @@ -0,0 +1,16 @@ +--- old.exportAsNamespaceConflict.errors.txt ++++ new.exportAsNamespaceConflict.errors.txt +@@= skipped -0, +0 lines =@@ ++/a.d.ts(2,1): error TS2303: Circular definition of import alias 'N'. + /a.d.ts(3,1): error TS2303: Circular definition of import alias 'N'. + + +-==== /a.d.ts (1 errors) ==== ++==== /a.d.ts (2 errors) ==== + declare global { namespace N {} } + export = N; ++ ~~~~~~~~~~~ ++!!! error TS2303: Circular definition of import alias 'N'. + export as namespace N; + ~~~~~~~~~~~~~~~~~~~~~~ + !!! error TS2303: Circular definition of import alias 'N'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/circular1.errors.txt b/testdata/baselines/reference/submodule/conformance/circular1.errors.txt index eb583371b3..fe5a13637d 100644 --- a/testdata/baselines/reference/submodule/conformance/circular1.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/circular1.errors.txt @@ -1,8 +1,11 @@ +/a.ts(1,15): error TS2303: Circular definition of import alias 'A'. /b.ts(1,15): error TS2303: Circular definition of import alias 'A'. -==== /a.ts (0 errors) ==== +==== /a.ts (1 errors) ==== export type { A } from './b'; + ~ +!!! error TS2303: Circular definition of import alias 'A'. ==== /b.ts (1 errors) ==== export type { A } from './a'; diff --git a/testdata/baselines/reference/submodule/conformance/circular1.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/circular1.errors.txt.diff new file mode 100644 index 0000000000..6927a68e06 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/circular1.errors.txt.diff @@ -0,0 +1,15 @@ +--- old.circular1.errors.txt ++++ new.circular1.errors.txt +@@= skipped -0, +0 lines =@@ ++/a.ts(1,15): error TS2303: Circular definition of import alias 'A'. + /b.ts(1,15): error TS2303: Circular definition of import alias 'A'. + + +-==== /a.ts (0 errors) ==== ++==== /a.ts (1 errors) ==== + export type { A } from './b'; ++ ~ ++!!! error TS2303: Circular definition of import alias 'A'. + + ==== /b.ts (1 errors) ==== + export type { A } from './a'; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/circular3.errors.txt b/testdata/baselines/reference/submodule/conformance/circular3.errors.txt index 5da3e36406..0c72601d6c 100644 --- a/testdata/baselines/reference/submodule/conformance/circular3.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/circular3.errors.txt @@ -1,13 +1,22 @@ +/a.ts(1,15): error TS2303: Circular definition of import alias 'A'. +/a.ts(2,15): error TS2303: Circular definition of import alias 'B'. /b.ts(1,15): error TS2303: Circular definition of import alias 'B'. +/b.ts(2,15): error TS2303: Circular definition of import alias 'A'. -==== /a.ts (0 errors) ==== +==== /a.ts (2 errors) ==== import type { A } from './b'; + ~ +!!! error TS2303: Circular definition of import alias 'A'. export type { A as B }; + ~~~~~~ +!!! error TS2303: Circular definition of import alias 'B'. -==== /b.ts (1 errors) ==== +==== /b.ts (2 errors) ==== import type { B } from './a'; ~ !!! error TS2303: Circular definition of import alias 'B'. export type { B as A }; + ~~~~~~ +!!! error TS2303: Circular definition of import alias 'A'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/circular3.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/circular3.errors.txt.diff new file mode 100644 index 0000000000..c217af658d --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/circular3.errors.txt.diff @@ -0,0 +1,29 @@ +--- old.circular3.errors.txt ++++ new.circular3.errors.txt +@@= skipped -0, +0 lines =@@ ++/a.ts(1,15): error TS2303: Circular definition of import alias 'A'. ++/a.ts(2,15): error TS2303: Circular definition of import alias 'B'. + /b.ts(1,15): error TS2303: Circular definition of import alias 'B'. +- +- +-==== /a.ts (0 errors) ==== ++/b.ts(2,15): error TS2303: Circular definition of import alias 'A'. ++ ++ ++==== /a.ts (2 errors) ==== + import type { A } from './b'; ++ ~ ++!!! error TS2303: Circular definition of import alias 'A'. + export type { A as B }; ++ ~~~~~~ ++!!! error TS2303: Circular definition of import alias 'B'. + +-==== /b.ts (1 errors) ==== ++==== /b.ts (2 errors) ==== + import type { B } from './a'; + ~ + !!! error TS2303: Circular definition of import alias 'B'. + export type { B as A }; ++ ~~~~~~ ++!!! error TS2303: Circular definition of import alias 'A'. + \ No newline at end of file From da8e4e0fc03bcd4a60d2972ed4a9ea7180796906 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Oct 2025 22:02:57 +0000 Subject: [PATCH 37/69] Fix panic in textDocument/onTypeFormatting when tokenAtPosition is nil (#1845) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com> --- internal/ls/format.go | 3 +- internal/ls/format_test.go | 72 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 internal/ls/format_test.go diff --git a/internal/ls/format.go b/internal/ls/format.go index 548c766741..9e0f55cf19 100644 --- a/internal/ls/format.go +++ b/internal/ls/format.go @@ -113,7 +113,8 @@ func (l *LanguageService) getFormattingEditsAfterKeystroke( ) []core.TextChange { ctx = format.WithFormatCodeSettings(ctx, options, options.NewLineCharacter) - if isInComment(file, position, nil) == nil { + tokenAtPosition := astnav.GetTokenAtPosition(file, position) + if isInComment(file, position, tokenAtPosition) == nil { switch key { case "{": return format.FormatOnOpeningCurly(ctx, file, position) diff --git a/internal/ls/format_test.go b/internal/ls/format_test.go new file mode 100644 index 0000000000..b1f21d8fff --- /dev/null +++ b/internal/ls/format_test.go @@ -0,0 +1,72 @@ +package ls + +import ( + "context" + "testing" + + "github.com/microsoft/typescript-go/internal/ast" + "github.com/microsoft/typescript-go/internal/core" + "github.com/microsoft/typescript-go/internal/format" + "github.com/microsoft/typescript-go/internal/parser" +) + +// Test for issue: Panic Handling textDocument/onTypeFormatting +// This reproduces the panic when pressing enter in an empty file +func TestGetFormattingEditsAfterKeystroke_EmptyFile(t *testing.T) { + t.Parallel() + // Create an empty file + text := "" + sourceFile := parser.ParseSourceFile(ast.SourceFileParseOptions{ + FileName: "/index.ts", + Path: "/index.ts", + }, text, core.ScriptKindTS) + + // Create language service with nil program (we're only testing the formatting function) + langService := &LanguageService{} + + // Test formatting after keystroke with newline character at position 0 + ctx := context.Background() + options := format.GetDefaultFormatCodeSettings("\n") + + // This should not panic + edits := langService.getFormattingEditsAfterKeystroke( + ctx, + sourceFile, + options, + 0, // position + "\n", + ) + + // Should return nil or empty edits, not panic + _ = edits +} + +// Test with a simple statement +func TestGetFormattingEditsAfterKeystroke_SimpleStatement(t *testing.T) { + t.Parallel() + // Create a file with a simple statement + text := "const x = 1" + sourceFile := parser.ParseSourceFile(ast.SourceFileParseOptions{ + FileName: "/index.ts", + Path: "/index.ts", + }, text, core.ScriptKindTS) + + // Create language service with nil program + langService := &LanguageService{} + + // Test formatting after keystroke with newline character at end of statement + ctx := context.Background() + options := format.GetDefaultFormatCodeSettings("\n") + + // This should not panic + edits := langService.getFormattingEditsAfterKeystroke( + ctx, + sourceFile, + options, + len(text), // position at end of file + "\n", + ) + + // Should return nil or empty edits, not panic + _ = edits +} From fe0cafa1d1eaab50cbf7f132ceb27b005eba5dc9 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 20 Oct 2025 15:23:47 -0700 Subject: [PATCH 38/69] Update submodule (#1913) --- _submodules/TypeScript | 2 +- internal/diagnostics/diagnostics_generated.go | 2 +- internal/fourslash/_scripts/failingTests.txt | 1 - ...rs_StaticWhenBaseTypeIsNotResolved_test.go | 20 +---- ...orStringLiteralNonrelativeImport16_test.go | 1 + ...mpletionsImport_umdDefaultNoCrash2_test.go | 2 +- ...JsonModuleWithoutResolveJsonModule_test.go | 2 +- .../gen/completionsPathsJsonModule_test.go | 2 +- ...completionsPathsRelativeJsonModule_test.go | 2 +- .../gen/completionsPaths_importType_test.go | 2 +- .../gen/completionsWithDeprecatedTag9_test.go | 54 -------------- ...EqualNamespaceClassESModuleInterop_test.go | 2 +- ...encesBindingPatternInJsdocNoCrash1_test.go | 2 +- ...encesBindingPatternInJsdocNoCrash2_test.go | 2 +- ...hCompletionsTypesVersionsWildcard2_test.go | 1 + ...hCompletionsTypesVersionsWildcard3_test.go | 1 + ...hCompletionsTypesVersionsWildcard4_test.go | 1 + .../es6ExportEqualsInterop.errors.txt.diff | 74 ------------------- .../es6ExportEqualsInterop.types.diff | 43 ----------- ...6ImportDefaultBindingInEs5.errors.txt.diff | 16 ---- .../es6ImportDefaultBindingInEs5.types.diff | 8 -- ...xportEqualsDefaultProperty.errors.txt.diff | 21 ------ .../exportEqualsDefaultProperty.symbols.diff | 9 --- .../exportEqualsDefaultProperty.types.diff | 19 ----- .../jsxClassAttributeResolution.errors.txt | 2 +- .../compiler/jsxClassAttributeResolution.js | 2 +- .../moduleElementsInWrongContext.types.diff | 11 --- ...solutionWithSuffixes_empty.errors.txt.diff | 22 ++++++ ...nWithSuffixes_notSpecified.errors.txt.diff | 21 ++++++ ...ResolutionWithSuffixes_one.errors.txt.diff | 25 +++++++ ...utionWithSuffixes_oneBlank.errors.txt.diff | 23 ++++++ ...onWithSuffixes_oneNotFound.errors.txt.diff | 17 +++++ ...xes_one_dirModuleWithIndex.errors.txt.diff | 24 ++++++ ...uffixes_one_externalModule.errors.txt.diff | 39 ++++++++++ ...xes_one_externalModulePath.errors.txt.diff | 39 ++++++++++ ...fixes_one_externalTSModule.errors.txt.diff | 26 +++++++ ...ithSuffixes_one_jsonModule.errors.txt.diff | 33 +++++++++ ...Suffixes_threeLastIsBlank1.errors.txt.diff | 27 +++++++ ...Suffixes_threeLastIsBlank2.errors.txt.diff | 25 +++++++ ...Suffixes_threeLastIsBlank3.errors.txt.diff | 23 ++++++ ...Suffixes_threeLastIsBlank4.errors.txt.diff | 17 +++++ .../module_augmentUninstantiatedModule2.js | 42 ++++++++++- ...odule_augmentUninstantiatedModule2.js.diff | 10 +++ ...odule_augmentUninstantiatedModule2.symbols | 51 ++++++++++--- .../module_augmentUninstantiatedModule2.types | 32 +++++++- ...le_augmentUninstantiatedModule2.types.diff | 18 ----- .../reexportMissingDefault4.errors.txt.diff | 16 ---- .../reexportMissingDefault4.types.diff | 8 -- ...duleNodeResolutionEmitNone.errors.txt.diff | 2 + ...leWithoutResolveJsonModule.errors.txt.diff | 62 +++++++--------- ...OfJsonFileWithoutResolveJsonModule.js.diff | 7 +- ...nFileWithoutResolveJsonModule.symbols.diff | 12 --- ...sonFileWithoutResolveJsonModule.types.diff | 47 ------------ ...(moduleresolution=bundler).errors.txt.diff | 16 ---- ...Field2(moduleresolution=node10).errors.txt | 25 ------- ...kageJsonField2(moduleresolution=node10).js | 21 ------ ...sonField2(moduleresolution=node10).symbols | 17 ----- ...eJsonField2(moduleresolution=node10).types | 18 ----- ...CandidateFromPackageJsonField2.errors.txt} | 0 ...solutionCandidateFromPackageJsonField2.js} | 0 ...ionCandidateFromPackageJsonField2.symbols} | 0 ...utionCandidateFromPackageJsonField2.types} | 0 ...ngExports(module=commonjs).errors.txt.diff | 21 ------ ...(moduleresolution=bundler).errors.txt.diff | 11 --- ...nsions(moduleresolution=node10).errors.txt | 32 -------- .../conformance/bundlerCommonJS.errors.txt | 35 +++++++++ .../submodule/conformance/bundlerCommonJS.js | 45 +++++++++++ .../conformance/bundlerCommonJS.js.diff | 17 +++++ .../conformance/bundlerCommonJS.trace.json | 55 ++++++++++++++ ...,moduleresolution=bundler).errors.txt.diff | 4 +- ...,moduleresolution=bundler).errors.txt.diff | 4 +- ...,moduleresolution=bundler).errors.txt.diff | 4 +- .../bundlerOptionsCompat.errors.txt | 16 ++++ .../bundlerOptionsCompat.errors.txt.diff | 30 ++++---- ...ingPriority(moduleresolution=node).symbols | 25 ------- ...adingPriority(moduleresolution=node).types | 25 ------- ...CallExpressionInExportEqualsCJS.types.diff | 15 ---- ...cifierGenerationConditions.errors.txt.diff | 39 ---------- ...portsSpecifierGenerationConditions.js.diff | 7 +- ...tsSpecifierGenerationConditions.types.diff | 14 ---- ...(moduleresolution=bundler).errors.txt.diff | 32 -------- .../node10IsNode_node.errors.txt.diff | 28 +++++++ .../node10IsNode_node10.types.diff | 12 --- ...(moduleresolution=bundler).errors.txt.diff | 10 --- ...pat(moduleresolution=node).errors.txt.diff | 2 + ...1(moduleresolution=node10).errors.txt.diff | 46 ------------ ...portType1(moduleresolution=node10).symbols | 36 --------- ...ype1(moduleresolution=node10).symbols.diff | 10 --- ...ImportType1(moduleresolution=node10).types | 37 ---------- ...tType1(moduleresolution=node10).types.diff | 11 --- ...resolutionModeTripleSlash4.errors.txt.diff | 12 ++- ...resolutionModeTripleSlash5.errors.txt.diff | 18 +++++ ...1(moduleresolution=node10).errors.txt.diff | 60 --------------- ...ypeOnlyImport1(moduleresolution=node10).js | 62 ---------------- ...lyImport1(moduleresolution=node10).symbols | 73 ------------------ ...ort1(moduleresolution=node10).symbols.diff | 15 ---- ...OnlyImport1(moduleresolution=node10).types | 74 ------------------- ...mport1(moduleresolution=node10).types.diff | 22 ------ .../untypedModuleImport_allowJs.symbols.diff | 9 ++- ...ESM(esmoduleinterop=false).errors.txt.diff | 25 ------- ...tionsESM(esmoduleinterop=false).types.diff | 11 --- ...rmatEmit1(module=commonjs).errors.txt.diff | 41 ---------- ...rmatEmit2(module=commonjs).errors.txt.diff | 44 ----------- ...rmatEmit3(module=commonjs).errors.txt.diff | 46 ------------ ...rmatEmit4(module=commonjs).errors.txt.diff | 46 ------------ ...riptImportDefaultBadExport.errors.txt.diff | 17 ----- ...avascriptImportDefaultBadExport.types.diff | 5 -- ...onWithExtensions_withPaths.errors.txt.diff | 61 +++++---------- ...e_externalModule_withPaths.errors.txt.diff | 58 ++++++--------- ...nWithSuffixes_one_jsModule.errors.txt.diff | 34 +++++++++ ...(moduleresolution=bundler).errors.txt.diff | 24 ------ ...Priority(moduleresolution=node).types.diff | 8 -- ...ternateResult_noResolution.errors.txt.diff | 12 ++- ...e10Alternateresult_noTypes.errors.txt.diff | 4 +- ...ntypedModuleImport_allowJs.errors.txt.diff | 16 ++++ .../untypedModuleImport_allowJs.types.diff | 21 ++++++ 116 files changed, 906 insertions(+), 1604 deletions(-) delete mode 100644 internal/fourslash/tests/gen/completionsWithDeprecatedTag9_test.go delete mode 100644 testdata/baselines/reference/submodule/compiler/es6ExportEqualsInterop.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/es6ExportEqualsInterop.types.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/es6ImportDefaultBindingInEs5.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/es6ImportDefaultBindingInEs5.types.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/exportEqualsDefaultProperty.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/exportEqualsDefaultProperty.symbols.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/exportEqualsDefaultProperty.types.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/moduleElementsInWrongContext.types.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_empty.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_notSpecified.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_oneBlank.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_oneNotFound.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_dirModuleWithIndex.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModule.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModulePath.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalTSModule.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsonModule.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank1.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank2.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank3.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank4.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.js.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.types.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/reexportMissingDefault4.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/reexportMissingDefault4.types.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModule.symbols.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModule.types.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=node10).errors.txt delete mode 100644 testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=node10).js delete mode 100644 testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=node10).symbols delete mode 100644 testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=node10).types rename testdata/baselines/reference/submodule/compiler/{resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).errors.txt => resolutionCandidateFromPackageJsonField2.errors.txt} (100%) rename testdata/baselines/reference/submodule/compiler/{resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).js => resolutionCandidateFromPackageJsonField2.js} (100%) rename testdata/baselines/reference/submodule/compiler/{resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).symbols => resolutionCandidateFromPackageJsonField2.symbols} (100%) rename testdata/baselines/reference/submodule/compiler/{resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).types => resolutionCandidateFromPackageJsonField2.types} (100%) delete mode 100644 testdata/baselines/reference/submodule/compiler/tripleSlashTypesReferenceWithMissingExports(module=commonjs).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/allowImportingTsExtensions(moduleresolution=bundler).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/allowImportingTsExtensions(moduleresolution=node10).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/bundlerCommonJS.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/bundlerCommonJS.js create mode 100644 testdata/baselines/reference/submodule/conformance/bundlerCommonJS.js.diff create mode 100644 testdata/baselines/reference/submodule/conformance/bundlerCommonJS.trace.json create mode 100644 testdata/baselines/reference/submodule/conformance/bundlerOptionsCompat.errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/extensionLoadingPriority(moduleresolution=node).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/extensionLoadingPriority(moduleresolution=node).types delete mode 100644 testdata/baselines/reference/submodule/conformance/importCallExpressionInExportEqualsCJS.types.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.types.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/nestedPackageJsonRedirect(moduleresolution=bundler).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/node10IsNode_node.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/node10IsNode_node10.types.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/packageJsonImportsExportsOptionCompat(moduleresolution=bundler).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).symbols.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).types delete mode 100644 testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/resolutionModeTripleSlash5.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).js delete mode 100644 testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).symbols.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).types delete mode 100644 testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).types.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/verbatimModuleSyntaxRestrictionsESM(esmoduleinterop=false).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/verbatimModuleSyntaxRestrictionsESM(esmoduleinterop=false).types.diff delete mode 100644 testdata/baselines/reference/submoduleAccepted/compiler/impliedNodeFormatEmit1(module=commonjs).errors.txt.diff delete mode 100644 testdata/baselines/reference/submoduleAccepted/compiler/impliedNodeFormatEmit2(module=commonjs).errors.txt.diff delete mode 100644 testdata/baselines/reference/submoduleAccepted/compiler/impliedNodeFormatEmit3(module=commonjs).errors.txt.diff delete mode 100644 testdata/baselines/reference/submoduleAccepted/compiler/impliedNodeFormatEmit4(module=commonjs).errors.txt.diff delete mode 100644 testdata/baselines/reference/submoduleAccepted/compiler/javascriptImportDefaultBadExport.errors.txt.diff create mode 100644 testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithSuffixes_one_jsModule.errors.txt.diff delete mode 100644 testdata/baselines/reference/submoduleAccepted/conformance/extensionLoadingPriority(moduleresolution=bundler).errors.txt.diff delete mode 100644 testdata/baselines/reference/submoduleAccepted/conformance/extensionLoadingPriority(moduleresolution=node).types.diff create mode 100644 testdata/baselines/reference/submoduleAccepted/conformance/untypedModuleImport_allowJs.errors.txt.diff create mode 100644 testdata/baselines/reference/submoduleAccepted/conformance/untypedModuleImport_allowJs.types.diff diff --git a/_submodules/TypeScript b/_submodules/TypeScript index 1ee9e0d9a2..050a6f8127 160000 --- a/_submodules/TypeScript +++ b/_submodules/TypeScript @@ -1 +1 @@ -Subproject commit 1ee9e0d9a24b629da3a8cae2748616af1dc8fc0c +Subproject commit 050a6f8127f54ce64c79ee992b9f0e27d0d712a2 diff --git a/internal/diagnostics/diagnostics_generated.go b/internal/diagnostics/diagnostics_generated.go index 5c32430d2b..c40232cb15 100644 --- a/internal/diagnostics/diagnostics_generated.go +++ b/internal/diagnostics/diagnostics_generated.go @@ -2326,7 +2326,7 @@ var Compiler_option_0_may_only_be_used_with_build = &Message{code: 5093, categor var Compiler_option_0_may_not_be_used_with_build = &Message{code: 5094, category: CategoryError, key: "Compiler_option_0_may_not_be_used_with_build_5094", text: "Compiler option '--{0}' may not be used with '--build'."} -var Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later = &Message{code: 5095, category: CategoryError, key: "Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095", text: "Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later."} +var Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later = &Message{code: 5095, category: CategoryError, key: "Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095", text: "Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later."} var Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set = &Message{code: 5096, category: CategoryError, key: "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", text: "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."} diff --git a/internal/fourslash/_scripts/failingTests.txt b/internal/fourslash/_scripts/failingTests.txt index 3aef9a7a9f..1db2b09ce7 100644 --- a/internal/fourslash/_scripts/failingTests.txt +++ b/internal/fourslash/_scripts/failingTests.txt @@ -16,7 +16,6 @@ TestCompletionEntryClassMembersWithInferredFunctionReturnType1 TestCompletionEntryForArgumentConstrainedToString TestCompletionEntryForArrayElementConstrainedToString TestCompletionEntryForArrayElementConstrainedToString2 -TestCompletionEntryForClassMembers_StaticWhenBaseTypeIsNotResolved TestCompletionEntryForUnionProperty TestCompletionEntryForUnionProperty2 TestCompletionForComputedStringProperties diff --git a/internal/fourslash/tests/gen/completionEntryForClassMembers_StaticWhenBaseTypeIsNotResolved_test.go b/internal/fourslash/tests/gen/completionEntryForClassMembers_StaticWhenBaseTypeIsNotResolved_test.go index 3f67b274df..3f78988212 100644 --- a/internal/fourslash/tests/gen/completionEntryForClassMembers_StaticWhenBaseTypeIsNotResolved_test.go +++ b/internal/fourslash/tests/gen/completionEntryForClassMembers_StaticWhenBaseTypeIsNotResolved_test.go @@ -10,25 +10,9 @@ import ( func TestCompletionEntryForClassMembers_StaticWhenBaseTypeIsNotResolved(t *testing.T) { t.Parallel() - t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") - const content = `// @Filename: /node_modules/@types/react/index.d.ts -export = React; -export as namespace React; -declare namespace React { - function createElement(): any; - interface Component

{ } - class Component { - static contextType?: any; - context: any; - constructor(props: Readonly

); - setState( - state: ((prevState: Readonly, props: Readonly

) => (Pick | S | null)) | (Pick | S | null), - callback?: () => void - ): void; - } -} -// @Filename: /a.ts + const content = `// @Filename: /a.ts import React from 'react' class Slider extends React.Component { static defau/**/ltProps = { diff --git a/internal/fourslash/tests/gen/completionForStringLiteralNonrelativeImport16_test.go b/internal/fourslash/tests/gen/completionForStringLiteralNonrelativeImport16_test.go index be55991de2..a269f1a909 100644 --- a/internal/fourslash/tests/gen/completionForStringLiteralNonrelativeImport16_test.go +++ b/internal/fourslash/tests/gen/completionForStringLiteralNonrelativeImport16_test.go @@ -16,6 +16,7 @@ func TestCompletionForStringLiteralNonrelativeImport16(t *testing.T) { const content = `// @Filename: tsconfig.json { "compilerOptions": { + "resolveJsonModule": false, "baseUrl": "./", "paths": { "module1/path1": ["some/path/whatever.ts"], diff --git a/internal/fourslash/tests/gen/completionsImport_umdDefaultNoCrash2_test.go b/internal/fourslash/tests/gen/completionsImport_umdDefaultNoCrash2_test.go index 57ecd5cb67..64dc8a4459 100644 --- a/internal/fourslash/tests/gen/completionsImport_umdDefaultNoCrash2_test.go +++ b/internal/fourslash/tests/gen/completionsImport_umdDefaultNoCrash2_test.go @@ -13,7 +13,7 @@ func TestCompletionsImport_umdDefaultNoCrash2(t *testing.T) { t.Parallel() defer testutil.RecoverAndFail(t, "Panic on fourslash test") - const content = `// @moduleResolution: node + const content = `// @moduleResolution: bundler // @allowJs: true // @checkJs: true // @Filename: /node_modules/dottie/package.json diff --git a/internal/fourslash/tests/gen/completionsPathsJsonModuleWithoutResolveJsonModule_test.go b/internal/fourslash/tests/gen/completionsPathsJsonModuleWithoutResolveJsonModule_test.go index a66a4523b6..0da18ee5e1 100644 --- a/internal/fourslash/tests/gen/completionsPathsJsonModuleWithoutResolveJsonModule_test.go +++ b/internal/fourslash/tests/gen/completionsPathsJsonModuleWithoutResolveJsonModule_test.go @@ -12,7 +12,7 @@ func TestCompletionsPathsJsonModuleWithoutResolveJsonModule(t *testing.T) { t.Parallel() defer testutil.RecoverAndFail(t, "Panic on fourslash test") - const content = `// @moduleResolution: node + const content = `// @resolveJsonModule: false // @Filename: /project/test.json not read // @Filename: /project/index.ts diff --git a/internal/fourslash/tests/gen/completionsPathsJsonModule_test.go b/internal/fourslash/tests/gen/completionsPathsJsonModule_test.go index b713e79f35..bf86ca473b 100644 --- a/internal/fourslash/tests/gen/completionsPathsJsonModule_test.go +++ b/internal/fourslash/tests/gen/completionsPathsJsonModule_test.go @@ -13,7 +13,7 @@ func TestCompletionsPathsJsonModule(t *testing.T) { t.Parallel() t.Skip() defer testutil.RecoverAndFail(t, "Panic on fourslash test") - const content = `// @moduleResolution: node + const content = `// @moduleResolution: bundler // @resolveJsonModule: true // @Filename: /project/node_modules/test.json not read diff --git a/internal/fourslash/tests/gen/completionsPathsRelativeJsonModule_test.go b/internal/fourslash/tests/gen/completionsPathsRelativeJsonModule_test.go index 98803f175d..48d174cad0 100644 --- a/internal/fourslash/tests/gen/completionsPathsRelativeJsonModule_test.go +++ b/internal/fourslash/tests/gen/completionsPathsRelativeJsonModule_test.go @@ -13,7 +13,7 @@ func TestCompletionsPathsRelativeJsonModule(t *testing.T) { t.Parallel() t.Skip() defer testutil.RecoverAndFail(t, "Panic on fourslash test") - const content = `// @moduleResolution: node + const content = `// @moduleResolution: bundler // @resolveJsonModule: true // @Filename: /project/test.json not read diff --git a/internal/fourslash/tests/gen/completionsPaths_importType_test.go b/internal/fourslash/tests/gen/completionsPaths_importType_test.go index 3caae8585e..a0b677054e 100644 --- a/internal/fourslash/tests/gen/completionsPaths_importType_test.go +++ b/internal/fourslash/tests/gen/completionsPaths_importType_test.go @@ -14,7 +14,7 @@ func TestCompletionsPaths_importType(t *testing.T) { t.Skip() defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `// @allowJs: true -// @moduleResolution: node +// @moduleResolution: bundler // @Filename: /ns.ts file content not read // @Filename: /node_modules/package/index.ts diff --git a/internal/fourslash/tests/gen/completionsWithDeprecatedTag9_test.go b/internal/fourslash/tests/gen/completionsWithDeprecatedTag9_test.go deleted file mode 100644 index 3f86d91582..0000000000 --- a/internal/fourslash/tests/gen/completionsWithDeprecatedTag9_test.go +++ /dev/null @@ -1,54 +0,0 @@ -package fourslash_test - -import ( - "testing" - - "github.com/microsoft/typescript-go/internal/fourslash" - . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" - "github.com/microsoft/typescript-go/internal/ls" - "github.com/microsoft/typescript-go/internal/lsp/lsproto" - "github.com/microsoft/typescript-go/internal/testutil" -) - -func TestCompletionsWithDeprecatedTag9(t *testing.T) { - t.Parallel() - - defer testutil.RecoverAndFail(t, "Panic on fourslash test") - const content = `// @lib: dom -// @allowJs: true -// @Filename: globals.d.ts -/** @deprecated foo */ -declare var foo: string; -// @Filename: index.ts -class Foo { - foo: number; - m() { - foo/**/ - } -}` - f := fourslash.NewFourslash(t, nil /*capabilities*/, content) - f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ - IsIncomplete: false, - ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ - CommitCharacters: &DefaultCommitCharacters, - EditRange: Ignored, - }, - Items: &fourslash.CompletionsExpectedItems{ - Includes: []fourslash.CompletionsExpectedItem{ - &lsproto.CompletionItem{ - Label: "foo", - Kind: PtrTo(lsproto.CompletionItemKindVariable), - SortText: PtrTo(string(ls.DeprecateSortText(ls.SortTextGlobalsOrKeywords))), - }, - }, - }, - }) - f.VerifyCompletions(t, nil, &fourslash.CompletionsExpectedList{ - IsIncomplete: false, - ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ - CommitCharacters: &DefaultCommitCharacters, - EditRange: Ignored, - }, - Items: &fourslash.CompletionsExpectedItems{}, - }) -} diff --git a/internal/fourslash/tests/gen/exportEqualNamespaceClassESModuleInterop_test.go b/internal/fourslash/tests/gen/exportEqualNamespaceClassESModuleInterop_test.go index 32f1db0ff0..b610460f44 100644 --- a/internal/fourslash/tests/gen/exportEqualNamespaceClassESModuleInterop_test.go +++ b/internal/fourslash/tests/gen/exportEqualNamespaceClassESModuleInterop_test.go @@ -13,7 +13,7 @@ func TestExportEqualNamespaceClassESModuleInterop(t *testing.T) { defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `// @esModuleInterop: true -// @moduleResolution: node +// @moduleResolution: bundler // @target: es2015 // @module: esnext // @Filename: /node_modules/@bar/foo/index.d.ts diff --git a/internal/fourslash/tests/gen/findReferencesBindingPatternInJsdocNoCrash1_test.go b/internal/fourslash/tests/gen/findReferencesBindingPatternInJsdocNoCrash1_test.go index b219b100e5..d12c4f724b 100644 --- a/internal/fourslash/tests/gen/findReferencesBindingPatternInJsdocNoCrash1_test.go +++ b/internal/fourslash/tests/gen/findReferencesBindingPatternInJsdocNoCrash1_test.go @@ -11,7 +11,7 @@ func TestFindReferencesBindingPatternInJsdocNoCrash1(t *testing.T) { t.Parallel() t.Skip() defer testutil.RecoverAndFail(t, "Panic on fourslash test") - const content = `// @moduleResolution: node + const content = `// @moduleResolution: bundler // @Filename: node_modules/use-query/package.json { "name": "use-query", diff --git a/internal/fourslash/tests/gen/findReferencesBindingPatternInJsdocNoCrash2_test.go b/internal/fourslash/tests/gen/findReferencesBindingPatternInJsdocNoCrash2_test.go index 1fcafea499..94b4584713 100644 --- a/internal/fourslash/tests/gen/findReferencesBindingPatternInJsdocNoCrash2_test.go +++ b/internal/fourslash/tests/gen/findReferencesBindingPatternInJsdocNoCrash2_test.go @@ -11,7 +11,7 @@ func TestFindReferencesBindingPatternInJsdocNoCrash2(t *testing.T) { t.Parallel() t.Skip() defer testutil.RecoverAndFail(t, "Panic on fourslash test") - const content = `// @moduleResolution: node + const content = `// @moduleResolution: bundler // @Filename: node_modules/use-query/package.json { "name": "use-query", diff --git a/internal/fourslash/tests/gen/pathCompletionsTypesVersionsWildcard2_test.go b/internal/fourslash/tests/gen/pathCompletionsTypesVersionsWildcard2_test.go index 558efd2c05..7f60525520 100644 --- a/internal/fourslash/tests/gen/pathCompletionsTypesVersionsWildcard2_test.go +++ b/internal/fourslash/tests/gen/pathCompletionsTypesVersionsWildcard2_test.go @@ -13,6 +13,7 @@ func TestPathCompletionsTypesVersionsWildcard2(t *testing.T) { t.Skip() defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `// @module: commonjs +// @resolveJsonModule: false // @Filename: /node_modules/foo/package.json { "types": "index.d.ts", diff --git a/internal/fourslash/tests/gen/pathCompletionsTypesVersionsWildcard3_test.go b/internal/fourslash/tests/gen/pathCompletionsTypesVersionsWildcard3_test.go index 8d63214eea..d8f8688a88 100644 --- a/internal/fourslash/tests/gen/pathCompletionsTypesVersionsWildcard3_test.go +++ b/internal/fourslash/tests/gen/pathCompletionsTypesVersionsWildcard3_test.go @@ -13,6 +13,7 @@ func TestPathCompletionsTypesVersionsWildcard3(t *testing.T) { t.Skip() defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `// @module: commonjs +// @resolveJsonModule: false // @Filename: /node_modules/foo/package.json { "types": "index.d.ts", diff --git a/internal/fourslash/tests/gen/pathCompletionsTypesVersionsWildcard4_test.go b/internal/fourslash/tests/gen/pathCompletionsTypesVersionsWildcard4_test.go index 320a68bfb2..d9f83bb7be 100644 --- a/internal/fourslash/tests/gen/pathCompletionsTypesVersionsWildcard4_test.go +++ b/internal/fourslash/tests/gen/pathCompletionsTypesVersionsWildcard4_test.go @@ -13,6 +13,7 @@ func TestPathCompletionsTypesVersionsWildcard4(t *testing.T) { t.Skip() defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `// @module: commonjs +// @resolveJsonModule: false // @Filename: /node_modules/foo/package.json { "types": "index.d.ts", diff --git a/testdata/baselines/reference/submodule/compiler/es6ExportEqualsInterop.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/es6ExportEqualsInterop.errors.txt.diff deleted file mode 100644 index 8120ad3982..0000000000 --- a/testdata/baselines/reference/submodule/compiler/es6ExportEqualsInterop.errors.txt.diff +++ /dev/null @@ -1,74 +0,0 @@ ---- old.es6ExportEqualsInterop.errors.txt -+++ new.es6ExportEqualsInterop.errors.txt -@@= skipped -0, +0 lines =@@ - main.ts(15,1): error TS2693: 'z1' only refers to a type, but is being used as a value here. - main.ts(21,4): error TS2339: Property 'a' does not exist on type '() => any'. - main.ts(23,4): error TS2339: Property 'a' does not exist on type 'typeof Foo'. --main.ts(27,8): error TS1259: Module '"interface"' can only be default-imported using the 'esModuleInterop' flag --main.ts(28,8): error TS1259: Module '"variable"' can only be default-imported using the 'esModuleInterop' flag --main.ts(29,8): error TS1259: Module '"interface-variable"' can only be default-imported using the 'esModuleInterop' flag --main.ts(30,8): error TS1259: Module '"module"' can only be default-imported using the 'esModuleInterop' flag --main.ts(31,8): error TS1259: Module '"interface-module"' can only be default-imported using the 'esModuleInterop' flag --main.ts(32,8): error TS1259: Module '"variable-module"' can only be default-imported using the 'esModuleInterop' flag --main.ts(33,8): error TS1259: Module '"function"' can only be default-imported using the 'esModuleInterop' flag --main.ts(34,8): error TS1259: Module '"function-module"' can only be default-imported using the 'esModuleInterop' flag --main.ts(35,8): error TS1259: Module '"class"' can only be default-imported using the 'esModuleInterop' flag --main.ts(36,8): error TS1259: Module '"class-module"' can only be default-imported using the 'esModuleInterop' flag - main.ts(39,21): error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. - main.ts(45,21): error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. - main.ts(47,21): error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. -@@= skipped -40, +30 lines =@@ - main.ts(106,15): error TS2498: Module '"class-module"' uses 'export =' and cannot be used with 'export *'. - - --==== main.ts (41 errors) ==== -+==== main.ts (31 errors) ==== - /// - - // import-equals -@@= skipped -34, +34 lines =@@ - - // default import - import x1 from "interface"; -- ~~ --!!! error TS1259: Module '"interface"' can only be default-imported using the 'esModuleInterop' flag --!!! related TS2594 modules.d.ts:6:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag. - import x2 from "variable"; -- ~~ --!!! error TS1259: Module '"variable"' can only be default-imported using the 'esModuleInterop' flag --!!! related TS2594 modules.d.ts:14:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag. - import x3 from "interface-variable"; -- ~~ --!!! error TS1259: Module '"interface-variable"' can only be default-imported using the 'esModuleInterop' flag --!!! related TS2594 modules.d.ts:26:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag. - import x4 from "module"; -- ~~ --!!! error TS1259: Module '"module"' can only be default-imported using the 'esModuleInterop' flag --!!! related TS2594 modules.d.ts:34:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag. - import x5 from "interface-module"; -- ~~ --!!! error TS1259: Module '"interface-module"' can only be default-imported using the 'esModuleInterop' flag --!!! related TS2594 modules.d.ts:46:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag. - import x6 from "variable-module"; -- ~~ --!!! error TS1259: Module '"variable-module"' can only be default-imported using the 'esModuleInterop' flag --!!! related TS2594 modules.d.ts:60:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag. - import x7 from "function"; -- ~~ --!!! error TS1259: Module '"function"' can only be default-imported using the 'esModuleInterop' flag --!!! related TS2594 modules.d.ts:65:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag. - import x8 from "function-module"; -- ~~ --!!! error TS1259: Module '"function-module"' can only be default-imported using the 'esModuleInterop' flag --!!! related TS2594 modules.d.ts:74:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag. - import x9 from "class"; -- ~~ --!!! error TS1259: Module '"class"' can only be default-imported using the 'esModuleInterop' flag --!!! related TS2594 modules.d.ts:82:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag. - import x0 from "class-module"; -- ~~ --!!! error TS1259: Module '"class-module"' can only be default-imported using the 'esModuleInterop' flag --!!! related TS2594 modules.d.ts:94:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag. - - // namespace import - import * as y1 from "interface"; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/es6ExportEqualsInterop.types.diff b/testdata/baselines/reference/submodule/compiler/es6ExportEqualsInterop.types.diff deleted file mode 100644 index d79de05db2..0000000000 --- a/testdata/baselines/reference/submodule/compiler/es6ExportEqualsInterop.types.diff +++ /dev/null @@ -1,43 +0,0 @@ ---- old.es6ExportEqualsInterop.types -+++ new.es6ExportEqualsInterop.types -@@= skipped -88, +88 lines =@@ - >x1 : any - - import x2 from "variable"; -->x2 : any -+>x2 : { a: number; b: number; } - - import x3 from "interface-variable"; -->x3 : any -+>x3 : { a: number; b: number; } - - import x4 from "module"; -->x4 : any -+>x4 : typeof z4 - - import x5 from "interface-module"; -->x5 : any -+>x5 : typeof z5 - - import x6 from "variable-module"; -->x6 : any -+>x6 : { a: number; b: number; } - - import x7 from "function"; -->x7 : any -+>x7 : () => any - - import x8 from "function-module"; -->x8 : any -+>x8 : typeof z8 - - import x9 from "class"; -->x9 : any -+>x9 : typeof z9 - - import x0 from "class-module"; -->x0 : any -+>x0 : typeof z0 - - // namespace import - import * as y1 from "interface"; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/es6ImportDefaultBindingInEs5.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/es6ImportDefaultBindingInEs5.errors.txt.diff deleted file mode 100644 index 2e5b58dc1b..0000000000 --- a/testdata/baselines/reference/submodule/compiler/es6ImportDefaultBindingInEs5.errors.txt.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- old.es6ImportDefaultBindingInEs5.errors.txt -+++ new.es6ImportDefaultBindingInEs5.errors.txt -@@= skipped -0, +0 lines =@@ --es6ImportDefaultBindingInEs5_1.ts(1,8): error TS1259: Module '"es6ImportDefaultBindingInEs5_0"' can only be default-imported using the 'esModuleInterop' flag -- -- --==== es6ImportDefaultBindingInEs5_0.ts (0 errors) ==== -- var a = 10; -- export = a; -- --==== es6ImportDefaultBindingInEs5_1.ts (1 errors) ==== -- import defaultBinding from "./es6ImportDefaultBindingInEs5_0"; -- ~~~~~~~~~~~~~~ --!!! error TS1259: Module '"es6ImportDefaultBindingInEs5_0"' can only be default-imported using the 'esModuleInterop' flag --!!! related TS2594 es6ImportDefaultBindingInEs5_0.ts:2:1: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag. -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/es6ImportDefaultBindingInEs5.types.diff b/testdata/baselines/reference/submodule/compiler/es6ImportDefaultBindingInEs5.types.diff deleted file mode 100644 index 2ba3f20ec6..0000000000 --- a/testdata/baselines/reference/submodule/compiler/es6ImportDefaultBindingInEs5.types.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.es6ImportDefaultBindingInEs5.types -+++ new.es6ImportDefaultBindingInEs5.types -@@= skipped -9, +9 lines =@@ - - === es6ImportDefaultBindingInEs5_1.ts === - import defaultBinding from "./es6ImportDefaultBindingInEs5_0"; -->defaultBinding : any -+>defaultBinding : number diff --git a/testdata/baselines/reference/submodule/compiler/exportEqualsDefaultProperty.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/exportEqualsDefaultProperty.errors.txt.diff deleted file mode 100644 index 3c2bc80adf..0000000000 --- a/testdata/baselines/reference/submodule/compiler/exportEqualsDefaultProperty.errors.txt.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.exportEqualsDefaultProperty.errors.txt -+++ new.exportEqualsDefaultProperty.errors.txt -@@= skipped -0, +0 lines =@@ -- -+imp.ts(2,5): error TS2339: Property 'toExponential' does not exist on type '{ greeting: string; default: number; }'. -+ -+ -+==== exp.ts (0 errors) ==== -+ var x = { -+ "greeting": "hello, world", -+ "default": 42 -+ }; -+ -+ export = x -+ -+==== imp.ts (1 errors) ==== -+ import foo from "./exp"; -+ foo.toExponential(2); -+ ~~~~~~~~~~~~~ -+!!! error TS2339: Property 'toExponential' does not exist on type '{ greeting: string; default: number; }'. -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/exportEqualsDefaultProperty.symbols.diff b/testdata/baselines/reference/submodule/compiler/exportEqualsDefaultProperty.symbols.diff deleted file mode 100644 index 35de9ce474..0000000000 --- a/testdata/baselines/reference/submodule/compiler/exportEqualsDefaultProperty.symbols.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.exportEqualsDefaultProperty.symbols -+++ new.exportEqualsDefaultProperty.symbols -@@= skipped -19, +19 lines =@@ - >foo : Symbol(foo, Decl(imp.ts, 0, 6)) - - foo.toExponential(2); -->foo.toExponential : Symbol(Number.toExponential, Decl(lib.es5.d.ts, --, --)) - >foo : Symbol(foo, Decl(imp.ts, 0, 6)) -->toExponential : Symbol(Number.toExponential, Decl(lib.es5.d.ts, --, --)) diff --git a/testdata/baselines/reference/submodule/compiler/exportEqualsDefaultProperty.types.diff b/testdata/baselines/reference/submodule/compiler/exportEqualsDefaultProperty.types.diff deleted file mode 100644 index 6b7846da27..0000000000 --- a/testdata/baselines/reference/submodule/compiler/exportEqualsDefaultProperty.types.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- old.exportEqualsDefaultProperty.types -+++ new.exportEqualsDefaultProperty.types -@@= skipped -19, +19 lines =@@ - - === imp.ts === - import foo from "./exp"; -->foo : number -+>foo : { greeting: string; default: number; } - - foo.toExponential(2); -->foo.toExponential(2) : string -->foo.toExponential : (fractionDigits?: number) => string -->foo : number -->toExponential : (fractionDigits?: number) => string -+>foo.toExponential(2) : any -+>foo.toExponential : any -+>foo : { greeting: string; default: number; } -+>toExponential : any - >2 : 2 diff --git a/testdata/baselines/reference/submodule/compiler/jsxClassAttributeResolution.errors.txt b/testdata/baselines/reference/submodule/compiler/jsxClassAttributeResolution.errors.txt index c8e84730f2..384c3e74b4 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxClassAttributeResolution.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsxClassAttributeResolution.errors.txt @@ -14,7 +14,7 @@ file.tsx(2,19): error TS2322: Type '{}' is not assignable to type 'IntrinsicClas "name": "@types/react", "version": "0.0.1", "main": "", - "types": "index.d.ts", + "types": "index.d.ts" } ==== node_modules/@types/react/index.d.ts (0 errors) ==== interface IntrinsicClassAttributesAlias { diff --git a/testdata/baselines/reference/submodule/compiler/jsxClassAttributeResolution.js b/testdata/baselines/reference/submodule/compiler/jsxClassAttributeResolution.js index 0b71ffe9f6..474c490d7e 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxClassAttributeResolution.js +++ b/testdata/baselines/reference/submodule/compiler/jsxClassAttributeResolution.js @@ -8,7 +8,7 @@ export const a = ; "name": "@types/react", "version": "0.0.1", "main": "", - "types": "index.d.ts", + "types": "index.d.ts" } //// [index.d.ts] interface IntrinsicClassAttributesAlias { diff --git a/testdata/baselines/reference/submodule/compiler/moduleElementsInWrongContext.types.diff b/testdata/baselines/reference/submodule/compiler/moduleElementsInWrongContext.types.diff deleted file mode 100644 index 9e70d381f4..0000000000 --- a/testdata/baselines/reference/submodule/compiler/moduleElementsInWrongContext.types.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.moduleElementsInWrongContext.types -+++ new.moduleElementsInWrongContext.types -@@= skipped -50, +50 lines =@@ - >Foo : typeof Foo - - import bar from "ambient"; -->bar : any -+>bar : typeof Foo - - import { baz } from "ambient"; - >baz : any \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_empty.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_empty.errors.txt.diff new file mode 100644 index 0000000000..2f2399daf6 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_empty.errors.txt.diff @@ -0,0 +1,22 @@ +--- old.moduleResolutionWithSuffixes_empty.errors.txt ++++ new.moduleResolutionWithSuffixes_empty.errors.txt +@@= skipped -0, +0 lines =@@ +-/tsconfig.json(3,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- +- +-==== /tsconfig.json (1 errors) ==== +- { +- "compilerOptions": { +- "moduleResolution": "node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- "traceResolution": true, +- "moduleSuffixes": [] +- } +- } +-==== /index.ts (0 errors) ==== +- import { base } from "./foo"; +-==== /foo.ts (0 errors) ==== +- export function base() {} +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_notSpecified.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_notSpecified.errors.txt.diff new file mode 100644 index 0000000000..2f26d2d13f --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_notSpecified.errors.txt.diff @@ -0,0 +1,21 @@ +--- old.moduleResolutionWithSuffixes_notSpecified.errors.txt ++++ new.moduleResolutionWithSuffixes_notSpecified.errors.txt +@@= skipped -0, +0 lines =@@ +-/tsconfig.json(3,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- +- +-==== /tsconfig.json (1 errors) ==== +- { +- "compilerOptions": { +- "moduleResolution": "node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- "traceResolution": true, +- } +- } +-==== /index.ts (0 errors) ==== +- import { base } from "./foo"; +-==== /foo.ts (0 errors) ==== +- export function base() {} +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one.errors.txt.diff new file mode 100644 index 0000000000..7965155fa6 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one.errors.txt.diff @@ -0,0 +1,25 @@ +--- old.moduleResolutionWithSuffixes_one.errors.txt ++++ new.moduleResolutionWithSuffixes_one.errors.txt +@@= skipped -0, +0 lines =@@ +-/tsconfig.json(3,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- +- +-==== /tsconfig.json (1 errors) ==== +- { +- "compilerOptions": { +- "moduleResolution": "node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- "traceResolution": true, +- "moduleSuffixes": [".ios"] +- } +- } +- +-==== /index.ts (0 errors) ==== +- import { ios } from "./foo"; +-==== /foo.ios.ts (0 errors) ==== +- export function ios() {} +-==== /foo.ts (0 errors) ==== +- export function base() {} +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_oneBlank.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_oneBlank.errors.txt.diff new file mode 100644 index 0000000000..b4268cd42f --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_oneBlank.errors.txt.diff @@ -0,0 +1,23 @@ +--- old.moduleResolutionWithSuffixes_oneBlank.errors.txt ++++ new.moduleResolutionWithSuffixes_oneBlank.errors.txt +@@= skipped -0, +0 lines =@@ +-/tsconfig.json(3,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- +- +-==== /tsconfig.json (1 errors) ==== +- { +- "compilerOptions": { +- "moduleResolution": "node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- "traceResolution": true, +- "moduleSuffixes": [""] +- } +- } +- +-==== /index.ts (0 errors) ==== +- import { base } from "./foo"; +-==== /foo.ts (0 errors) ==== +- export function base() {} +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_oneNotFound.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_oneNotFound.errors.txt.diff new file mode 100644 index 0000000000..779eeea7dd --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_oneNotFound.errors.txt.diff @@ -0,0 +1,17 @@ +--- old.moduleResolutionWithSuffixes_oneNotFound.errors.txt ++++ new.moduleResolutionWithSuffixes_oneNotFound.errors.txt +@@= skipped -0, +0 lines =@@ +-/tsconfig.json(3,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + /index.ts(1,21): error TS2307: Cannot find module './foo' or its corresponding type declarations. + + +-==== /tsconfig.json (1 errors) ==== ++==== /tsconfig.json (0 errors) ==== + { + "compilerOptions": { + "moduleResolution": "node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + "traceResolution": true, + "moduleSuffixes": [".ios"] + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_dirModuleWithIndex.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_dirModuleWithIndex.errors.txt.diff new file mode 100644 index 0000000000..69ab38bf7a --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_dirModuleWithIndex.errors.txt.diff @@ -0,0 +1,24 @@ +--- old.moduleResolutionWithSuffixes_one_dirModuleWithIndex.errors.txt ++++ new.moduleResolutionWithSuffixes_one_dirModuleWithIndex.errors.txt +@@= skipped -0, +0 lines =@@ +-/tsconfig.json(3,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- +- +-==== /tsconfig.json (1 errors) ==== +- { +- "compilerOptions": { +- "moduleResolution": "node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- "traceResolution": true, +- "moduleSuffixes": [".ios"] +- } +- } +- +-==== /index.ts (0 errors) ==== +- import { ios } from "./foo"; +-==== /foo/index.ios.ts (0 errors) ==== +- export function ios() {} +-==== /foo/index.ts (0 errors) ==== +- export function base() {} ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModule.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModule.errors.txt.diff new file mode 100644 index 0000000000..e85122c087 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModule.errors.txt.diff @@ -0,0 +1,39 @@ +--- old.moduleResolutionWithSuffixes_one_externalModule.errors.txt ++++ new.moduleResolutionWithSuffixes_one_externalModule.errors.txt +@@= skipped -0, +0 lines =@@ +-/tsconfig.json(6,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- +- +-==== /tsconfig.json (1 errors) ==== +- { +- "compilerOptions": { +- "allowJs": true, +- "checkJs": false, +- "outDir": "bin", +- "moduleResolution": "node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- "traceResolution": true, +- "moduleSuffixes": [".ios"] +- } +- } +- +-==== /index.ts (0 errors) ==== +- import { ios } from "some-library"; +- +-==== /node_modules/some-library/index.ios.js (0 errors) ==== +- "use strict"; +- exports.__esModule = true; +- function ios() {} +- exports.ios = ios; +-==== /node_modules/some-library/index.ios.d.ts (0 errors) ==== +- export declare function ios(): void; +-==== /node_modules/some-library/index.js (0 errors) ==== +- "use strict"; +- exports.__esModule = true; +- function base() {} +- exports.base = base; +-==== /node_modules/some-library/index.d.ts (0 errors) ==== +- export declare function base(): void; +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModulePath.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModulePath.errors.txt.diff new file mode 100644 index 0000000000..c3459b508b --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalModulePath.errors.txt.diff @@ -0,0 +1,39 @@ +--- old.moduleResolutionWithSuffixes_one_externalModulePath.errors.txt ++++ new.moduleResolutionWithSuffixes_one_externalModulePath.errors.txt +@@= skipped -0, +0 lines =@@ +-/tsconfig.json(6,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- +- +-==== /tsconfig.json (1 errors) ==== +- { +- "compilerOptions": { +- "allowJs": true, +- "checkJs": false, +- "outDir": "bin", +- "moduleResolution": "node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- "traceResolution": true, +- "moduleSuffixes": [".ios"] +- } +- } +- +-==== /index.ts (0 errors) ==== +- import { iosfoo } from "some-library/foo"; +- +-==== /node_modules/some-library/foo.ios.js (0 errors) ==== +- "use strict"; +- exports.__esModule = true; +- function iosfoo() {} +- exports.iosfoo = iosfoo; +-==== /node_modules/some-library/foo.ios.d.ts (0 errors) ==== +- export declare function iosfoo(): void; +-==== /node_modules/some-library/foo.js (0 errors) ==== +- "use strict"; +- exports.__esModule = true; +- function basefoo() {} +- exports.basefoo = basefoo; +-==== /node_modules/some-library/foo.d.ts (0 errors) ==== +- export declare function basefoo(): void; +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalTSModule.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalTSModule.errors.txt.diff new file mode 100644 index 0000000000..156fb025fd --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_externalTSModule.errors.txt.diff @@ -0,0 +1,26 @@ +--- old.moduleResolutionWithSuffixes_one_externalTSModule.errors.txt ++++ new.moduleResolutionWithSuffixes_one_externalTSModule.errors.txt +@@= skipped -0, +0 lines =@@ +-/tsconfig.json(4,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- +- +-==== /tsconfig.json (1 errors) ==== +- { +- "compilerOptions": { +- "outDir": "bin", +- "moduleResolution": "node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- "traceResolution": true, +- "moduleSuffixes": [".ios"] +- } +- } +- +-==== /test.ts (0 errors) ==== +- import { ios } from "some-library"; +- +-==== /node_modules/some-library/index.ios.ts (0 errors) ==== +- export function ios() {} +-==== /node_modules/some-library/index.ts (0 errors) ==== +- export function base() {} ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsonModule.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsonModule.errors.txt.diff new file mode 100644 index 0000000000..cada164092 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsonModule.errors.txt.diff @@ -0,0 +1,33 @@ +--- old.moduleResolutionWithSuffixes_one_jsonModule.errors.txt ++++ new.moduleResolutionWithSuffixes_one_jsonModule.errors.txt +@@= skipped -0, +0 lines =@@ +-/tsconfig.json(6,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- +- +-==== /tsconfig.json (1 errors) ==== +- { +- "compilerOptions": { +- "esModuleInterop": true, +- "resolveJsonModule": true, +- "outDir": "bin", +- "moduleResolution": "node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- "traceResolution": true, +- "moduleSuffixes": [".ios"] +- } +- } +- +-==== /index.ts (0 errors) ==== +- import foo from "./foo.json"; +- console.log(foo.ios); +-==== /foo.ios.json (0 errors) ==== +- { +- "ios": "platform ios" +- } +-==== /foo.json (0 errors) ==== +- { +- "base": "platform base" +- } +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank1.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank1.errors.txt.diff new file mode 100644 index 0000000000..35f61639d6 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank1.errors.txt.diff @@ -0,0 +1,27 @@ +--- old.moduleResolutionWithSuffixes_threeLastIsBlank1.errors.txt ++++ new.moduleResolutionWithSuffixes_threeLastIsBlank1.errors.txt +@@= skipped -0, +0 lines =@@ +-/tsconfig.json(3,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- +- +-==== /tsconfig.json (1 errors) ==== +- { +- "compilerOptions": { +- "moduleResolution": "node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- "traceResolution": true, +- "moduleSuffixes": ["-ios", "__native", ""] +- } +- } +- +-==== /index.ts (0 errors) ==== +- import { ios } from "./foo"; +-==== /foo-ios.ts (0 errors) ==== +- export function ios() {} +-==== /foo__native.ts (0 errors) ==== +- export function native() {} +-==== /foo.ts (0 errors) ==== +- export function base() {} +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank2.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank2.errors.txt.diff new file mode 100644 index 0000000000..978953794a --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank2.errors.txt.diff @@ -0,0 +1,25 @@ +--- old.moduleResolutionWithSuffixes_threeLastIsBlank2.errors.txt ++++ new.moduleResolutionWithSuffixes_threeLastIsBlank2.errors.txt +@@= skipped -0, +0 lines =@@ +-/tsconfig.json(3,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- +- +-==== /tsconfig.json (1 errors) ==== +- { +- "compilerOptions": { +- "moduleResolution": "node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- "traceResolution": true, +- "moduleSuffixes": ["-ios", "__native", ""] +- } +- } +- +-==== /index.ts (0 errors) ==== +- import { native } from "./foo"; +-==== /foo__native.ts (0 errors) ==== +- export function native() {} +-==== /foo.ts (0 errors) ==== +- export function base() {} +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank3.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank3.errors.txt.diff new file mode 100644 index 0000000000..1672bb7aa0 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank3.errors.txt.diff @@ -0,0 +1,23 @@ +--- old.moduleResolutionWithSuffixes_threeLastIsBlank3.errors.txt ++++ new.moduleResolutionWithSuffixes_threeLastIsBlank3.errors.txt +@@= skipped -0, +0 lines =@@ +-/tsconfig.json(3,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- +- +-==== /tsconfig.json (1 errors) ==== +- { +- "compilerOptions": { +- "moduleResolution": "node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- "traceResolution": true, +- "moduleSuffixes": ["-ios", "__native", ""] +- } +- } +- +-==== /index.ts (0 errors) ==== +- import { base } from "./foo"; +-==== /foo.ts (0 errors) ==== +- export function base() {} +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank4.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank4.errors.txt.diff new file mode 100644 index 0000000000..79da8b925c --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_threeLastIsBlank4.errors.txt.diff @@ -0,0 +1,17 @@ +--- old.moduleResolutionWithSuffixes_threeLastIsBlank4.errors.txt ++++ new.moduleResolutionWithSuffixes_threeLastIsBlank4.errors.txt +@@= skipped -0, +0 lines =@@ +-/tsconfig.json(3,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + /index.ts(1,22): error TS2307: Cannot find module './foo' or its corresponding type declarations. + + +-==== /tsconfig.json (1 errors) ==== ++==== /tsconfig.json (0 errors) ==== + { + "compilerOptions": { + "moduleResolution": "node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + "traceResolution": true, + "moduleSuffixes": ["-ios", "__native", ""] + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.js b/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.js index 98c93b07b7..727cbed30c 100644 --- a/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.js +++ b/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.js @@ -1,8 +1,42 @@ //// [tests/cases/compiler/module_augmentUninstantiatedModule2.ts] //// -//// [module_augmentUninstantiatedModule2.ts] -declare var ng: ng.IAngularStatic; declare module ng { export interface IModule { name: string; } export interface IAngularStatic { module: (s: string) => IModule; } } export = ng; +//// [app.ts] +import ng = require("angular"); +import "./moduleAugmentation"; + +var x: number = ng.getNumber(); -//// [module_augmentUninstantiatedModule2.js] +//// [moduleAugmentation.ts] +import * as ng from "angular" +declare module "angular" { + export interface IAngularStatic { + getNumber: () => number; + } +} + +//// [index.d.ts] +declare var ng: ng.IAngularStatic; + +declare module ng { + export interface IModule { + name: string; + } + + export interface IAngularStatic { + module: (s: string) => IModule; + } +} + +export = ng; + + + +//// [moduleAugmentation.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//// [app.js] "use strict"; -module.exports = ng; +Object.defineProperty(exports, "__esModule", { value: true }); +const ng = require("angular"); +require("./moduleAugmentation"); +var x = ng.getNumber(); diff --git a/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.js.diff b/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.js.diff new file mode 100644 index 0000000000..314247865d --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.js.diff @@ -0,0 +1,10 @@ +--- old.module_augmentUninstantiatedModule2.js ++++ new.module_augmentUninstantiatedModule2.js +@@= skipped -36, +36 lines =@@ + //// [app.js] + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +-var ng = require("angular"); ++const ng = require("angular"); + require("./moduleAugmentation"); + var x = ng.getNumber(); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.symbols b/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.symbols index d8a3779193..17c284df01 100644 --- a/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.symbols +++ b/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.symbols @@ -1,32 +1,59 @@ //// [tests/cases/compiler/module_augmentUninstantiatedModule2.ts] //// -=== module_augmentUninstantiatedModule2.ts === +=== app.ts === +import ng = require("angular"); +>ng : Symbol(ng, Decl(app.ts, 0, 0)) + +import "./moduleAugmentation"; + +var x: number = ng.getNumber(); +>x : Symbol(x, Decl(app.ts, 3, 3)) +>ng.getNumber : Symbol(ng.IAngularStatic.getNumber, Decl(moduleAugmentation.ts, 2, 37)) +>ng : Symbol(ng, Decl(app.ts, 0, 0)) +>getNumber : Symbol(ng.IAngularStatic.getNumber, Decl(moduleAugmentation.ts, 2, 37)) + +=== moduleAugmentation.ts === +import * as ng from "angular" +>ng : Symbol(ng, Decl(moduleAugmentation.ts, 0, 6)) + +declare module "angular" { +>"angular" : Symbol(ng, Decl(index.d.ts, 0, 11), Decl(index.d.ts, 0, 34), Decl(moduleAugmentation.ts, 0, 29)) + + export interface IAngularStatic { +>IAngularStatic : Symbol(IAngularStatic, Decl(index.d.ts, 5, 4), Decl(moduleAugmentation.ts, 1, 26)) + + getNumber: () => number; +>getNumber : Symbol(IAngularStatic.getNumber, Decl(moduleAugmentation.ts, 2, 37)) + } +} + +=== node_modules/angular/index.d.ts === declare var ng: ng.IAngularStatic; ->ng : Symbol(ng, Decl(module_augmentUninstantiatedModule2.ts, 0, 11), Decl(module_augmentUninstantiatedModule2.ts, 0, 34)) ->ng : Symbol(ng, Decl(module_augmentUninstantiatedModule2.ts, 0, 11), Decl(module_augmentUninstantiatedModule2.ts, 0, 34)) ->IAngularStatic : Symbol(ng.IAngularStatic, Decl(module_augmentUninstantiatedModule2.ts, 5, 4)) +>ng : Symbol(ng, Decl(index.d.ts, 0, 11), Decl(index.d.ts, 0, 34), Decl(moduleAugmentation.ts, 0, 29)) +>ng : Symbol(ng, Decl(index.d.ts, 0, 11), Decl(index.d.ts, 0, 34), Decl(moduleAugmentation.ts, 0, 29)) +>IAngularStatic : Symbol(ng.IAngularStatic, Decl(index.d.ts, 5, 4), Decl(moduleAugmentation.ts, 1, 26)) declare module ng { ->ng : Symbol(ng, Decl(module_augmentUninstantiatedModule2.ts, 0, 11), Decl(module_augmentUninstantiatedModule2.ts, 0, 34)) +>ng : Symbol(ng, Decl(index.d.ts, 0, 11), Decl(index.d.ts, 0, 34), Decl(moduleAugmentation.ts, 0, 29)) export interface IModule { ->IModule : Symbol(IModule, Decl(module_augmentUninstantiatedModule2.ts, 2, 19)) +>IModule : Symbol(IModule, Decl(index.d.ts, 2, 19)) name: string; ->name : Symbol(IModule.name, Decl(module_augmentUninstantiatedModule2.ts, 3, 29)) +>name : Symbol(IModule.name, Decl(index.d.ts, 3, 29)) } export interface IAngularStatic { ->IAngularStatic : Symbol(IAngularStatic, Decl(module_augmentUninstantiatedModule2.ts, 5, 4)) +>IAngularStatic : Symbol(IAngularStatic, Decl(index.d.ts, 5, 4), Decl(moduleAugmentation.ts, 1, 26)) module: (s: string) => IModule; ->module : Symbol(IAngularStatic.module, Decl(module_augmentUninstantiatedModule2.ts, 7, 36)) ->s : Symbol(s, Decl(module_augmentUninstantiatedModule2.ts, 8, 16)) ->IModule : Symbol(IModule, Decl(module_augmentUninstantiatedModule2.ts, 2, 19)) +>module : Symbol(IAngularStatic.module, Decl(index.d.ts, 7, 36)) +>s : Symbol(s, Decl(index.d.ts, 8, 16)) +>IModule : Symbol(IModule, Decl(index.d.ts, 2, 19)) } } export = ng; ->ng : Symbol(ng, Decl(module_augmentUninstantiatedModule2.ts, 0, 11), Decl(module_augmentUninstantiatedModule2.ts, 0, 34)) +>ng : Symbol(ng, Decl(index.d.ts, 0, 11), Decl(index.d.ts, 0, 34), Decl(moduleAugmentation.ts, 0, 29)) diff --git a/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.types b/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.types index 4256b711e0..c4feae8337 100644 --- a/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.types +++ b/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.types @@ -1,8 +1,34 @@ //// [tests/cases/compiler/module_augmentUninstantiatedModule2.ts] //// -=== module_augmentUninstantiatedModule2.ts === +=== app.ts === +import ng = require("angular"); +>ng : ng.IAngularStatic + +import "./moduleAugmentation"; + +var x: number = ng.getNumber(); +>x : number +>ng.getNumber() : number +>ng.getNumber : () => number +>ng : ng.IAngularStatic +>getNumber : () => number + +=== moduleAugmentation.ts === +import * as ng from "angular" +>ng : ng.IAngularStatic + +declare module "angular" { +>"angular" : IAngularStatic + + export interface IAngularStatic { + getNumber: () => number; +>getNumber : () => number + } +} + +=== node_modules/angular/index.d.ts === declare var ng: ng.IAngularStatic; ->ng : import("module_augmentUninstantiatedModule2").IAngularStatic +>ng : import("node_modules/angular/index.d.ts").IAngularStatic >ng : any declare module ng { @@ -19,6 +45,6 @@ declare module ng { } export = ng; ->ng : import("module_augmentUninstantiatedModule2").IAngularStatic +>ng : import("node_modules/angular/index.d.ts").IAngularStatic diff --git a/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.types.diff b/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.types.diff deleted file mode 100644 index 2f98d353d6..0000000000 --- a/testdata/baselines/reference/submodule/compiler/module_augmentUninstantiatedModule2.types.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.module_augmentUninstantiatedModule2.types -+++ new.module_augmentUninstantiatedModule2.types -@@= skipped -1, +1 lines =@@ - - === module_augmentUninstantiatedModule2.ts === - declare var ng: ng.IAngularStatic; -->ng : ng.IAngularStatic -+>ng : import("module_augmentUninstantiatedModule2").IAngularStatic - >ng : any - - declare module ng { -@@= skipped -17, +17 lines =@@ - } - - export = ng; -->ng : ng.IAngularStatic -+>ng : import("module_augmentUninstantiatedModule2").IAngularStatic - diff --git a/testdata/baselines/reference/submodule/compiler/reexportMissingDefault4.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/reexportMissingDefault4.errors.txt.diff deleted file mode 100644 index fa73d785e0..0000000000 --- a/testdata/baselines/reference/submodule/compiler/reexportMissingDefault4.errors.txt.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- old.reexportMissingDefault4.errors.txt -+++ new.reexportMissingDefault4.errors.txt -@@= skipped -0, +0 lines =@@ --a.ts(2,10): error TS2305: Module '"./b"' has no exported member 'default'. -- -- --==== b.d.ts (0 errors) ==== -- declare var b: number; -- export { b }; -- --==== a.ts (1 errors) ==== -- export { b } from "./b"; -- export { default } from "./b"; -- ~~~~~~~ --!!! error TS2305: Module '"./b"' has no exported member 'default'. -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reexportMissingDefault4.types.diff b/testdata/baselines/reference/submodule/compiler/reexportMissingDefault4.types.diff deleted file mode 100644 index b2f037525c..0000000000 --- a/testdata/baselines/reference/submodule/compiler/reexportMissingDefault4.types.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.reexportMissingDefault4.types -+++ new.reexportMissingDefault4.types -@@= skipped -11, +11 lines =@@ - >b : number - - export { default } from "./b"; -->default : any -+>default : typeof import("b") diff --git a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithModuleNodeResolutionEmitNone.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithModuleNodeResolutionEmitNone.errors.txt.diff index 6c5fc37220..ced70dff4b 100644 --- a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithModuleNodeResolutionEmitNone.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithModuleNodeResolutionEmitNone.errors.txt.diff @@ -2,10 +2,12 @@ +++ new.requireOfJsonFileWithModuleNodeResolutionEmitNone.errors.txt @@= skipped -0, +0 lines =@@ -error TS5071: Option '--resolveJsonModule' cannot be specified when 'module' is set to 'none', 'system', or 'umd'. +-error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later. -file1.ts(1,1): error TS1148: Cannot use imports, exports, or module augmentations when '--module' is 'none'. - - -!!! error TS5071: Option '--resolveJsonModule' cannot be specified when 'module' is set to 'none', 'system', or 'umd'. +-!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later. -==== file1.ts (1 errors) ==== - import * as b from './b.json'; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModule.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModule.errors.txt.diff index 44608e6282..eccd38e743 100644 --- a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModule.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModule.errors.txt.diff @@ -1,47 +1,37 @@ --- old.requireOfJsonFileWithoutResolveJsonModule.errors.txt +++ new.requireOfJsonFileWithoutResolveJsonModule.errors.txt @@= skipped -0, +0 lines =@@ --file1.ts(1,21): error TS2732: Cannot find module './b.json'. Consider using '--resolveJsonModule' to import module with '.json' extension. --file1.ts(3,21): error TS2732: Cannot find module './b.json'. Consider using '--resolveJsonModule' to import module with '.json' extension. -- -- --==== file1.ts (2 errors) ==== -+b.json(1,1): error TS1005: '{' expected. -+b.json(1,10): error TS1005: ',' expected. -+b.json(1,14): error TS1005: ',' expected. -+b.json(1,18): error TS1005: '}' expected. -+file1.ts(2,12): error TS2339: Property 'a' does not exist on type '{ contents: any; Not: any; read: any; }'. -+file1.ts(5,16): error TS2339: Property 'b' does not exist on type '{ contents: any; Not: any; read: any; }'. -+file1.ts(6,13): error TS2339: Property 'b' does not exist on type '{ contents: any; Not: any; read: any; }'. -+ -+ -+==== file1.ts (3 errors) ==== - import b1 = require('./b.json'); // error -- ~~~~~~~~~~ --!!! error TS2732: Cannot find module './b.json'. Consider using '--resolveJsonModule' to import module with '.json' extension. - let x = b1.a; -+ ~ -+!!! error TS2339: Property 'a' does not exist on type '{ contents: any; Not: any; read: any; }'. - import b2 = require('./b.json'); // error -- ~~~~~~~~~~ --!!! error TS2732: Cannot find module './b.json'. Consider using '--resolveJsonModule' to import module with '.json' extension. - if (x) { - let b = b2.b; -+ ~ -+!!! error TS2339: Property 'b' does not exist on type '{ contents: any; Not: any; read: any; }'. - x = (b1.b === b); -+ ~ -+!!! error TS2339: Property 'b' does not exist on type '{ contents: any; Not: any; read: any; }'. + b.json(1,1): error TS1005: '{' expected. +-b.json(1,1): error TS1136: Property assignment expected. + b.json(1,10): error TS1005: ',' expected. +-b.json(1,10): error TS1136: Property assignment expected. + b.json(1,14): error TS1005: ',' expected. +-b.json(1,14): error TS1136: Property assignment expected. + b.json(1,18): error TS1005: '}' expected. + file1.ts(2,12): error TS2339: Property 'a' does not exist on type '{ contents: any; Not: any; read: any; }'. + file1.ts(5,16): error TS2339: Property 'b' does not exist on type '{ contents: any; Not: any; read: any; }'. +@@= skipped -24, +21 lines =@@ + !!! error TS2339: Property 'b' does not exist on type '{ contents: any; Not: any; read: any; }'. } --==== b.json (0 errors) ==== +-==== b.json (7 errors) ==== +==== b.json (4 errors) ==== contents Not read -+ ~~~~~~~~ -+!!! error TS1005: '{' expected. + ~~~~~~~~ + !!! error TS1005: '{' expected. +- ~~~~~~~~ +-!!! error TS1136: Property assignment expected. +- ~~~ +-!!! error TS1005: ',' expected. +- ~~~ +-!!! error TS1136: Property assignment expected. +- ~~~~ +-!!! error TS1005: ',' expected. +- ~~~~ +-!!! error TS1136: Property assignment expected. + ~~~ +!!! error TS1005: ',' expected. + ~~~~ +!!! error TS1005: ',' expected. -+ -+!!! error TS1005: '}' expected. \ No newline at end of file + + !!! error TS1005: '}' expected. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModule.js.diff b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModule.js.diff index 8663a3403b..d1d1ffc48a 100644 --- a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModule.js.diff +++ b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModule.js.diff @@ -1,11 +1,6 @@ --- old.requireOfJsonFileWithoutResolveJsonModule.js +++ new.requireOfJsonFileWithoutResolveJsonModule.js -@@= skipped -11, +11 lines =@@ - //// [b.json] - contents Not read - -+//// [out/b.json] -+{ contents, Not, read } +@@= skipped -16, +16 lines =@@ //// [out/file1.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModule.symbols.diff b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModule.symbols.diff deleted file mode 100644 index 49a2c5f46f..0000000000 --- a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModule.symbols.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.requireOfJsonFileWithoutResolveJsonModule.symbols -+++ new.requireOfJsonFileWithoutResolveJsonModule.symbols -@@= skipped -23, +23 lines =@@ - >b : Symbol(b, Decl(file1.ts, 4, 7)) - } - -+=== b.json === -+contents Not read -+>contents : Symbol(contents, Decl(b.json, 0, 0)) -+>Not : Symbol(Not, Decl(b.json, 0, 8)) -+>read : Symbol(read, Decl(b.json, 0, 12)) -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModule.types.diff b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModule.types.diff deleted file mode 100644 index a5c1231997..0000000000 --- a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileWithoutResolveJsonModule.types.diff +++ /dev/null @@ -1,47 +0,0 @@ ---- old.requireOfJsonFileWithoutResolveJsonModule.types -+++ new.requireOfJsonFileWithoutResolveJsonModule.types -@@= skipped -1, +1 lines =@@ - - === file1.ts === - import b1 = require('./b.json'); // error -->b1 : any -+>b1 : { contents: any; Not: any; read: any; } - - let x = b1.a; - >x : any - >b1.a : any -->b1 : any -+>b1 : { contents: any; Not: any; read: any; } - >a : any - - import b2 = require('./b.json'); // error -->b2 : any -+>b2 : { contents: any; Not: any; read: any; } - - if (x) { - >x : any -@@= skipped -17, +17 lines =@@ - let b = b2.b; - >b : any - >b2.b : any -->b2 : any -+>b2 : { contents: any; Not: any; read: any; } - >b : any - - x = (b1.b === b); -@@= skipped -9, +9 lines =@@ - >(b1.b === b) : boolean - >b1.b === b : boolean - >b1.b : any -->b1 : any -+>b1 : { contents: any; Not: any; read: any; } - >b : any - >b : any - } -+ -+=== b.json === -+contents Not read -+>contents Not read : { contents: any; Not: any; read: any; } -+>contents : any -+>Not : any -+>read : any diff --git a/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).errors.txt.diff b/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).errors.txt.diff deleted file mode 100644 index 170780f0b0..0000000000 --- a/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).errors.txt.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- old.resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).errors.txt -+++ new.resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).errors.txt -@@= skipped -0, +0 lines =@@ --tsconfig.json(2,5): error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. - test.ts(1,19): error TS5097: An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled. - - --==== tsconfig.json (1 errors) ==== -+==== tsconfig.json (0 errors) ==== - { - "compilerOptions": { -- ~~~~~~~~~~~~~~~~~ --!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. - "paths": { - "foo/*": ["./dist/*"], - "baz/*.ts": ["./types/*.d.ts"] \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=node10).errors.txt b/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=node10).errors.txt deleted file mode 100644 index 40b353506a..0000000000 --- a/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=node10).errors.txt +++ /dev/null @@ -1,25 +0,0 @@ -test.ts(1,19): error TS5097: An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled. - - -==== tsconfig.json (0 errors) ==== - { - "compilerOptions": { - "paths": { - "foo/*": ["./dist/*"], - "baz/*.ts": ["./types/*.d.ts"] - } - } - } - -==== dist/bar.ts (0 errors) ==== - export const a = 1234; - -==== types/main.d.ts (0 errors) ==== - export const b: string; - -==== test.ts (1 errors) ==== - import { a } from "foo/bar.ts"; - ~~~~~~~~~~~~ -!!! error TS5097: An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled. - import { b } from "baz/main.ts"; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=node10).js b/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=node10).js deleted file mode 100644 index fc322d5465..0000000000 --- a/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=node10).js +++ /dev/null @@ -1,21 +0,0 @@ -//// [tests/cases/compiler/resolutionCandidateFromPackageJsonField2.ts] //// - -//// [bar.ts] -export const a = 1234; - -//// [main.d.ts] -export const b: string; - -//// [test.ts] -import { a } from "foo/bar.ts"; -import { b } from "baz/main.ts"; - - -//// [bar.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.a = void 0; -exports.a = 1234; -//// [test.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=node10).symbols b/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=node10).symbols deleted file mode 100644 index 5ea0f09478..0000000000 --- a/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=node10).symbols +++ /dev/null @@ -1,17 +0,0 @@ -//// [tests/cases/compiler/resolutionCandidateFromPackageJsonField2.ts] //// - -=== dist/bar.ts === -export const a = 1234; ->a : Symbol(a, Decl(bar.ts, 0, 12)) - -=== types/main.d.ts === -export const b: string; ->b : Symbol(b, Decl(main.d.ts, 0, 12)) - -=== test.ts === -import { a } from "foo/bar.ts"; ->a : Symbol(a, Decl(test.ts, 0, 8)) - -import { b } from "baz/main.ts"; ->b : Symbol(b, Decl(test.ts, 1, 8)) - diff --git a/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=node10).types b/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=node10).types deleted file mode 100644 index 297dbfbfe9..0000000000 --- a/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=node10).types +++ /dev/null @@ -1,18 +0,0 @@ -//// [tests/cases/compiler/resolutionCandidateFromPackageJsonField2.ts] //// - -=== dist/bar.ts === -export const a = 1234; ->a : 1234 ->1234 : 1234 - -=== types/main.d.ts === -export const b: string; ->b : string - -=== test.ts === -import { a } from "foo/bar.ts"; ->a : 1234 - -import { b } from "baz/main.ts"; ->b : string - diff --git a/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).errors.txt b/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2.errors.txt similarity index 100% rename from testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).errors.txt rename to testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2.errors.txt diff --git a/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).js b/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2.js similarity index 100% rename from testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).js rename to testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2.js diff --git a/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).symbols b/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2.symbols similarity index 100% rename from testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).symbols rename to testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2.symbols diff --git a/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).types b/testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2.types similarity index 100% rename from testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2(moduleresolution=bundler).types rename to testdata/baselines/reference/submodule/compiler/resolutionCandidateFromPackageJsonField2.types diff --git a/testdata/baselines/reference/submodule/compiler/tripleSlashTypesReferenceWithMissingExports(module=commonjs).errors.txt.diff b/testdata/baselines/reference/submodule/compiler/tripleSlashTypesReferenceWithMissingExports(module=commonjs).errors.txt.diff deleted file mode 100644 index d1bf09c663..0000000000 --- a/testdata/baselines/reference/submodule/compiler/tripleSlashTypesReferenceWithMissingExports(module=commonjs).errors.txt.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.tripleSlashTypesReferenceWithMissingExports(module=commonjs).errors.txt -+++ new.tripleSlashTypesReferenceWithMissingExports(module=commonjs).errors.txt -@@= skipped -0, +0 lines =@@ -- -+usage.ts(1,23): error TS2688: Cannot find type definition file for 'pkg'. -+ -+ -+==== node_modules/pkg/index.d.ts (0 errors) ==== -+ interface GlobalThing { a: number } -+==== node_modules/pkg/package.json (0 errors) ==== -+ { -+ "name": "pkg", -+ "types": "index.d.ts", -+ "exports": "some-other-thing.js" -+ } -+==== usage.ts (1 errors) ==== -+ /// -+ ~~~ -+!!! error TS2688: Cannot find type definition file for 'pkg'. -+ -+ const a: GlobalThing = { a: 0 }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/allowImportingTsExtensions(moduleresolution=bundler).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/allowImportingTsExtensions(moduleresolution=bundler).errors.txt.diff deleted file mode 100644 index 46acfb6e3b..0000000000 --- a/testdata/baselines/reference/submodule/conformance/allowImportingTsExtensions(moduleresolution=bundler).errors.txt.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.allowImportingTsExtensions(moduleresolution=bundler).errors.txt -+++ new.allowImportingTsExtensions(moduleresolution=bundler).errors.txt -@@= skipped -0, +0 lines =@@ --error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. - /c.ts(1,16): error TS2307: Cannot find module './thisfiledoesnotexist.ts' or its corresponding type declarations. - - --!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. - ==== /ts.ts (0 errors) ==== - export {}; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/allowImportingTsExtensions(moduleresolution=node10).errors.txt b/testdata/baselines/reference/submodule/conformance/allowImportingTsExtensions(moduleresolution=node10).errors.txt deleted file mode 100644 index 755f0d6eeb..0000000000 --- a/testdata/baselines/reference/submodule/conformance/allowImportingTsExtensions(moduleresolution=node10).errors.txt +++ /dev/null @@ -1,32 +0,0 @@ -/c.ts(1,16): error TS2307: Cannot find module './thisfiledoesnotexist.ts' or its corresponding type declarations. - - -==== /ts.ts (0 errors) ==== - export {}; - -==== /tsx.tsx (0 errors) ==== - export {}; - -==== /dts.d.ts (0 errors) ==== - export {}; - -==== /b.ts (0 errors) ==== - import {} from "./ts.js"; - import {} from "./ts.ts"; - import type {} from "./ts.d.ts"; - - import {} from "./tsx.js"; - import {} from "./tsx.jsx"; - import {} from "./tsx.ts"; - import {} from "./tsx.tsx"; - import type {} from "./tsx.d.ts"; - - import {} from "./dts.js"; - import {} from "./dts.ts"; - import type {} from "./dts.d.ts"; - -==== /c.ts (1 errors) ==== - import {} from "./thisfiledoesnotexist.ts"; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './thisfiledoesnotexist.ts' or its corresponding type declarations. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/bundlerCommonJS.errors.txt b/testdata/baselines/reference/submodule/conformance/bundlerCommonJS.errors.txt new file mode 100644 index 0000000000..3d67812bd0 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerCommonJS.errors.txt @@ -0,0 +1,35 @@ +/real-imports.mts(1,19): error TS2307: Cannot find module 'pkg' or its corresponding type declarations. + + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "1.0.0", + "type": "commonjs", + "exports": { + "require": "./index.js" + } + } + +==== /node_modules/pkg/index.d.ts (0 errors) ==== + export declare const x: number; + +==== /package.json (0 errors) ==== + { + "": "type module is ignored in --module commonjs", + "type": "module" + } + +==== /requires.ts (0 errors) ==== + import pkg = require("pkg"); + pkg.x; + +==== /imports.ts (0 errors) ==== + import { x } from "pkg"; + x; + +==== /real-imports.mts (1 errors) ==== + import { x } from "pkg"; // Error + ~~~~~ +!!! error TS2307: Cannot find module 'pkg' or its corresponding type declarations. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/bundlerCommonJS.js b/testdata/baselines/reference/submodule/conformance/bundlerCommonJS.js new file mode 100644 index 0000000000..6d419cecbc --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerCommonJS.js @@ -0,0 +1,45 @@ +//// [tests/cases/conformance/moduleResolution/bundler/bundlerCommonJS.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "1.0.0", + "type": "commonjs", + "exports": { + "require": "./index.js" + } +} + +//// [index.d.ts] +export declare const x: number; + +//// [package.json] +{ + "": "type module is ignored in --module commonjs", + "type": "module" +} + +//// [requires.ts] +import pkg = require("pkg"); +pkg.x; + +//// [imports.ts] +import { x } from "pkg"; +x; + +//// [real-imports.mts] +import { x } from "pkg"; // Error + + +//// [requires.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const pkg = require("pkg"); +pkg.x; +//// [imports.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const pkg_1 = require("pkg"); +pkg_1.x; +//// [real-imports.mjs] +export {}; diff --git a/testdata/baselines/reference/submodule/conformance/bundlerCommonJS.js.diff b/testdata/baselines/reference/submodule/conformance/bundlerCommonJS.js.diff new file mode 100644 index 0000000000..42e1efe9d2 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerCommonJS.js.diff @@ -0,0 +1,17 @@ +--- old.bundlerCommonJS.js ++++ new.bundlerCommonJS.js +@@= skipped -33, +33 lines =@@ + //// [requires.js] + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +-var pkg = require("pkg"); ++const pkg = require("pkg"); + pkg.x; + //// [imports.js] + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +-var pkg_1 = require("pkg"); ++const pkg_1 = require("pkg"); + pkg_1.x; + //// [real-imports.mjs] + export {}; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/bundlerCommonJS.trace.json b/testdata/baselines/reference/submodule/conformance/bundlerCommonJS.trace.json new file mode 100644 index 0000000000..4ccef64129 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerCommonJS.trace.json @@ -0,0 +1,55 @@ +======== Resolving module 'pkg' from '/requires.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Found 'package.json' at '/package.json'. +Loading module 'pkg' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/node_modules/pkg/package.json'. +Entering conditional exports. +Matched 'exports' condition 'require'. +Using 'exports' subpath '.' with target './index.js'. +File name '/node_modules/pkg/index.js' has a '.js' extension - stripping it. +File '/node_modules/pkg/index.ts' does not exist. +File '/node_modules/pkg/index.tsx' does not exist. +File '/node_modules/pkg/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'require'. +Exiting conditional exports. +Resolving real path for '/node_modules/pkg/index.d.ts', result '/node_modules/pkg/index.d.ts'. +======== Module name 'pkg' was successfully resolved to '/node_modules/pkg/index.d.ts' with Package ID 'pkg/index.d.ts@1.0.0'. ======== +======== Resolving module 'pkg' from '/imports.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/package.json' exists according to earlier cached lookups. +Loading module 'pkg' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/pkg/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'require'. +Using 'exports' subpath '.' with target './index.js'. +File name '/node_modules/pkg/index.js' has a '.js' extension - stripping it. +File '/node_modules/pkg/index.ts' does not exist according to earlier cached lookups. +File '/node_modules/pkg/index.tsx' does not exist according to earlier cached lookups. +File '/node_modules/pkg/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'require'. +Exiting conditional exports. +Resolving real path for '/node_modules/pkg/index.d.ts', result '/node_modules/pkg/index.d.ts'. +======== Module name 'pkg' was successfully resolved to '/node_modules/pkg/index.d.ts' with Package ID 'pkg/index.d.ts@1.0.0'. ======== +======== Resolving module 'pkg' from '/real-imports.mts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/package.json' exists according to earlier cached lookups. +Loading module 'pkg' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/node_modules/pkg/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. +File '/node_modules/pkg/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'require'. +Exiting conditional exports. +======== Module name 'pkg' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=node18,moduleresolution=bundler).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=node18,moduleresolution=bundler).errors.txt.diff index eff04db0b2..70ea38d3b0 100644 --- a/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=node18,moduleresolution=bundler).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=node18,moduleresolution=bundler).errors.txt.diff @@ -1,11 +1,11 @@ --- old.bundlerDirectoryModule(module=node18,moduleresolution=bundler).errors.txt +++ new.bundlerDirectoryModule(module=node18,moduleresolution=bundler).errors.txt @@= skipped -0, +0 lines =@@ --error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. +-error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later. error TS5109: Option 'moduleResolution' must be set to 'Node16' (or left unspecified) when option 'module' is set to 'Node18'. --!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. +-!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later. !!! error TS5109: Option 'moduleResolution' must be set to 'Node16' (or left unspecified) when option 'module' is set to 'Node18'. ==== /app/test.ts (0 errors) ==== import { test } from '../lib'; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=node20,moduleresolution=bundler).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=node20,moduleresolution=bundler).errors.txt.diff index e165b28f03..d5fe908ca2 100644 --- a/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=node20,moduleresolution=bundler).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=node20,moduleresolution=bundler).errors.txt.diff @@ -1,11 +1,11 @@ --- old.bundlerDirectoryModule(module=node20,moduleresolution=bundler).errors.txt +++ new.bundlerDirectoryModule(module=node20,moduleresolution=bundler).errors.txt @@= skipped -0, +0 lines =@@ --error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. +-error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later. error TS5109: Option 'moduleResolution' must be set to 'Node16' (or left unspecified) when option 'module' is set to 'Node20'. --!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. +-!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later. !!! error TS5109: Option 'moduleResolution' must be set to 'Node16' (or left unspecified) when option 'module' is set to 'Node20'. ==== /app/test.ts (0 errors) ==== import { test } from '../lib'; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=nodenext,moduleresolution=bundler).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=nodenext,moduleresolution=bundler).errors.txt.diff index 4d64344afc..bb8cb1f706 100644 --- a/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=nodenext,moduleresolution=bundler).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/bundlerDirectoryModule(module=nodenext,moduleresolution=bundler).errors.txt.diff @@ -1,11 +1,11 @@ --- old.bundlerDirectoryModule(module=nodenext,moduleresolution=bundler).errors.txt +++ new.bundlerDirectoryModule(module=nodenext,moduleresolution=bundler).errors.txt @@= skipped -0, +0 lines =@@ --error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. +-error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later. error TS5109: Option 'moduleResolution' must be set to 'NodeNext' (or left unspecified) when option 'module' is set to 'NodeNext'. --!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. +-!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later. !!! error TS5109: Option 'moduleResolution' must be set to 'NodeNext' (or left unspecified) when option 'module' is set to 'NodeNext'. ==== /app/test.ts (0 errors) ==== import { test } from '../lib'; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/bundlerOptionsCompat.errors.txt b/testdata/baselines/reference/submodule/conformance/bundlerOptionsCompat.errors.txt new file mode 100644 index 0000000000..e5e9133062 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerOptionsCompat.errors.txt @@ -0,0 +1,16 @@ +/tsconfig.json(4,25): error TS5109: Option 'moduleResolution' must be set to 'NodeNext' (or left unspecified) when option 'module' is set to 'NodeNext'. + + +==== /tsconfig.json (1 errors) ==== + { + "compilerOptions": { + "module": "nodenext", + "moduleResolution": "bundler", + ~~~~~~~~~ +!!! error TS5109: Option 'moduleResolution' must be set to 'NodeNext' (or left unspecified) when option 'module' is set to 'NodeNext'. + "noEmit": true + } + } + +==== /index.ts (0 errors) ==== + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/bundlerOptionsCompat.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/bundlerOptionsCompat.errors.txt.diff index fbffe1fcd9..cb19250ff0 100644 --- a/testdata/baselines/reference/submodule/conformance/bundlerOptionsCompat.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/bundlerOptionsCompat.errors.txt.diff @@ -1,20 +1,18 @@ --- old.bundlerOptionsCompat.errors.txt +++ new.bundlerOptionsCompat.errors.txt @@= skipped -0, +0 lines =@@ --/tsconfig.json(4,25): error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. -- -- --==== /tsconfig.json (1 errors) ==== -- { -- "compilerOptions": { -- "module": "commonjs", -- "moduleResolution": "bundler", +-/tsconfig.json(4,25): error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later. + /tsconfig.json(4,25): error TS5109: Option 'moduleResolution' must be set to 'NodeNext' (or left unspecified) when option 'module' is set to 'NodeNext'. + + +-==== /tsconfig.json (2 errors) ==== ++==== /tsconfig.json (1 errors) ==== + { + "compilerOptions": { + "module": "nodenext", + "moduleResolution": "bundler", - ~~~~~~~~~ --!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. -- "noEmit": true -- } -- } -- --==== /index.ts (0 errors) ==== -- -+ \ No newline at end of file +-!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later. + ~~~~~~~~~ + !!! error TS5109: Option 'moduleResolution' must be set to 'NodeNext' (or left unspecified) when option 'module' is set to 'NodeNext'. + "noEmit": true \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/extensionLoadingPriority(moduleresolution=node).symbols b/testdata/baselines/reference/submodule/conformance/extensionLoadingPriority(moduleresolution=node).symbols deleted file mode 100644 index 065ed64eca..0000000000 --- a/testdata/baselines/reference/submodule/conformance/extensionLoadingPriority(moduleresolution=node).symbols +++ /dev/null @@ -1,25 +0,0 @@ -//// [tests/cases/conformance/moduleResolution/extensionLoadingPriority.ts] //// - -=== /project/a.js === - -export default "a.js"; - -=== /project/a.js.js === - -export default "a.js.js"; - -=== /project/dir/index.ts === - -export default "dir/index.ts"; - -=== /project/dir.js === - -export default "dir.js"; - -=== /project/b.ts === -import a from "./a.js"; ->a : Symbol(a, Decl(b.ts, 0, 6)) - -import dir from "./dir"; ->dir : Symbol(dir, Decl(b.ts, 1, 6)) - diff --git a/testdata/baselines/reference/submodule/conformance/extensionLoadingPriority(moduleresolution=node).types b/testdata/baselines/reference/submodule/conformance/extensionLoadingPriority(moduleresolution=node).types deleted file mode 100644 index a4a16f8cd5..0000000000 --- a/testdata/baselines/reference/submodule/conformance/extensionLoadingPriority(moduleresolution=node).types +++ /dev/null @@ -1,25 +0,0 @@ -//// [tests/cases/conformance/moduleResolution/extensionLoadingPriority.ts] //// - -=== /project/a.js === - -export default "a.js"; - -=== /project/a.js.js === - -export default "a.js.js"; - -=== /project/dir/index.ts === - -export default "dir/index.ts"; - -=== /project/dir.js === - -export default "dir.js"; - -=== /project/b.ts === -import a from "./a.js"; ->a : "a.js" - -import dir from "./dir"; ->dir : "dir.js" - diff --git a/testdata/baselines/reference/submodule/conformance/importCallExpressionInExportEqualsCJS.types.diff b/testdata/baselines/reference/submodule/conformance/importCallExpressionInExportEqualsCJS.types.diff deleted file mode 100644 index 5dc9e8003a..0000000000 --- a/testdata/baselines/reference/submodule/conformance/importCallExpressionInExportEqualsCJS.types.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- old.importCallExpressionInExportEqualsCJS.types -+++ new.importCallExpressionInExportEqualsCJS.types -@@= skipped -8, +8 lines =@@ - >async function() { const something = await import("./something");} : () => Promise - - const something = await import("./something"); -->something : 42 -->await import("./something") : 42 -->import("./something") : Promise<42> -+>something : { default: 42; } -+>await import("./something") : { default: 42; } -+>import("./something") : Promise<{ default: 42; }> - >"./something" : "./something" - - }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.errors.txt.diff deleted file mode 100644 index 112ac7c0a9..0000000000 --- a/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.errors.txt.diff +++ /dev/null @@ -1,39 +0,0 @@ ---- old.legacyNodeModulesExportsSpecifierGenerationConditions.errors.txt -+++ new.legacyNodeModulesExportsSpecifierGenerationConditions.errors.txt -@@= skipped -0, +0 lines =@@ -- -+index.ts(1,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/private'. This is likely not portable. A type annotation is necessary. -+ -+ -+==== index.ts (1 errors) ==== -+ export const a = async () => (await import("inner")).x(); -+ ~ -+!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/private'. This is likely not portable. A type annotation is necessary. -+==== node_modules/inner/index.d.ts (0 errors) ==== -+ export { x } from "./other.js"; -+==== node_modules/inner/other.d.ts (0 errors) ==== -+ import { Thing } from "./private.js" -+ export const x: () => Thing; -+==== node_modules/inner/private.d.ts (0 errors) ==== -+ export interface Thing {} // not exported in export map, inaccessible under new module modes -+==== package.json (0 errors) ==== -+ { -+ "name": "package", -+ "private": true, -+ "type": "module", -+ "exports": "./index.js" -+ } -+==== node_modules/inner/package.json (0 errors) ==== -+ { -+ "name": "inner", -+ "private": true, -+ "type": "module", -+ "exports": { -+ ".": { -+ "default": "./index.js" -+ }, -+ "./other": { -+ "default": "./other.js" -+ } -+ } -+ } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.js.diff b/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.js.diff index 0b8fd49c2f..c49f2d13e9 100644 --- a/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.js.diff +++ b/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.js.diff @@ -18,8 +18,7 @@ -const a = () => __awaiter(void 0, void 0, void 0, function* () { return (yield Promise.resolve().then(function () { return require("inner"); })).x(); }); +const a = async () => (await Promise.resolve().then(() => require("inner"))).x(); exports.a = a; - - - //// [index.d.ts] --export declare const a: () => Promise; ++ ++ ++//// [index.d.ts] +export declare const a: any; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.types.diff b/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.types.diff deleted file mode 100644 index 67e8decade..0000000000 --- a/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.types.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- old.legacyNodeModulesExportsSpecifierGenerationConditions.types -+++ new.legacyNodeModulesExportsSpecifierGenerationConditions.types -@@= skipped -5, +5 lines =@@ - >async () => (await import("inner")).x() : () => Promise - >(await import("inner")).x() : import("node_modules/inner/private").Thing - >(await import("inner")).x : () => import("node_modules/inner/private").Thing -->(await import("inner")) : typeof import("node_modules/inner/index") -->await import("inner") : typeof import("node_modules/inner/index") -->import("inner") : Promise -+>(await import("inner")) : { x: () => import("node_modules/inner/private").Thing; default: typeof import("node_modules/inner/index"); } -+>await import("inner") : { x: () => import("node_modules/inner/private").Thing; default: typeof import("node_modules/inner/index"); } -+>import("inner") : Promise<{ x: () => import("node_modules/inner/private").Thing; default: typeof import("node_modules/inner/index"); }> - >"inner" : "inner" - >x : () => import("node_modules/inner/private").Thing diff --git a/testdata/baselines/reference/submodule/conformance/nestedPackageJsonRedirect(moduleresolution=bundler).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/nestedPackageJsonRedirect(moduleresolution=bundler).errors.txt.diff deleted file mode 100644 index 3d72a9b126..0000000000 --- a/testdata/baselines/reference/submodule/conformance/nestedPackageJsonRedirect(moduleresolution=bundler).errors.txt.diff +++ /dev/null @@ -1,32 +0,0 @@ ---- old.nestedPackageJsonRedirect(moduleresolution=bundler).errors.txt -+++ new.nestedPackageJsonRedirect(moduleresolution=bundler).errors.txt -@@= skipped -0, +0 lines =@@ --error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. -- -- --!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. --==== /node_modules/@restart/hooks/package.json (0 errors) ==== -- { -- "name": "@restart/hooks", -- "version": "0.3.25", -- "main": "cjs/index.js", -- "types": "cjs/index.d.ts", -- "module": "esm/index.js" -- } -- --==== /node_modules/@restart/hooks/useMergedRefs/package.json (0 errors) ==== -- { -- "name": "@restart/hooks/useMergedRefs", -- "private": true, -- "main": "../cjs/useMergedRefs.js", -- "module": "../esm/useMergedRefs.js", -- "types": "../esm/useMergedRefs.d.ts" -- } -- --==== /node_modules/@restart/hooks/esm/useMergedRefs.d.ts (0 errors) ==== -- export {}; -- --==== /main.ts (0 errors) ==== -- import {} from "@restart/hooks/useMergedRefs"; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/node10IsNode_node.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/node10IsNode_node.errors.txt.diff new file mode 100644 index 0000000000..2dd569a21b --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/node10IsNode_node.errors.txt.diff @@ -0,0 +1,28 @@ +--- old.node10IsNode_node.errors.txt ++++ new.node10IsNode_node.errors.txt +@@= skipped -0, +0 lines =@@ +-error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- +- +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +-==== /node_modules/fancy-lib/package.json (0 errors) ==== +- { +- "name": "fancy-lib", +- "version": "1.0.0", +- "main": "index.js", +- "exports": { +- ".": "./definitely-not-index.js" +- } +- } +- +-==== /node_modules/fancy-lib/index.d.ts (0 errors) ==== +- export declare const fancy: "feast"; +- +-==== /node_modules/fancy-lib/definitely-not-index.d.ts (0 errors) ==== +- export declare const fancy: "ketchup"; +- +-==== /main.ts (0 errors) ==== +- import { fancy } from "fancy-lib"; +- fancy; +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/node10IsNode_node10.types.diff b/testdata/baselines/reference/submodule/conformance/node10IsNode_node10.types.diff deleted file mode 100644 index 3164038207..0000000000 --- a/testdata/baselines/reference/submodule/conformance/node10IsNode_node10.types.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.node10IsNode_node10.types -+++ new.node10IsNode_node10.types -@@= skipped -9, +9 lines =@@ - - === /main.ts === - import { fancy } from "fancy-lib"; -->fancy : "feast" -+>fancy : "ketchup" - - fancy; -->fancy : "feast" -+>fancy : "ketchup" diff --git a/testdata/baselines/reference/submodule/conformance/packageJsonImportsExportsOptionCompat(moduleresolution=bundler).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/packageJsonImportsExportsOptionCompat(moduleresolution=bundler).errors.txt.diff deleted file mode 100644 index 8ffa17c28d..0000000000 --- a/testdata/baselines/reference/submodule/conformance/packageJsonImportsExportsOptionCompat(moduleresolution=bundler).errors.txt.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- old.packageJsonImportsExportsOptionCompat(moduleresolution=bundler).errors.txt -+++ new.packageJsonImportsExportsOptionCompat(moduleresolution=bundler).errors.txt -@@= skipped -0, +0 lines =@@ --error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. -- -- --!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. --==== index.ts (0 errors) ==== -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/packageJsonImportsExportsOptionCompat(moduleresolution=node).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/packageJsonImportsExportsOptionCompat(moduleresolution=node).errors.txt.diff index 158e7c15c0..627302df32 100644 --- a/testdata/baselines/reference/submodule/conformance/packageJsonImportsExportsOptionCompat(moduleresolution=node).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/packageJsonImportsExportsOptionCompat(moduleresolution=node).errors.txt.diff @@ -3,10 +3,12 @@ @@= skipped -0, +0 lines =@@ -error TS5098: Option 'resolvePackageJsonExports' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'. -error TS5098: Option 'resolvePackageJsonImports' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'. +-error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. - - -!!! error TS5098: Option 'resolvePackageJsonExports' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'. -!!! error TS5098: Option 'resolvePackageJsonImports' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'. +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== index.ts (0 errors) ==== - + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).errors.txt.diff deleted file mode 100644 index 0aded09d59..0000000000 --- a/testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).errors.txt.diff +++ /dev/null @@ -1,46 +0,0 @@ ---- old.resolutionModeImportType1(moduleresolution=node10).errors.txt -+++ new.resolutionModeImportType1(moduleresolution=node10).errors.txt -@@= skipped -0, +0 lines =@@ --error TS2688: Cannot find type definition file for 'foo'. -- The file is in the program because: -- Entry point for implicit type library 'foo' --/app.ts(1,30): error TS2307: Cannot find module 'foo' or its corresponding type declarations. -- There are types at '/node_modules/@types/foo/index.d.mts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'. -- -- --!!! error TS2688: Cannot find type definition file for 'foo'. --!!! error TS2688: The file is in the program because: --!!! error TS2688: Entry point for implicit type library 'foo' --==== /node_modules/@types/foo/package.json (0 errors) ==== -- { -- "name": "@types/foo", -- "version": "1.0.0", -- "exports": { -- ".": { -- "import": "./index.d.mts", -- "require": "./index.d.cts" -- } -- } -- } -- --==== /node_modules/@types/foo/index.d.mts (0 errors) ==== -- export declare const x: "module"; -- --==== /node_modules/@types/foo/index.d.cts (0 errors) ==== -- export declare const x: "script"; -- --==== /app.ts (1 errors) ==== -- type Default = typeof import("foo").x; -- ~~~~~ --!!! error TS2307: Cannot find module 'foo' or its corresponding type declarations. --!!! error TS2307: There are types at '/node_modules/@types/foo/index.d.mts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'. -- type Import = typeof import("foo", { assert: { "resolution-mode": "import" } }).x; -- type Require = typeof import("foo", { assert: { "resolution-mode": "require" } }).x; -- // resolution-mode does not enforce file extension in `bundler`, just sets conditions -- type ImportRelative = typeof import("./other", { assert: { "resolution-mode": "import" } }).x; -- type RequireRelative = typeof import("./other", { assert: { "resolution-mode": "require" } }).x; -- --==== /other.ts (0 errors) ==== -- export const x = "other"; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).symbols b/testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).symbols deleted file mode 100644 index 3b36b51d0a..0000000000 --- a/testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).symbols +++ /dev/null @@ -1,36 +0,0 @@ -//// [tests/cases/conformance/moduleResolution/resolutionModeImportType1.ts] //// - -=== /node_modules/@types/foo/index.d.mts === -export declare const x: "module"; ->x : Symbol(x, Decl(index.d.mts, 0, 20)) - -=== /node_modules/@types/foo/index.d.cts === -export declare const x: "script"; ->x : Symbol(x, Decl(index.d.cts, 0, 20)) - -=== /app.ts === -type Default = typeof import("foo").x; ->Default : Symbol(Default, Decl(app.ts, 0, 0)) ->x : Symbol(x, Decl(index.d.mts, 0, 20)) - -type Import = typeof import("foo", { assert: { "resolution-mode": "import" } }).x; ->Import : Symbol(Import, Decl(app.ts, 0, 38)) ->x : Symbol(x, Decl(index.d.mts, 0, 20)) - -type Require = typeof import("foo", { assert: { "resolution-mode": "require" } }).x; ->Require : Symbol(Require, Decl(app.ts, 1, 82)) ->x : Symbol(x, Decl(index.d.cts, 0, 20)) - -// resolution-mode does not enforce file extension in `bundler`, just sets conditions -type ImportRelative = typeof import("./other", { assert: { "resolution-mode": "import" } }).x; ->ImportRelative : Symbol(ImportRelative, Decl(app.ts, 2, 84)) ->x : Symbol(x, Decl(other.ts, 0, 12)) - -type RequireRelative = typeof import("./other", { assert: { "resolution-mode": "require" } }).x; ->RequireRelative : Symbol(RequireRelative, Decl(app.ts, 4, 94)) ->x : Symbol(x, Decl(other.ts, 0, 12)) - -=== /other.ts === -export const x = "other"; ->x : Symbol(x, Decl(other.ts, 0, 12)) - diff --git a/testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).symbols.diff b/testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).symbols.diff deleted file mode 100644 index 9105647d6d..0000000000 --- a/testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).symbols.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- old.resolutionModeImportType1(moduleresolution=node10).symbols -+++ new.resolutionModeImportType1(moduleresolution=node10).symbols -@@= skipped -10, +10 lines =@@ - === /app.ts === - type Default = typeof import("foo").x; - >Default : Symbol(Default, Decl(app.ts, 0, 0)) -+>x : Symbol(x, Decl(index.d.mts, 0, 20)) - - type Import = typeof import("foo", { assert: { "resolution-mode": "import" } }).x; - >Import : Symbol(Import, Decl(app.ts, 0, 38)) \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).types b/testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).types deleted file mode 100644 index 376327dbeb..0000000000 --- a/testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).types +++ /dev/null @@ -1,37 +0,0 @@ -//// [tests/cases/conformance/moduleResolution/resolutionModeImportType1.ts] //// - -=== /node_modules/@types/foo/index.d.mts === -export declare const x: "module"; ->x : "module" - -=== /node_modules/@types/foo/index.d.cts === -export declare const x: "script"; ->x : "script" - -=== /app.ts === -type Default = typeof import("foo").x; ->Default : "module" ->x : any - -type Import = typeof import("foo", { assert: { "resolution-mode": "import" } }).x; ->Import : "module" ->x : any - -type Require = typeof import("foo", { assert: { "resolution-mode": "require" } }).x; ->Require : "script" ->x : any - -// resolution-mode does not enforce file extension in `bundler`, just sets conditions -type ImportRelative = typeof import("./other", { assert: { "resolution-mode": "import" } }).x; ->ImportRelative : "other" ->x : any - -type RequireRelative = typeof import("./other", { assert: { "resolution-mode": "require" } }).x; ->RequireRelative : "other" ->x : any - -=== /other.ts === -export const x = "other"; ->x : "other" ->"other" : "other" - diff --git a/testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).types.diff b/testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).types.diff deleted file mode 100644 index b3c686f1fe..0000000000 --- a/testdata/baselines/reference/submodule/conformance/resolutionModeImportType1(moduleresolution=node10).types.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.resolutionModeImportType1(moduleresolution=node10).types -+++ new.resolutionModeImportType1(moduleresolution=node10).types -@@= skipped -9, +9 lines =@@ - - === /app.ts === - type Default = typeof import("foo").x; -->Default : any -+>Default : "module" - >x : any - - type Import = typeof import("foo", { assert: { "resolution-mode": "import" } }).x; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/resolutionModeTripleSlash4.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/resolutionModeTripleSlash4.errors.txt.diff index f89f6b38a7..21390f0820 100644 --- a/testdata/baselines/reference/submodule/conformance/resolutionModeTripleSlash4.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/resolutionModeTripleSlash4.errors.txt.diff @@ -1,12 +1,22 @@ --- old.resolutionModeTripleSlash4.errors.txt +++ new.resolutionModeTripleSlash4.errors.txt @@= skipped -0, +0 lines =@@ +-/tsconfig.json(4,25): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -/app.ts(1,23): error TS2688: Cannot find type definition file for 'foo'. -/app.ts(2,1): error TS2304: Cannot find name 'MODULE'. /app.ts(3,1): error TS2552: Cannot find name 'SCRIPT'. Did you mean 'WScript'? -@@= skipped -12, +10 lines =@@ +-==== /tsconfig.json (1 errors) ==== ++==== /tsconfig.json (0 errors) ==== + { + "compilerOptions": { + "module": "esnext", + "moduleResolution": "node10", +- ~~~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + "noEmit": true, + "types": [] } } diff --git a/testdata/baselines/reference/submodule/conformance/resolutionModeTripleSlash5.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/resolutionModeTripleSlash5.errors.txt.diff new file mode 100644 index 0000000000..9ab160155c --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/resolutionModeTripleSlash5.errors.txt.diff @@ -0,0 +1,18 @@ +--- old.resolutionModeTripleSlash5.errors.txt ++++ new.resolutionModeTripleSlash5.errors.txt +@@= skipped -0, +0 lines =@@ +-/tsconfig.json(4,25): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + /app.ts(3,1): error TS2552: Cannot find name 'SCRIPT'. Did you mean 'WScript'? + + +-==== /tsconfig.json (1 errors) ==== ++==== /tsconfig.json (0 errors) ==== + { + "compilerOptions": { + "module": "esnext", + "moduleResolution": "node10", +- ~~~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + "noEmit": true, + "types": [] + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).errors.txt.diff deleted file mode 100644 index d3c2ba7e29..0000000000 --- a/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).errors.txt.diff +++ /dev/null @@ -1,60 +0,0 @@ ---- old.resolutionModeTypeOnlyImport1(moduleresolution=node10).errors.txt -+++ new.resolutionModeTypeOnlyImport1(moduleresolution=node10).errors.txt -@@= skipped -0, +0 lines =@@ --error TS2688: Cannot find type definition file for 'foo'. -- The file is in the program because: -- Entry point for implicit type library 'foo' --/app.ts(1,35): error TS2307: Cannot find module 'foo' or its corresponding type declarations. -- There are types at '/node_modules/@types/foo/index.d.mts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'. -- -- --!!! error TS2688: Cannot find type definition file for 'foo'. --!!! error TS2688: The file is in the program because: --!!! error TS2688: Entry point for implicit type library 'foo' --==== /node_modules/@types/foo/package.json (0 errors) ==== -- { -- "name": "@types/foo", -- "version": "1.0.0", -- "exports": { -- ".": { -- "import": "./index.d.mts", -- "require": "./index.d.cts" -- } -- } -- } -- --==== /node_modules/@types/foo/index.d.mts (0 errors) ==== -- export declare const x: "module"; -- --==== /node_modules/@types/foo/index.d.cts (0 errors) ==== -- export declare const x: "script"; -- --==== /app.ts (1 errors) ==== -- import type { x as Default } from "foo"; -- ~~~~~ --!!! error TS2307: Cannot find module 'foo' or its corresponding type declarations. --!!! error TS2307: There are types at '/node_modules/@types/foo/index.d.mts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'. -- import type { x as Import } from "foo" assert { "resolution-mode": "import" }; -- import type { x as Require } from "foo" assert { "resolution-mode": "require" }; -- type _Default = typeof Default; -- type _Import = typeof Import; -- type _Require = typeof Require; -- -- // resolution-mode does not enforce file extension in `bundler`, just sets conditions -- import type { x as ImportRelative } from "./other" assert { "resolution-mode": "import" }; -- import type { x as RequireRelative } from "./other" assert { "resolution-mode": "require" }; -- type _ImportRelative = typeof ImportRelative; -- type _RequireRelative = typeof RequireRelative; -- -- export { -- _Default, -- _Import, -- _Require, -- _ImportRelative, -- _RequireRelative -- } -- --==== /other.ts (0 errors) ==== -- export const x = "other"; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).js b/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).js deleted file mode 100644 index 961512bfab..0000000000 --- a/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).js +++ /dev/null @@ -1,62 +0,0 @@ -//// [tests/cases/conformance/moduleResolution/resolutionModeTypeOnlyImport1.ts] //// - -//// [package.json] -{ - "name": "@types/foo", - "version": "1.0.0", - "exports": { - ".": { - "import": "./index.d.mts", - "require": "./index.d.cts" - } - } -} - -//// [index.d.mts] -export declare const x: "module"; - -//// [index.d.cts] -export declare const x: "script"; - -//// [app.ts] -import type { x as Default } from "foo"; -import type { x as Import } from "foo" assert { "resolution-mode": "import" }; -import type { x as Require } from "foo" assert { "resolution-mode": "require" }; -type _Default = typeof Default; -type _Import = typeof Import; -type _Require = typeof Require; - -// resolution-mode does not enforce file extension in `bundler`, just sets conditions -import type { x as ImportRelative } from "./other" assert { "resolution-mode": "import" }; -import type { x as RequireRelative } from "./other" assert { "resolution-mode": "require" }; -type _ImportRelative = typeof ImportRelative; -type _RequireRelative = typeof RequireRelative; - -export { - _Default, - _Import, - _Require, - _ImportRelative, - _RequireRelative -} - -//// [other.ts] -export const x = "other"; - - - - -//// [other.d.ts] -export declare const x = "other"; -//// [app.d.ts] -import type { x as Default } from "foo"; -import type { x as Import } from "foo" assert { "resolution-mode": "import" }; -import type { x as Require } from "foo" assert { "resolution-mode": "require" }; -type _Default = typeof Default; -type _Import = typeof Import; -type _Require = typeof Require; -import type { x as ImportRelative } from "./other" assert { "resolution-mode": "import" }; -import type { x as RequireRelative } from "./other" assert { "resolution-mode": "require" }; -type _ImportRelative = typeof ImportRelative; -type _RequireRelative = typeof RequireRelative; -export { _Default, _Import, _Require, _ImportRelative, _RequireRelative }; diff --git a/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).symbols b/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).symbols deleted file mode 100644 index 1d28242ebf..0000000000 --- a/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).symbols +++ /dev/null @@ -1,73 +0,0 @@ -//// [tests/cases/conformance/moduleResolution/resolutionModeTypeOnlyImport1.ts] //// - -=== /node_modules/@types/foo/index.d.mts === -export declare const x: "module"; ->x : Symbol(x, Decl(index.d.mts, 0, 20)) - -=== /node_modules/@types/foo/index.d.cts === -export declare const x: "script"; ->x : Symbol(x, Decl(index.d.cts, 0, 20)) - -=== /app.ts === -import type { x as Default } from "foo"; ->x : Symbol(Default, Decl(index.d.mts, 0, 20)) ->Default : Symbol(Default, Decl(app.ts, 0, 13)) - -import type { x as Import } from "foo" assert { "resolution-mode": "import" }; ->x : Symbol(Default, Decl(index.d.mts, 0, 20)) ->Import : Symbol(Import, Decl(app.ts, 1, 13)) - -import type { x as Require } from "foo" assert { "resolution-mode": "require" }; ->x : Symbol(Require, Decl(index.d.cts, 0, 20)) ->Require : Symbol(Require, Decl(app.ts, 2, 13)) - -type _Default = typeof Default; ->_Default : Symbol(_Default, Decl(app.ts, 2, 80)) ->Default : Symbol(Default, Decl(app.ts, 0, 13)) - -type _Import = typeof Import; ->_Import : Symbol(_Import, Decl(app.ts, 3, 31)) ->Import : Symbol(Import, Decl(app.ts, 1, 13)) - -type _Require = typeof Require; ->_Require : Symbol(_Require, Decl(app.ts, 4, 29)) ->Require : Symbol(Require, Decl(app.ts, 2, 13)) - -// resolution-mode does not enforce file extension in `bundler`, just sets conditions -import type { x as ImportRelative } from "./other" assert { "resolution-mode": "import" }; ->x : Symbol(ImportRelative, Decl(other.ts, 0, 12)) ->ImportRelative : Symbol(ImportRelative, Decl(app.ts, 8, 13)) - -import type { x as RequireRelative } from "./other" assert { "resolution-mode": "require" }; ->x : Symbol(ImportRelative, Decl(other.ts, 0, 12)) ->RequireRelative : Symbol(RequireRelative, Decl(app.ts, 9, 13)) - -type _ImportRelative = typeof ImportRelative; ->_ImportRelative : Symbol(_ImportRelative, Decl(app.ts, 9, 92)) ->ImportRelative : Symbol(ImportRelative, Decl(app.ts, 8, 13)) - -type _RequireRelative = typeof RequireRelative; ->_RequireRelative : Symbol(_RequireRelative, Decl(app.ts, 10, 45)) ->RequireRelative : Symbol(RequireRelative, Decl(app.ts, 9, 13)) - -export { - _Default, ->_Default : Symbol(_Default, Decl(app.ts, 13, 8)) - - _Import, ->_Import : Symbol(_Import, Decl(app.ts, 14, 11)) - - _Require, ->_Require : Symbol(_Require, Decl(app.ts, 15, 10)) - - _ImportRelative, ->_ImportRelative : Symbol(_ImportRelative, Decl(app.ts, 16, 11)) - - _RequireRelative ->_RequireRelative : Symbol(_RequireRelative, Decl(app.ts, 17, 18)) -} - -=== /other.ts === -export const x = "other"; ->x : Symbol(x, Decl(other.ts, 0, 12)) - diff --git a/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).symbols.diff b/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).symbols.diff deleted file mode 100644 index cee9d3c71a..0000000000 --- a/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).symbols.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- old.resolutionModeTypeOnlyImport1(moduleresolution=node10).symbols -+++ new.resolutionModeTypeOnlyImport1(moduleresolution=node10).symbols -@@= skipped -9, +9 lines =@@ - - === /app.ts === - import type { x as Default } from "foo"; -+>x : Symbol(Default, Decl(index.d.mts, 0, 20)) - >Default : Symbol(Default, Decl(app.ts, 0, 13)) - - import type { x as Import } from "foo" assert { "resolution-mode": "import" }; -->x : Symbol(Import, Decl(index.d.mts, 0, 20)) -+>x : Symbol(Default, Decl(index.d.mts, 0, 20)) - >Import : Symbol(Import, Decl(app.ts, 1, 13)) - - import type { x as Require } from "foo" assert { "resolution-mode": "require" }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).types b/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).types deleted file mode 100644 index 404083065a..0000000000 --- a/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).types +++ /dev/null @@ -1,74 +0,0 @@ -//// [tests/cases/conformance/moduleResolution/resolutionModeTypeOnlyImport1.ts] //// - -=== /node_modules/@types/foo/index.d.mts === -export declare const x: "module"; ->x : "module" - -=== /node_modules/@types/foo/index.d.cts === -export declare const x: "script"; ->x : "script" - -=== /app.ts === -import type { x as Default } from "foo"; ->x : "module" ->Default : any - -import type { x as Import } from "foo" assert { "resolution-mode": "import" }; ->x : "module" ->Import : any - -import type { x as Require } from "foo" assert { "resolution-mode": "require" }; ->x : "script" ->Require : any - -type _Default = typeof Default; ->_Default : "module" ->Default : "module" - -type _Import = typeof Import; ->_Import : "module" ->Import : "module" - -type _Require = typeof Require; ->_Require : "script" ->Require : "script" - -// resolution-mode does not enforce file extension in `bundler`, just sets conditions -import type { x as ImportRelative } from "./other" assert { "resolution-mode": "import" }; ->x : "other" ->ImportRelative : any - -import type { x as RequireRelative } from "./other" assert { "resolution-mode": "require" }; ->x : "other" ->RequireRelative : any - -type _ImportRelative = typeof ImportRelative; ->_ImportRelative : "other" ->ImportRelative : "other" - -type _RequireRelative = typeof RequireRelative; ->_RequireRelative : "other" ->RequireRelative : "other" - -export { - _Default, ->_Default : any - - _Import, ->_Import : any - - _Require, ->_Require : any - - _ImportRelative, ->_ImportRelative : any - - _RequireRelative ->_RequireRelative : any -} - -=== /other.ts === -export const x = "other"; ->x : "other" ->"other" : "other" - diff --git a/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).types.diff b/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).types.diff deleted file mode 100644 index 6ac50255e8..0000000000 --- a/testdata/baselines/reference/submodule/conformance/resolutionModeTypeOnlyImport1(moduleresolution=node10).types.diff +++ /dev/null @@ -1,22 +0,0 @@ ---- old.resolutionModeTypeOnlyImport1(moduleresolution=node10).types -+++ new.resolutionModeTypeOnlyImport1(moduleresolution=node10).types -@@= skipped -9, +9 lines =@@ - - === /app.ts === - import type { x as Default } from "foo"; -->x : any -+>x : "module" - >Default : any - - import type { x as Import } from "foo" assert { "resolution-mode": "import" }; -@@= skipped -12, +12 lines =@@ - >Require : any - - type _Default = typeof Default; -->_Default : any -->Default : any -+>_Default : "module" -+>Default : "module" - - type _Import = typeof Import; - >_Import : "module" \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.symbols.diff b/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.symbols.diff index b8241f1ff0..09efca276a 100644 --- a/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.symbols.diff @@ -1,6 +1,13 @@ --- old.untypedModuleImport_allowJs.symbols +++ new.untypedModuleImport_allowJs.symbols -@@= skipped -11, +11 lines =@@ +@@= skipped -4, +4 lines =@@ + >foo : Symbol(foo, Decl(a.ts, 0, 6)) + + foo.bar(); ++>foo.bar : Symbol(bar, Decl(index.js, 0, 19)) + >foo : Symbol(foo, Decl(a.ts, 0, 6)) ++>bar : Symbol(bar, Decl(index.js, 0, 19)) + === /node_modules/foo/index.js === exports.default = { bar() { return 0; } } >exports.default : Symbol(default, Decl(index.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/verbatimModuleSyntaxRestrictionsESM(esmoduleinterop=false).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/verbatimModuleSyntaxRestrictionsESM(esmoduleinterop=false).errors.txt.diff deleted file mode 100644 index 0e9b1a3815..0000000000 --- a/testdata/baselines/reference/submodule/conformance/verbatimModuleSyntaxRestrictionsESM(esmoduleinterop=false).errors.txt.diff +++ /dev/null @@ -1,25 +0,0 @@ ---- old.verbatimModuleSyntaxRestrictionsESM(esmoduleinterop=false).errors.txt -+++ new.verbatimModuleSyntaxRestrictionsESM(esmoduleinterop=false).errors.txt -@@= skipped -0, +0 lines =@@ - /main.ts(1,1): error TS1202: Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead. --/main.ts(3,8): error TS1259: Module '"/decl"' can only be default-imported using the 'allowSyntheticDefaultImports' flag - - - ==== /decl.d.ts (0 errors) ==== -@@= skipped -15, +14 lines =@@ - interface Typey {} - export type { Typey }; - --==== /main.ts (2 errors) ==== -+==== /main.ts (1 errors) ==== - import CJSy = require("./decl"); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - !!! error TS1202: Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead. - import type CJSy2 = require("./decl"); // ok I guess? - import CJSy3 from "./decl"; // ok in esModuleInterop -- ~~~~~ --!!! error TS1259: Module '"/decl"' can only be default-imported using the 'allowSyntheticDefaultImports' flag --!!! related TS2594 /decl.d.ts:2:1: This module is declared with 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag. - import * as types from "./types"; // ok - CJSy; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/verbatimModuleSyntaxRestrictionsESM(esmoduleinterop=false).types.diff b/testdata/baselines/reference/submodule/conformance/verbatimModuleSyntaxRestrictionsESM(esmoduleinterop=false).types.diff deleted file mode 100644 index fc8ad07d46..0000000000 --- a/testdata/baselines/reference/submodule/conformance/verbatimModuleSyntaxRestrictionsESM(esmoduleinterop=false).types.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.verbatimModuleSyntaxRestrictionsESM(esmoduleinterop=false).types -+++ new.verbatimModuleSyntaxRestrictionsESM(esmoduleinterop=false).types -@@= skipped -30, +30 lines =@@ - >CJSy2 : typeof CJSy - - import CJSy3 from "./decl"; // ok in esModuleInterop -->CJSy3 : any -+>CJSy3 : typeof CJSy - - import * as types from "./types"; // ok - >types : typeof types \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/impliedNodeFormatEmit1(module=commonjs).errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/impliedNodeFormatEmit1(module=commonjs).errors.txt.diff deleted file mode 100644 index 716f7eb3e0..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/impliedNodeFormatEmit1(module=commonjs).errors.txt.diff +++ /dev/null @@ -1,41 +0,0 @@ ---- old.impliedNodeFormatEmit1(module=commonjs).errors.txt -+++ new.impliedNodeFormatEmit1(module=commonjs).errors.txt -@@= skipped -0, +0 lines =@@ --error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. -- -- --!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. --==== /a.ts (0 errors) ==== -- export const _ = 0; -- --==== /b.mts (0 errors) ==== -- export const _ = 0; -- --==== /c.cts (0 errors) ==== -- export const _ = 0; -- --==== /d.js (0 errors) ==== -- export const _ = 0; -- --==== /e.mjs (0 errors) ==== -- export const _ = 0; -- --==== /f.mjs (0 errors) ==== -- export const _ = 0; -- --==== /g.ts (0 errors) ==== -- import {} from "./a"; -- import a = require("./a"); -- --==== /h.mts (0 errors) ==== -- import {} from "./a"; -- import a = require("./a"); -- --==== /i.cts (0 errors) ==== -- import {} from "./a"; -- import a = require("./a"); -- --==== /dummy.ts (0 errors) ==== -- export {}; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/impliedNodeFormatEmit2(module=commonjs).errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/impliedNodeFormatEmit2(module=commonjs).errors.txt.diff deleted file mode 100644 index b7f0510dc4..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/impliedNodeFormatEmit2(module=commonjs).errors.txt.diff +++ /dev/null @@ -1,44 +0,0 @@ ---- old.impliedNodeFormatEmit2(module=commonjs).errors.txt -+++ new.impliedNodeFormatEmit2(module=commonjs).errors.txt -@@= skipped -0, +0 lines =@@ --error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. -- -- --!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. --==== /package.json (0 errors) ==== -- {} -- --==== /a.ts (0 errors) ==== -- export const _ = 0; -- --==== /b.mts (0 errors) ==== -- export const _ = 0; -- --==== /c.cts (0 errors) ==== -- export const _ = 0; -- --==== /d.js (0 errors) ==== -- export const _ = 0; -- --==== /e.mjs (0 errors) ==== -- export const _ = 0; -- --==== /f.mjs (0 errors) ==== -- export const _ = 0; -- --==== /g.ts (0 errors) ==== -- import {} from "./a"; -- import a = require("./a"); -- --==== /h.mts (0 errors) ==== -- import {} from "./a"; -- import a = require("./a"); -- --==== /i.cts (0 errors) ==== -- import {} from "./a"; -- import a = require("./a"); -- --==== /dummy.ts (0 errors) ==== -- export {}; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/impliedNodeFormatEmit3(module=commonjs).errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/impliedNodeFormatEmit3(module=commonjs).errors.txt.diff deleted file mode 100644 index 1542eb27fb..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/impliedNodeFormatEmit3(module=commonjs).errors.txt.diff +++ /dev/null @@ -1,46 +0,0 @@ ---- old.impliedNodeFormatEmit3(module=commonjs).errors.txt -+++ new.impliedNodeFormatEmit3(module=commonjs).errors.txt -@@= skipped -0, +0 lines =@@ --error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. -- -- --!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. --==== /package.json (0 errors) ==== -- { -- "type": "module" -- } -- --==== /a.ts (0 errors) ==== -- export const _ = 0; -- --==== /b.mts (0 errors) ==== -- export const _ = 0; -- --==== /c.cts (0 errors) ==== -- export const _ = 0; -- --==== /d.js (0 errors) ==== -- export const _ = 0; -- --==== /e.mjs (0 errors) ==== -- export const _ = 0; -- --==== /f.mjs (0 errors) ==== -- export const _ = 0; -- --==== /g.ts (0 errors) ==== -- import {} from "./a"; -- import a = require("./a"); -- --==== /h.mts (0 errors) ==== -- import {} from "./a"; -- import a = require("./a"); -- --==== /i.cts (0 errors) ==== -- import {} from "./a"; -- import a = require("./a"); -- --==== /dummy.ts (0 errors) ==== -- export {}; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/impliedNodeFormatEmit4(module=commonjs).errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/impliedNodeFormatEmit4(module=commonjs).errors.txt.diff deleted file mode 100644 index 5bcce73555..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/impliedNodeFormatEmit4(module=commonjs).errors.txt.diff +++ /dev/null @@ -1,46 +0,0 @@ ---- old.impliedNodeFormatEmit4(module=commonjs).errors.txt -+++ new.impliedNodeFormatEmit4(module=commonjs).errors.txt -@@= skipped -0, +0 lines =@@ --error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. -- -- --!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. --==== /package.json (0 errors) ==== -- { -- "type": "commonjs" -- } -- --==== /a.ts (0 errors) ==== -- export const _ = 0; -- --==== /b.mts (0 errors) ==== -- export const _ = 0; -- --==== /c.cts (0 errors) ==== -- export const _ = 0; -- --==== /d.js (0 errors) ==== -- export const _ = 0; -- --==== /e.mjs (0 errors) ==== -- export const _ = 0; -- --==== /f.mjs (0 errors) ==== -- export const _ = 0; -- --==== /g.ts (0 errors) ==== -- import {} from "./a"; -- import a = require("./a"); -- --==== /h.mts (0 errors) ==== -- import {} from "./a"; -- import a = require("./a"); -- --==== /i.cts (0 errors) ==== -- import {} from "./a"; -- import a = require("./a"); -- --==== /dummy.ts (0 errors) ==== -- export {}; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/javascriptImportDefaultBadExport.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/javascriptImportDefaultBadExport.errors.txt.diff deleted file mode 100644 index f5b43be1b6..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/javascriptImportDefaultBadExport.errors.txt.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.javascriptImportDefaultBadExport.errors.txt -+++ new.javascriptImportDefaultBadExport.errors.txt -@@= skipped -0, +0 lines =@@ --/b.js(1,8): error TS1259: Module '"/a"' can only be default-imported using the 'esModuleInterop' flag -- -- --==== /a.js (0 errors) ==== -- const alias = {}; -- module.exports = alias; -- --==== /b.js (1 errors) ==== -- import a from "./a"; -- ~ --!!! error TS1259: Module '"/a"' can only be default-imported using the 'esModuleInterop' flag --!!! related TS2594 /a.js:2:1: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag. -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/javascriptImportDefaultBadExport.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/javascriptImportDefaultBadExport.types.diff index aeec21acd4..784ed9da3d 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/javascriptImportDefaultBadExport.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/javascriptImportDefaultBadExport.types.diff @@ -8,8 +8,3 @@ +>module : { readonly alias: {}; } >exports : {} >alias : {} - - === /b.js === - import a from "./a"; -->a : any -+>a : {} diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithExtensions_withPaths.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithExtensions_withPaths.errors.txt.diff index e6c2e15dc9..eabb80cb29 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithExtensions_withPaths.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithExtensions_withPaths.errors.txt.diff @@ -1,55 +1,34 @@ --- old.moduleResolutionWithExtensions_withPaths.errors.txt +++ new.moduleResolutionWithExtensions_withPaths.errors.txt @@= skipped -0, +0 lines =@@ -- +-/tsconfig.json(7,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- +- +-==== /tsconfig.json (1 errors) ==== +/tsconfig.json(6,3): error TS5102: Option 'baseUrl' has been removed. Please remove it from your configuration. + Use '"paths": {"*": ["./*"]}' instead. +/tsconfig.json(11,14): error TS5090: Non-relative paths are not allowed. Did you forget a leading './'? + + +==== /tsconfig.json (2 errors) ==== -+ { -+ "compilerOptions": { -+ "outDir": "lib", -+ "target": "ES6", -+ "module": "ES6", -+ "baseUrl": "/", + { + "compilerOptions": { + "outDir": "lib", + "target": "ES6", + "module": "ES6", + "baseUrl": "/", + ~~~~~~~~~ +!!! error TS5102: Option 'baseUrl' has been removed. Please remove it from your configuration. +!!! error TS5102: Use '"paths": {"*": ["./*"]}' instead. -+ "moduleResolution": "Node", -+ "noImplicitAny": true, -+ "traceResolution": true, -+ "paths": { -+ "foo/*": ["node_modules/foo/lib/*"] + "moduleResolution": "Node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + "noImplicitAny": true, + "traceResolution": true, + "paths": { + "foo/*": ["node_modules/foo/lib/*"] + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS5090: Non-relative paths are not allowed. Did you forget a leading './'? -+ } -+ } -+ } -+ -+==== /relative.d.ts (0 errors) ==== -+ export declare function relative(): void; -+ -+ -+==== /test.ts (0 errors) ==== -+ import { test } from "foo/test.js"; -+ import { test as test2 } from "foo/test"; -+ import { relative } from "./relative.js"; -+ import { relative as relative2 } from "./relative"; -+ -+ -+ -+==== /node_modules/foo/lib/test.js (0 errors) ==== -+ export function test() { -+ console.log("test"); -+ } -+ -+==== /node_modules/foo/lib/test.d.ts (0 errors) ==== -+ export declare function test(): void; -+ -+==== /relative.js (0 errors) ==== -+ export function relative() { -+ console.log("test"); -+ } -+ \ No newline at end of file + } + } + } \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithSuffixes_one_externalModule_withPaths.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithSuffixes_one_externalModule_withPaths.errors.txt.diff index 2b671ba16c..1dc67f7b32 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithSuffixes_one_externalModule_withPaths.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithSuffixes_one_externalModule_withPaths.errors.txt.diff @@ -1,7 +1,10 @@ --- old.moduleResolutionWithSuffixes_one_externalModule_withPaths.errors.txt +++ new.moduleResolutionWithSuffixes_one_externalModule_withPaths.errors.txt @@= skipped -0, +0 lines =@@ -- +-/tsconfig.json(6,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- +- +-==== /tsconfig.json (1 errors) ==== +/tsconfig.json(9,3): error TS5102: Option 'baseUrl' has been removed. Please remove it from your configuration. + Use '"paths": {"*": ["./*"]}' instead. +/tsconfig.json(11,21): error TS5090: Non-relative paths are not allowed. Did you forget a leading './'? @@ -9,46 +12,27 @@ + + +==== /tsconfig.json (3 errors) ==== -+ { -+ "compilerOptions": { -+ "allowJs": true, -+ "checkJs": false, -+ "outDir": "bin", -+ "moduleResolution": "node", -+ "traceResolution": true, -+ "moduleSuffixes": [".ios"], -+ "baseUrl": "/", + { + "compilerOptions": { + "allowJs": true, + "checkJs": false, + "outDir": "bin", + "moduleResolution": "node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + "traceResolution": true, + "moduleSuffixes": [".ios"], + "baseUrl": "/", + ~~~~~~~~~ +!!! error TS5102: Option 'baseUrl' has been removed. Please remove it from your configuration. +!!! error TS5102: Use '"paths": {"*": ["./*"]}' instead. -+ "paths": { -+ "some-library": ["node_modules/some-library/lib"], + "paths": { + "some-library": ["node_modules/some-library/lib"], + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS5090: Non-relative paths are not allowed. Did you forget a leading './'? -+ "some-library/*": ["node_modules/some-library/lib/*"] + "some-library/*": ["node_modules/some-library/lib/*"] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS5090: Non-relative paths are not allowed. Did you forget a leading './'? -+ } -+ } -+ } -+ -+==== /test.ts (0 errors) ==== -+ import { ios } from "some-library"; -+ import { ios as ios2 } from "some-library/index"; -+ import { ios as ios3 } from "some-library/index.js"; -+ -+==== /node_modules/some-library/lib/index.ios.js (0 errors) ==== -+ "use strict"; -+ exports.__esModule = true; -+ function ios() {} -+ exports.ios = ios; -+==== /node_modules/some-library/lib/index.ios.d.ts (0 errors) ==== -+ export declare function ios(): void; -+==== /node_modules/some-library/lib/index.js (0 errors) ==== -+ "use strict"; -+ exports.__esModule = true; -+ function base() {} -+ exports.base = base; -+==== /node_modules/some-library/lib/index.d.ts (0 errors) ==== -+ export declare function base(): void; -+ \ No newline at end of file + } + } + } \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithSuffixes_one_jsModule.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithSuffixes_one_jsModule.errors.txt.diff new file mode 100644 index 0000000000..80d11e391b --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithSuffixes_one_jsModule.errors.txt.diff @@ -0,0 +1,34 @@ +--- old.moduleResolutionWithSuffixes_one_jsModule.errors.txt ++++ new.moduleResolutionWithSuffixes_one_jsModule.errors.txt +@@= skipped -0, +0 lines =@@ +-/tsconfig.json(6,23): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- +- +-==== /tsconfig.json (1 errors) ==== +- { +- "compilerOptions": { +- "allowJs": true, +- "checkJs": false, +- "outDir": "bin", +- "moduleResolution": "node", +- ~~~~~~ +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +- "traceResolution": true, +- "moduleSuffixes": [".ios"] +- } +- } +- +-==== /index.ts (0 errors) ==== +- import { ios } from "./foo.js"; +-==== /foo.ios.js (0 errors) ==== +- "use strict"; +- exports.__esModule = true; +- function ios() {} +- exports.ios = ios; +-==== /foo.js (0 errors) ==== +- "use strict"; +- exports.__esModule = true; +- function base() {} +- exports.base = base; +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/extensionLoadingPriority(moduleresolution=bundler).errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/extensionLoadingPriority(moduleresolution=bundler).errors.txt.diff deleted file mode 100644 index 61cf962fad..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/extensionLoadingPriority(moduleresolution=bundler).errors.txt.diff +++ /dev/null @@ -1,24 +0,0 @@ ---- old.extensionLoadingPriority(moduleresolution=bundler).errors.txt -+++ new.extensionLoadingPriority(moduleresolution=bundler).errors.txt -@@= skipped -0, +0 lines =@@ --error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. -- -- --!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. --==== /project/a.js (0 errors) ==== -- export default "a.js"; -- --==== /project/a.js.js (0 errors) ==== -- export default "a.js.js"; -- --==== /project/dir/index.ts (0 errors) ==== -- export default "dir/index.ts"; -- --==== /project/dir.js (0 errors) ==== -- export default "dir.js"; -- --==== /project/b.ts (0 errors) ==== -- import a from "./a.js"; -- import dir from "./dir"; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/extensionLoadingPriority(moduleresolution=node).types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/extensionLoadingPriority(moduleresolution=node).types.diff deleted file mode 100644 index 9d61d367b4..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/extensionLoadingPriority(moduleresolution=node).types.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.extensionLoadingPriority(moduleresolution=node).types -+++ new.extensionLoadingPriority(moduleresolution=node).types -@@= skipped -20, +20 lines =@@ - >a : "a.js" - - import dir from "./dir"; -->dir : "dir/index.ts" -+>dir : "dir.js" diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/node10AlternateResult_noResolution.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/node10AlternateResult_noResolution.errors.txt.diff index cec346e587..a6775022ac 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/node10AlternateResult_noResolution.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/node10AlternateResult_noResolution.errors.txt.diff @@ -1,13 +1,19 @@ --- old.node10AlternateResult_noResolution.errors.txt +++ new.node10AlternateResult_noResolution.errors.txt @@= skipped -0, +0 lines =@@ +-error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -/index.ts(1,21): error TS2307: Cannot find module 'pkg' or its corresponding type declarations. - There are types at '/node_modules/pkg/definitely-not-index.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'. +- +- +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +/index.ts(1,10): error TS2305: Module '"pkg"' has no exported member 'pkg'. - - ++ ++ ==== /node_modules/pkg/package.json (0 errors) ==== -@@= skipped -15, +14 lines =@@ + { + "name": "pkg", +@@= skipped -17, +14 lines =@@ ==== /index.ts (1 errors) ==== import { pkg } from "pkg"; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/node10Alternateresult_noTypes.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/node10Alternateresult_noTypes.errors.txt.diff index cbdb934c2a..7a0400b9f7 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/node10Alternateresult_noTypes.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/node10Alternateresult_noTypes.errors.txt.diff @@ -1,6 +1,7 @@ --- old.node10Alternateresult_noTypes.errors.txt +++ new.node10Alternateresult_noTypes.errors.txt @@= skipped -0, +0 lines =@@ +-error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -error TS6504: File '/node_modules/pkg/untyped.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? - The file is in the program because: - Root file specified for compilation @@ -8,6 +9,7 @@ - There are types at '/node_modules/pkg/definitely-not-index.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'. - - +-!!! error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -!!! error TS6504: File '/node_modules/pkg/untyped.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -!!! error TS6504: The file is in the program because: -!!! error TS6504: Root file specified for compilation @@ -17,7 +19,7 @@ ==== /node_modules/pkg/package.json (0 errors) ==== { "name": "pkg", -@@= skipped -25, +18 lines =@@ +@@= skipped -27, +18 lines =@@ ==== /index.ts (1 errors) ==== import { pkg } from "pkg"; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/untypedModuleImport_allowJs.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/untypedModuleImport_allowJs.errors.txt.diff new file mode 100644 index 0000000000..1d8aabb7f2 --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/conformance/untypedModuleImport_allowJs.errors.txt.diff @@ -0,0 +1,16 @@ +--- old.untypedModuleImport_allowJs.errors.txt ++++ new.untypedModuleImport_allowJs.errors.txt +@@= skipped -0, +0 lines =@@ +-/a.ts(2,5): error TS2339: Property 'bar' does not exist on type 'typeof import("/node_modules/foo/index")'. +- +- +-==== /a.ts (1 errors) ==== +- import foo from "foo"; +- foo.bar(); +- ~~~ +-!!! error TS2339: Property 'bar' does not exist on type 'typeof import("/node_modules/foo/index")'. +- +-==== /node_modules/foo/index.js (0 errors) ==== +- exports.default = { bar() { return 0; } } +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/untypedModuleImport_allowJs.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/untypedModuleImport_allowJs.types.diff new file mode 100644 index 0000000000..ede066d4fe --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/conformance/untypedModuleImport_allowJs.types.diff @@ -0,0 +1,21 @@ +--- old.untypedModuleImport_allowJs.types ++++ new.untypedModuleImport_allowJs.types +@@= skipped -1, +1 lines =@@ + + === /a.ts === + import foo from "foo"; +->foo : typeof foo ++>foo : { bar(): number; } + + foo.bar(); +->foo.bar() : any +->foo.bar : any +->foo : typeof foo +->bar : any ++>foo.bar() : number ++>foo.bar : () => number ++>foo : { bar(): number; } ++>bar : () => number + + === /node_modules/foo/index.js === + exports.default = { bar() { return 0; } } \ No newline at end of file From 0a61d1a166bca5715dc4fd116bcf08e11bcc1c80 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Mon, 20 Oct 2025 15:45:08 -0700 Subject: [PATCH 39/69] Disable create-cache.yml in forks (#1912) --- .github/workflows/create-cache.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/create-cache.yml b/.github/workflows/create-cache.yml index df7cf27b7d..7e7eff9783 100644 --- a/.github/workflows/create-cache.yml +++ b/.github/workflows/create-cache.yml @@ -20,6 +20,8 @@ defaults: jobs: cache: + if: github.repository == 'microsoft/typescript-go' + strategy: fail-fast: false matrix: From bfa05c307e0fb1b2262cc4a2b1bf3a6c01dadfc2 Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Tue, 21 Oct 2025 10:59:12 +0900 Subject: [PATCH 40/69] apply UnmarshalJSONFrom --- go.mod | 2 +- internal/module/pnp/manifest.go | 34 ++++++++++++++++++++++++++------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 382cd289f2..8f5243215c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/microsoft/typescript-go -go 1.25.0 +go 1.25 require ( github.com/dlclark/regexp2 v1.11.5 diff --git a/internal/module/pnp/manifest.go b/internal/module/pnp/manifest.go index b37320fba9..442167f690 100644 --- a/internal/module/pnp/manifest.go +++ b/internal/module/pnp/manifest.go @@ -57,7 +57,11 @@ type PackageDependency struct { IsAlias bool } -func (p *PackageDependency) UnmarshalJSON(data []byte) error { +func (p *PackageDependency) UnmarshalJSONFrom(dec *jsontext.Decoder) error { + data, err := dec.ReadValue() + if err != nil { + return err + } // case 1: string var s string if err := json.Unmarshal(data, &s); err == nil { @@ -82,13 +86,17 @@ func (p *PackageDependency) UnmarshalJSON(data []byte) error { type FallbackPool map[string]*PackageDependency -func (r *RegexDef) UnmarshalJSON(b []byte) error { - if bytes.Equal(bytes.TrimSpace(b), []byte("null")) { +func (r *RegexDef) UnmarshalJSONFrom(dec *jsontext.Decoder) error { + data, err := dec.ReadValue() + if err != nil { + return err + } + if bytes.Equal(bytes.TrimSpace(data), []byte("null")) { *r = RegexDef{} return nil } var s string - if err := json.Unmarshal(b, &s); err != nil { + if err := json.Unmarshal(data, &s); err != nil { return err } r.Source = s @@ -100,7 +108,11 @@ func (r *RegexDef) UnmarshalJSON(b []byte) error { return nil } -func (m *FallbackPool) UnmarshalJSON(data []byte) error { +func (m *FallbackPool) UnmarshalJSONFrom(dec *jsontext.Decoder) error { + data, err := dec.ReadValue() + if err != nil { + return err + } var items []jsontext.Value if err := json.Unmarshal(data, &items); err != nil { return err @@ -137,7 +149,11 @@ func (m *FallbackPool) UnmarshalJSON(data []byte) error { type FallbackExclusionList map[string][]string -func (m *FallbackExclusionList) UnmarshalJSON(data []byte) error { +func (m *FallbackExclusionList) UnmarshalJSONFrom(dec *jsontext.Decoder) error { + data, err := dec.ReadValue() + if err != nil { + return err + } var items []jsontext.Value if err := json.Unmarshal(data, &items); err != nil { return err @@ -167,7 +183,11 @@ func (m *FallbackExclusionList) UnmarshalJSON(data []byte) error { type PackageRegistryData map[string]map[string]PackageInformation -func (m *PackageRegistryData) UnmarshalJSON(data []byte) error { +func (m *PackageRegistryData) UnmarshalJSONFrom(dec *jsontext.Decoder) error { + data, err := dec.ReadValue() + if err != nil { + return err + } var items []jsontext.Value if err := json.Unmarshal(data, &items); err != nil { return err From 55cbeadf4586dddcb859e6021939ae4816bcd12a Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Mon, 20 Oct 2025 19:11:30 -0700 Subject: [PATCH 41/69] Forbid platform specific package uses in agnostic files (#1911) --- .golangci.yml | 20 ++++++++++++++++++++ cmd/tsgo/lsp.go | 14 +++++++++++++- internal/fourslash/fourslash.go | 3 ++- internal/lsp/server.go | 17 ++++++----------- internal/tspath/extension.go | 2 +- 5 files changed, 42 insertions(+), 14 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index afb62f07e9..5212cb09a7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -22,6 +22,7 @@ linters: - errname - errorlint - fatcontext + - forbidigo - gocheckcompilerdirectives - goprintffuncname - govet @@ -70,11 +71,30 @@ linters: - pkg: 'encoding/json$' desc: 'Use "github.com/go-json-experiment/json" instead.' + forbidigo: + analyze-types: true + forbid: + - pattern: '.*' + msg: tspath should likely be used instead + pkg: ^(path|path/filepath)$ + - pattern: '.*' + msg: a host implementation should likely be used instead + pkg: ^os/ + - pattern: 'GOOS' + msg: a host implementation should likely be used instead + pkg: ^runtime$ + exclusions: rules: - path: internal/fourslash/tests/gen/ linters: - misspell + - path: 'internal/(repo|testutil|testrunner|vfs|pprof|execute/tsctests|bundled)|cmd/tsgo' + text: should likely be used instead + - path: '(.+)_test\.go$' + text: should likely be used instead + - path: '_tools' + text: should likely be used instead presets: - comments diff --git a/cmd/tsgo/lsp.go b/cmd/tsgo/lsp.go index 35c973a3a0..0dd04c57fb 100644 --- a/cmd/tsgo/lsp.go +++ b/cmd/tsgo/lsp.go @@ -1,10 +1,14 @@ package main import ( + "context" "flag" "fmt" "os" + "os/exec" + "os/signal" "runtime" + "syscall" "github.com/microsoft/typescript-go/internal/bundled" "github.com/microsoft/typescript-go/internal/core" @@ -49,9 +53,17 @@ func runLSP(args []string) int { FS: fs, DefaultLibraryPath: defaultLibraryPath, TypingsLocation: typingsLocation, + NpmInstall: func(cwd string, args []string) ([]byte, error) { + cmd := exec.Command("npm", args...) + cmd.Dir = cwd + return cmd.Output() + }, }) - if err := s.Run(); err != nil { + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) + defer stop() + + if err := s.Run(ctx); err != nil { return 1 } return 0 diff --git a/internal/fourslash/fourslash.go b/internal/fourslash/fourslash.go index 8c64ea2f90..ddac550413 100644 --- a/internal/fourslash/fourslash.go +++ b/internal/fourslash/fourslash.go @@ -1,6 +1,7 @@ package fourslash import ( + "context" "fmt" "io" "maps" @@ -164,7 +165,7 @@ func NewFourslash(t *testing.T, capabilities *lsproto.ClientCapabilities, conten defer func() { outputWriter.Close() }() - err := server.Run() + err := server.Run(context.TODO()) if err != nil { t.Error("server error:", err) } diff --git a/internal/lsp/server.go b/internal/lsp/server.go index 54f78f2e16..2265ebb344 100644 --- a/internal/lsp/server.go +++ b/internal/lsp/server.go @@ -5,14 +5,10 @@ import ( "errors" "fmt" "io" - "os" - "os/exec" - "os/signal" "runtime/debug" "slices" "sync" "sync/atomic" - "syscall" "time" "github.com/go-json-experiment/json" @@ -39,6 +35,7 @@ type ServerOptions struct { DefaultLibraryPath string TypingsLocation string ParseCache *project.ParseCache + NpmInstall func(cwd string, args []string) ([]byte, error) } func NewServer(opts *ServerOptions) *Server { @@ -59,6 +56,7 @@ func NewServer(opts *ServerOptions) *Server { defaultLibraryPath: opts.DefaultLibraryPath, typingsLocation: opts.TypingsLocation, parseCache: opts.ParseCache, + npmInstall: opts.NpmInstall, } } @@ -157,6 +155,8 @@ type Server struct { compilerOptionsForInferredProjects *core.CompilerOptions // parseCache can be passed in so separate tests can share ASTs parseCache *project.ParseCache + + npmInstall func(cwd string, args []string) ([]byte, error) } // WatchFiles implements project.Client. @@ -218,10 +218,7 @@ func (s *Server) RefreshDiagnostics(ctx context.Context) error { return nil } -func (s *Server) Run() error { - ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) - defer stop() - +func (s *Server) Run(ctx context.Context) error { g, ctx := errgroup.WithContext(ctx) g.Go(func() error { return s.dispatchLoop(ctx) }) g.Go(func() error { return s.writeLoop(ctx) }) @@ -877,9 +874,7 @@ func (s *Server) SetCompilerOptionsForInferredProjects(ctx context.Context, opti // NpmInstall implements ata.NpmExecutor func (s *Server) NpmInstall(cwd string, args []string) ([]byte, error) { - cmd := exec.Command("npm", args...) - cmd.Dir = cwd - return cmd.Output() + return s.npmInstall(cwd, args) } func isBlockingMethod(method lsproto.Method) bool { diff --git a/internal/tspath/extension.go b/internal/tspath/extension.go index cc30d48a66..1b4422e791 100644 --- a/internal/tspath/extension.go +++ b/internal/tspath/extension.go @@ -51,7 +51,7 @@ func RemoveFileExtension(path string) string { } } // Otherwise just remove single dot extension, if any - return path[:len(path)-len(filepath.Ext(path))] + return path[:len(path)-len(filepath.Ext(path))] //nolint:forbidigo } func TryGetExtensionFromPath(p string) string { From 62fcda71d91eeda9ba619a42351f8e494e0659f0 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Oct 2025 08:41:35 -0700 Subject: [PATCH 42/69] Fix JSDoc comment formatting with tab indentation (#1900) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com> --- internal/format/comment_test.go | 37 +++++++++++++++++++++++++++++++++ internal/format/span.go | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/internal/format/comment_test.go b/internal/format/comment_test.go index b7063bfe5d..50762ab56d 100644 --- a/internal/format/comment_test.go +++ b/internal/format/comment_test.go @@ -64,6 +64,43 @@ func TestCommentFormatting(t *testing.T) { assert.Check(t, !contains(secondFormatted, " sync x()"), "should not corrupt async to sync") assert.Check(t, contains(secondFormatted, "async"), "should preserve async keyword on second pass") }) + + t.Run("format JSDoc with tab indentation", func(t *testing.T) { + t.Parallel() + ctx := format.WithFormatCodeSettings(t.Context(), &format.FormatCodeSettings{ + EditorSettings: format.EditorSettings{ + TabSize: 4, + IndentSize: 4, + BaseIndentSize: 0, + NewLineCharacter: "\n", + ConvertTabsToSpaces: false, // Use tabs + IndentStyle: format.IndentStyleSmart, + TrimTrailingWhitespace: true, + }, + InsertSpaceBeforeTypeAnnotation: core.TSTrue, + }, "\n") + + // Original code with tab indentation (tabs represented as \t) + originalText := "class Foo {\n\t/**\n\t * @param {string} argument - This is a param description.\n\t */\n\texample(argument) {\nconsole.log(argument);\n\t}\n}" + + sourceFile := parser.ParseSourceFile(ast.SourceFileParseOptions{ + FileName: "/test.ts", + Path: "/test.ts", + }, originalText, core.ScriptKindTS) + + // Apply formatting + edits := format.FormatDocument(ctx, sourceFile) + formatted := applyBulkEdits(originalText, edits) + + // Check that tabs come before spaces (not spaces before tabs) + // The comment lines should have format: tab followed by space and asterisk + // NOT: space followed by tab and asterisk + assert.Check(t, !contains(formatted, " \t*"), "should not have space before tab before asterisk") + assert.Check(t, contains(formatted, "\t *"), "should have tab before space before asterisk") + + // Verify console.log is properly indented with tabs + assert.Check(t, contains(formatted, "\t\tconsole.log"), "console.log should be indented with two tabs") + }) } func contains(s, substr string) bool { diff --git a/internal/format/span.go b/internal/format/span.go index 4657949f7e..c8d0096bed 100644 --- a/internal/format/span.go +++ b/internal/format/span.go @@ -975,7 +975,7 @@ func getIndentationString(indentation int, options *FormatCodeSettings) string { spaces := indentation - (tabs * options.TabSize) res := strings.Repeat("\t", tabs) if spaces > 0 { - res = strings.Repeat(" ", spaces) + res + res = res + strings.Repeat(" ", spaces) } return res From e697dcee8beb826f317b153f5f7ea78f61548daa Mon Sep 17 00:00:00 2001 From: "gun.yu" Date: Wed, 22 Oct 2025 03:07:23 +0900 Subject: [PATCH 43/69] apply UnmarshalJSONFrom in manifest --- internal/module/pnp/manifest.go | 266 +++++++++++++++++++++----------- 1 file changed, 178 insertions(+), 88 deletions(-) diff --git a/internal/module/pnp/manifest.go b/internal/module/pnp/manifest.go index 442167f690..c51bb38d22 100644 --- a/internal/module/pnp/manifest.go +++ b/internal/module/pnp/manifest.go @@ -1,8 +1,8 @@ package pnp import ( - "bytes" "errors" + "fmt" "strings" "github.com/dlclark/regexp2" @@ -51,52 +51,118 @@ type PackageInformation struct { PackageDependencies FallbackPool `json:"packageDependencies"` } +type FallbackPool map[string]*PackageDependency + type PackageDependency struct { Reference string Alias [2]string IsAlias bool } -func (p *PackageDependency) UnmarshalJSONFrom(dec *jsontext.Decoder) error { - data, err := dec.ReadValue() - if err != nil { +type PackageRegistryData map[string]map[string]PackageInformation + +var _ json.UnmarshalerFrom = (*Manifest)(nil) + +func (m *Manifest) UnmarshalJSONFrom(dec *jsontext.Decoder) error { + if _, err := dec.ReadToken(); err != nil { return err } - // case 1: string - var s string - if err := json.Unmarshal(data, &s); err == nil { + for dec.PeekKind() != jsontext.EndObject.Kind() { + fieldName, err := dec.ReadValue() + if err != nil { + return err + } + + switch string(fieldName) { + case `"enableTopLevelFallback"`: + if err := json.UnmarshalDecode(dec, &m.EnableTopLevelFallback); err != nil { + return err + } + case `"ignorePatternData"`: + if err := json.UnmarshalDecode(dec, &m.IgnorePatternData); err != nil { + return err + } + case `"dependencyTreeRoots"`: + if err := json.UnmarshalDecode(dec, &m.DependencyTreeRoots); err != nil { + return err + } + case `"fallbackPool"`: + if err := json.UnmarshalDecode(dec, &m.FallbackPool); err != nil { + return err + } + case `"fallbackExclusionList"`: + if err := json.UnmarshalDecode(dec, &m.FallbackExclusionList); err != nil { + fmt.Println("error", err) + return err + } + case `"packageRegistryData"`: + if err := json.UnmarshalDecode(dec, &m.PackageRegistryData); err != nil { + return err + } + default: + if _, err := dec.ReadValue(); err != nil { + return err + } + } + } + if _, err := dec.ReadToken(); err != nil { + return err + } + + return nil +} + +var _ json.UnmarshalerFrom = (*PackageDependency)(nil) + +func (p *PackageDependency) UnmarshalJSONFrom(dec *jsontext.Decoder) error { + switch dec.PeekKind() { + case '"': // string case + var s string + if err := json.UnmarshalDecode(dec, &s); err != nil { + return err + } p.Reference = s p.IsAlias = false return nil - } - - // case 2: [string, string] - var arr []string - if err := json.Unmarshal(data, &arr); err == nil { + case '[': // array case + if _, err := dec.ReadToken(); err != nil { + return err + } + var arr []string + for dec.PeekKind() != jsontext.EndArray.Kind() { + var s string + if err := json.UnmarshalDecode(dec, &s); err != nil { + return err + } + arr = append(arr, s) + } + if _, err := dec.ReadToken(); err != nil { + return err + } if len(arr) != 2 { return errors.New("PackageDependency: array must have length 2") } p.IsAlias = true p.Alias = [2]string{arr[0], arr[1]} return nil + default: + return errors.New("PackageDependency: unsupported JSON shape") } - - return errors.New("PackageDependency: unsupported JSON shape") } -type FallbackPool map[string]*PackageDependency +var _ json.UnmarshalerFrom = (*RegexDef)(nil) func (r *RegexDef) UnmarshalJSONFrom(dec *jsontext.Decoder) error { - data, err := dec.ReadValue() - if err != nil { - return err - } - if bytes.Equal(bytes.TrimSpace(data), []byte("null")) { + if dec.PeekKind() == jsontext.Null.Kind() { + if _, err := dec.ReadToken(); err != nil { + return err + } *r = RegexDef{} return nil } + var s string - if err := json.Unmarshal(data, &s); err != nil { + if err := json.UnmarshalDecode(dec, &s); err != nil { return err } r.Source = s @@ -108,138 +174,162 @@ func (r *RegexDef) UnmarshalJSONFrom(dec *jsontext.Decoder) error { return nil } -func (m *FallbackPool) UnmarshalJSONFrom(dec *jsontext.Decoder) error { - data, err := dec.ReadValue() - if err != nil { - return err - } - var items []jsontext.Value - if err := json.Unmarshal(data, &items); err != nil { +var _ json.UnmarshalerFrom = (*FallbackPool)(nil) + +func (f *FallbackPool) UnmarshalJSONFrom(dec *jsontext.Decoder) error { + if _, err := dec.ReadToken(); err != nil { return err } - res := make(FallbackPool, len(items)) - for _, it := range items { - var pair []jsontext.Value - if err := json.Unmarshal(it, &pair); err != nil { + + res := make(FallbackPool) + + for dec.PeekKind() != jsontext.EndArray.Kind() { + if _, err := dec.ReadToken(); err != nil { return err } - if len(pair) != 2 { - return errors.New("fallbackPool: each item must have 2 elements") - } + var key string - if err := json.Unmarshal(pair[0], &key); err != nil { + if err := json.UnmarshalDecode(dec, &key); err != nil { return err } - raw := bytes.TrimSpace(pair[1]) - if bytes.Equal(raw, []byte("null")) { + if dec.PeekKind() == jsontext.Null.Kind() { + if _, err := dec.ReadToken(); err != nil { + return err + } res[key] = nil - continue + } else { + var dep PackageDependency + if err := json.UnmarshalDecode(dec, &dep); err != nil { + return err + } + res[key] = &dep } - var dep PackageDependency - if err := json.Unmarshal(pair[1], &dep); err != nil { + if _, err := dec.ReadToken(); err != nil { return err } - res[key] = &dep } - *m = res + + if _, err := dec.ReadToken(); err != nil { + return err + } + + *f = res return nil } type FallbackExclusionList map[string][]string -func (m *FallbackExclusionList) UnmarshalJSONFrom(dec *jsontext.Decoder) error { - data, err := dec.ReadValue() - if err != nil { - return err - } - var items []jsontext.Value - if err := json.Unmarshal(data, &items); err != nil { +var _ json.UnmarshalerFrom = (*FallbackExclusionList)(nil) + +func (f *FallbackExclusionList) UnmarshalJSONFrom(dec *jsontext.Decoder) error { + // start of array + if _, err := dec.ReadToken(); err != nil { return err } - res := make(FallbackExclusionList, len(items)) - for _, it := range items { - var pair []jsontext.Value - if err := json.Unmarshal(it, &pair); err != nil { + + res := make(FallbackExclusionList) + + for dec.PeekKind() != jsontext.EndArray.Kind() { + // start of array + if _, err := dec.ReadToken(); err != nil { return err } - if len(pair) != 2 { - return errors.New("fallbackExclusionList: each item must have 2 elements") - } + var key string - if err := json.Unmarshal(pair[0], &key); err != nil { + if err := json.UnmarshalDecode(dec, &key); err != nil { return err } + var arr []string - if err := json.Unmarshal(pair[1], &arr); err != nil { + if err := json.UnmarshalDecode(dec, &arr); err != nil { return err } + res[key] = arr + + // end of array + if _, err := dec.ReadToken(); err != nil { + return err + } } - *m = res + + // end of array + if _, err := dec.ReadToken(); err != nil { + return err + } + + *f = res return nil } -type PackageRegistryData map[string]map[string]PackageInformation +var _ json.UnmarshalerFrom = (*PackageRegistryData)(nil) func (m *PackageRegistryData) UnmarshalJSONFrom(dec *jsontext.Decoder) error { - data, err := dec.ReadValue() - if err != nil { + if _, err := dec.ReadToken(); err != nil { return err } - var items []jsontext.Value - if err := json.Unmarshal(data, &items); err != nil { - return err - } - res := make(PackageRegistryData, len(items)) - for _, it := range items { - var pair []jsontext.Value - if err := json.Unmarshal(it, &pair); err != nil { + res := make(PackageRegistryData) + + for dec.PeekKind() != jsontext.EndArray.Kind() { + // start of array1 + if _, err := dec.ReadToken(); err != nil { return err } - if len(pair) != 2 { - return errors.New("packageRegistryData: each item must have 2 elements") - } - var key1 *string - if err := json.Unmarshal(pair[0], &key1); err != nil { + if err := json.UnmarshalDecode(dec, &key1); err != nil { return err } k1 := "" if key1 != nil { k1 = *key1 } - - var inner []jsontext.Value - if err := json.Unmarshal(pair[1], &inner); err != nil { + // start of array2 + if _, err := dec.ReadToken(); err != nil { return err } - innerMap := make(map[string]PackageInformation, len(inner)) - for _, e := range inner { - var p2 []jsontext.Value - if err := json.Unmarshal(e, &p2); err != nil { + innerMap := make(map[string]PackageInformation) + for dec.PeekKind() != jsontext.EndArray.Kind() { + if _, err := dec.ReadToken(); err != nil { return err } - if len(p2) != 2 { - return errors.New("packageRegistryData: inner item must have 2 elements") - } + var key2 *string - if err := json.Unmarshal(p2[0], &key2); err != nil { + if err := json.UnmarshalDecode(dec, &key2); err != nil { return err } k2 := "" if key2 != nil { k2 = *key2 } + var info PackageInformation - if err := json.Unmarshal(p2[1], &info); err != nil { + if err := json.UnmarshalDecode(dec, &info); err != nil { return err } + innerMap[k2] = info + + if _, err := dec.ReadToken(); err != nil { + return err + } + } + // end of array2 + if _, err := dec.ReadToken(); err != nil { + return err } res[k1] = innerMap + + // end of array1 + if _, err := dec.ReadToken(); err != nil { + return err + } } + if _, err := dec.ReadToken(); err != nil { + return err + } + *m = res return nil } From d491e609b5e584a712bfd2510ae466e54fb961fb Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Wed, 22 Oct 2025 10:12:01 -0700 Subject: [PATCH 44/69] Clear local baseline dir in hereby test (#1921) --- Herebyfile.mjs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Herebyfile.mjs b/Herebyfile.mjs index b43a2b0115..b1b7e03b91 100644 --- a/Herebyfile.mjs +++ b/Herebyfile.mjs @@ -57,6 +57,7 @@ const { values: rawOptions } = parseArgs({ tests: { type: "string", short: "t" }, fix: { type: "boolean" }, debug: { type: "boolean" }, + dirty: { type: "boolean" }, insiders: { type: "boolean" }, @@ -325,6 +326,12 @@ function goTest(taskName) { async function runTests() { warnIfTypeScriptSubmoduleNotCloned(); + + if (!options.dirty) { + await rimraf(localBaseline); + await fs.promises.mkdir(localBaseline, { recursive: true }); + } + await $test`${gotestsum("tests")} ./... ${isCI ? ["--timeout=45m"] : []}`; } @@ -520,10 +527,13 @@ function baselineAcceptTask(localBaseline, refBaseline) { }; } +const localBaseline = "testdata/baselines/local/"; +const refBaseline = "testdata/baselines/reference/"; + export const baselineAccept = task({ name: "baseline-accept", description: "Makes the most recent test results the new baseline, overwriting the old baseline.", - run: baselineAcceptTask("testdata/baselines/local/", "testdata/baselines/reference/"), + run: baselineAcceptTask(localBaseline, refBaseline), }); /** From 58d4391f109239e3cbbe0ef183d7692ca596753f Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Wed, 22 Oct 2025 11:41:05 -0700 Subject: [PATCH 45/69] Unskip passing fourslash test (#1922) --- internal/fourslash/_scripts/failingTests.txt | 1 - .../gen/findAllRefsForDefaultExport03_test.go | 2 +- ...ndAllRefsForDefaultExport03.baseline.jsonc | 141 ++++++++++++++++++ 3 files changed, 142 insertions(+), 2 deletions(-) create mode 100644 testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForDefaultExport03.baseline.jsonc diff --git a/internal/fourslash/_scripts/failingTests.txt b/internal/fourslash/_scripts/failingTests.txt index 1db2b09ce7..09435b6337 100644 --- a/internal/fourslash/_scripts/failingTests.txt +++ b/internal/fourslash/_scripts/failingTests.txt @@ -167,7 +167,6 @@ TestDoubleUnderscoreCompletions TestEditJsdocType TestExportDefaultClass TestExportDefaultFunction -TestFindAllRefsForDefaultExport03 TestFindAllRefsForModule TestFindAllRefsModuleDotExports TestFindReferencesBindingPatternInJsdocNoCrash1 diff --git a/internal/fourslash/tests/gen/findAllRefsForDefaultExport03_test.go b/internal/fourslash/tests/gen/findAllRefsForDefaultExport03_test.go index f41ebfe43a..85578f9b73 100644 --- a/internal/fourslash/tests/gen/findAllRefsForDefaultExport03_test.go +++ b/internal/fourslash/tests/gen/findAllRefsForDefaultExport03_test.go @@ -9,7 +9,7 @@ import ( func TestFindAllRefsForDefaultExport03(t *testing.T) { t.Parallel() - t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `/*1*/function /*2*/f() { return 100; diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForDefaultExport03.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForDefaultExport03.baseline.jsonc new file mode 100644 index 0000000000..137945bf4a --- /dev/null +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllRefsForDefaultExport03.baseline.jsonc @@ -0,0 +1,141 @@ +// === findAllReferences === +// === /findAllRefsForDefaultExport03.ts === +// /*FIND ALL REFS*/function [|f|]() { +// return 100; +// } +// +// export default [|f|]; +// +// var x: typeof [|f|]; +// +// var y = [|f|](); +// +// namespace [|f|] { +// var local = 100; +// } + + + +// === findAllReferences === +// === /findAllRefsForDefaultExport03.ts === +// function /*FIND ALL REFS*/[|f|]() { +// return 100; +// } +// +// export default [|f|]; +// +// var x: typeof [|f|]; +// +// var y = [|f|](); +// +// namespace [|f|] { +// var local = 100; +// } + + + +// === findAllReferences === +// === /findAllRefsForDefaultExport03.ts === +// function [|f|]() { +// return 100; +// } +// +// /*FIND ALL REFS*/export default [|f|]; +// +// var x: typeof [|f|]; +// +// var y = [|f|](); +// +// namespace [|f|] { +// var local = 100; +// } + + + +// === findAllReferences === +// === /findAllRefsForDefaultExport03.ts === +// function [|f|]() { +// return 100; +// } +// +// export default /*FIND ALL REFS*/[|f|]; +// +// var x: typeof [|f|]; +// +// var y = [|f|](); +// +// namespace [|f|] { +// var local = 100; +// } + + + +// === findAllReferences === +// === /findAllRefsForDefaultExport03.ts === +// function [|f|]() { +// return 100; +// } +// +// export default [|f|]; +// +// var x: typeof /*FIND ALL REFS*/[|f|]; +// +// var y = [|f|](); +// +// namespace [|f|] { +// var local = 100; +// } + + + +// === findAllReferences === +// === /findAllRefsForDefaultExport03.ts === +// function [|f|]() { +// return 100; +// } +// +// export default [|f|]; +// +// var x: typeof [|f|]; +// +// var y = /*FIND ALL REFS*/[|f|](); +// +// namespace [|f|] { +// var local = 100; +// } + + + +// === findAllReferences === +// === /findAllRefsForDefaultExport03.ts === +// function [|f|]() { +// return 100; +// } +// +// export default [|f|]; +// +// var x: typeof [|f|]; +// +// var y = [|f|](); +// +// /*FIND ALL REFS*/namespace [|f|] { +// var local = 100; +// } + + + +// === findAllReferences === +// === /findAllRefsForDefaultExport03.ts === +// function [|f|]() { +// return 100; +// } +// +// export default [|f|]; +// +// var x: typeof [|f|]; +// +// var y = [|f|](); +// +// namespace /*FIND ALL REFS*/[|f|] { +// var local = 100; +// } \ No newline at end of file From 087464231ae849d7cd71df9e89e1bff4b40303d1 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Wed, 22 Oct 2025 11:46:43 -0700 Subject: [PATCH 46/69] Support auto-import completion fourslash tests, fix bugs (#1917) --- .../fourslash/_scripts/convertFourslash.mts | 310 +++++++++++++++++- internal/fourslash/_scripts/failingTests.txt | 78 ++++- internal/fourslash/fourslash.go | 236 +++++++++++-- ...portCompletionAmbientMergedModule1_test.go | 78 +++++ ...CompletionExportEqualsWithDefault1_test.go | 104 ++++++ ...tCompletionExportListAugmentation1_test.go | 70 ++++ ...tCompletionExportListAugmentation2_test.go | 80 +++++ ...tCompletionExportListAugmentation3_test.go | 69 ++++ ...tCompletionExportListAugmentation4_test.go | 78 +++++ .../autoImportFileExcludePatterns3_test.go | 71 ++++ .../autoImportPathsAliasesAndBarrels_test.go | 83 +++++ .../tests/gen/autoImportProvider6_test.go | 50 +++ .../gen/autoImportProvider_exportMap1_test.go | 83 +++++ .../gen/autoImportProvider_exportMap2_test.go | 76 +++++ .../gen/autoImportProvider_exportMap3_test.go | 69 ++++ .../gen/autoImportProvider_exportMap4_test.go | 72 ++++ .../gen/autoImportProvider_exportMap5_test.go | 94 ++++++ .../gen/autoImportProvider_exportMap6_test.go | 101 ++++++ .../gen/autoImportProvider_exportMap7_test.go | 85 +++++ .../gen/autoImportProvider_exportMap8_test.go | 103 ++++++ .../gen/autoImportProvider_exportMap9_test.go | 73 +++++ ...oImportProvider_globalTypingsCache_test.go | 57 ++++ ...vider_namespaceSameNameAsIntrinsic_test.go | 57 ++++ ...utoImportProvider_wildcardExports1_test.go | 122 +++++++ ...utoImportProvider_wildcardExports2_test.go | 67 ++++ ...utoImportProvider_wildcardExports3_test.go | 71 ++++ ...utoImportReExportFromAmbientModule_test.go | 76 +++++ .../autoImportSameNameDefaultExported_test.go | 59 ++++ .../autoImportSortCaseSensitivity2_test.go | 56 ++++ .../gen/autoImportTypeOnlyPreferred1_test.go | 63 ++++ .../gen/autoImportVerbatimTypeOnly1_test.go | 52 +++ .../gen/completionForObjectProperty_test.go | 189 +++++++++++ .../completionInNamedImportLocation_test.go | 2 +- ...PropertyShorthandForObjectLiteral5_test.go | 45 +++ ...lassMemberImportTypeNodeParameter1_test.go | 47 +++ ...lassMemberImportTypeNodeParameter2_test.go | 45 +++ ...lassMemberImportTypeNodeParameter3_test.go | 49 +++ ...lassMemberImportTypeNodeParameter4_test.go | 47 +++ .../gen/completionsImportBaseUrl_test.go | 52 +++ ...mpletionsImportDefaultExportCrash2_test.go | 77 +++++ .../gen/completionsImportFromJSXTag_test.go | 45 +++ ...ionsImportModuleAugmentationWithJS_test.go | 47 +++ .../completionsImportPathsConflict_test.go | 68 ++++ .../gen/completionsImportTypeKeyword_test.go | 50 +++ .../completionsImportYieldExpression_test.go | 32 ++ .../tests/gen/completionsImport_46332_test.go | 101 ++++++ .../gen/completionsImport_ambient_test.go | 76 +++++ .../completionsImport_augmentation_test.go | 60 ++++ ...etionsImport_compilerOptionsModule_test.go | 65 ++++ ...ionsImport_defaultAndNamedConflict_test.go | 72 ++++ ...letionsImport_defaultFalsePositive_test.go | 58 ++++ ...nsImport_default_addToNamedImports_test.go | 54 +++ ...mport_default_addToNamespaceImport_test.go | 53 +++ ...t_default_alreadyExistedWithRename_test.go | 54 +++ ...ompletionsImport_default_anonymous_test.go | 69 ++++ ...nsImport_default_didNotExistBefore_test.go | 54 +++ ...rt_default_exportDefaultIdentifier_test.go | 56 ++++ ...ort_default_fromMergedDeclarations_test.go | 60 ++++ ...completionsImport_default_reExport_test.go | 64 ++++ ...mpletionsImport_default_symbolName_test.go | 62 ++++ ...sImport_details_withMisspelledName_test.go | 46 +++ ...atePackages_scopedTypesAndNotTypes_test.go | 74 +++++ ...port_duplicatePackages_scopedTypes_test.go | 74 +++++ ...onsImport_duplicatePackages_scoped_test.go | 74 +++++ ...duplicatePackages_typesAndNotTypes_test.go | 64 ++++ ...ionsImport_duplicatePackages_types_test.go | 74 +++++ ..._exportEqualsNamespace_noDuplicate_test.go | 52 +++ ...tionsImport_exportEquals_anonymous_test.go | 72 ++++ ...pletionsImport_exportEquals_global_test.go | 50 +++ .../completionsImport_exportEquals_test.go | 91 +++++ ...ilteredByInvalidPackageJson_direct_test.go | 73 +++++ ...lteredByPackageJson_@typesImplicit_test.go | 63 ++++ ...t_filteredByPackageJson_@typesOnly_test.go | 63 ++++ ...port_filteredByPackageJson_ambient_test.go | 153 +++++++++ ...mport_filteredByPackageJson_direct_test.go | 65 ++++ ...mport_filteredByPackageJson_nested_test.go | 89 +++++ ...eredByPackageJson_peerDependencies_test.go | 65 ++++ ...ompletionsImport_fromAmbientModule_test.go | 31 ++ .../gen/completionsImport_importType_test.go | 83 +++++ ...sImport_jsxOpeningTagImportDefault_test.go | 61 ++++ .../completionsImport_mergedReExport_test.go | 85 +++++ ...letionsImport_multipleWithSameName_test.go | 79 +++++ ...ionsImport_named_addToNamedImports_test.go | 54 +++ ...ionsImport_named_didNotExistBefore_test.go | 63 ++++ ...named_exportEqualsNamespace_merged_test.go | 53 +++ ...Import_named_exportEqualsNamespace_test.go | 57 ++++ ...mport_named_fromMergedDeclarations_test.go | 60 ++++ ...Import_named_namespaceImportExists_test.go | 53 +++ .../completionsImport_noSemicolons_test.go | 32 ++ ...ionsImport_ofAlias_preferShortPath_test.go | 59 ++++ ...mport_packageJsonImportsPreference_test.go | 77 +++++ ...mport_preferUpdatingExistingImport_test.go | 52 +++ ...onsImport_previousTokenIsSemicolon_test.go | 46 +++ .../gen/completionsImport_quoteStyle_test.go | 30 ++ ...completionsImport_reExportDefault2_test.go | 56 ++++ .../completionsImport_reExportDefault_test.go | 58 ++++ ...mpletionsImport_reExport_wrongName_test.go | 76 +++++ ...ompletionsImport_reexportTransient_test.go | 51 +++ .../completionsImport_require_addNew_test.go | 54 +++ ...etionsImport_require_addToExisting_test.go | 57 ++++ .../gen/completionsImport_require_test.go | 55 ++++ ...ionsImport_sortingModuleSpecifiers_test.go | 74 +++++ .../tests/gen/completionsImport_tsx_test.go | 49 +++ .../gen/completionsImport_typeOnly_test.go | 32 ++ ...mpletionsImport_umdDefaultNoCrash1_test.go | 70 ++++ ...onsImport_umdModules1_globalAccess_test.go | 49 +++ ...nsImport_umdModules2_moduleExports_test.go | 54 +++ ...mpletionsImport_umdModules3_script_test.go | 48 +++ ...onsImport_uriStyleNodeCoreModules1_test.go | 78 +++++ ...onsImport_uriStyleNodeCoreModules2_test.go | 60 ++++ ...etionsImport_weirdDefaultSynthesis_test.go | 34 ++ ...Import_windowsPathsProjectRelative_test.go | 131 ++++++++ .../completionsRecommended_namespace_test.go | 92 ++++++ .../completionsUniqueSymbol_import_test.go | 70 ++++ .../completionsWithDeprecatedTag10_test.go | 45 +++ .../importNameCodeFixDefaultExport6_test.go | 28 ++ .../importNameCodeFixExportAsDefault_test.go | 29 ++ ...rtSuggestionsCache_exportUndefined_test.go | 70 ++++ ...uggestionsCache_invalidPackageJson_test.go | 58 ++++ .../tests/gen/importTypeCompletions1_test.go | 50 +++ .../tests/gen/importTypeCompletions3_test.go | 50 +++ .../tests/gen/importTypeCompletions4_test.go | 51 +++ .../tests/gen/importTypeCompletions5_test.go | 52 +++ .../tests/gen/importTypeCompletions6_test.go | 51 +++ .../tests/gen/importTypeCompletions7_test.go | 56 ++++ .../tests/gen/importTypeCompletions8_test.go | 50 +++ .../tests/gen/importTypeCompletions9_test.go | 50 +++ .../tests/gen/jsFileImportNoTypes2_test.go | 84 +++++ .../gen/jsxTagNameCompletionClosed_test.go | 145 ++++++++ .../gen/jsxTagNameCompletionUnclosed_test.go | 145 ++++++++ ...agNameCompletionUnderElementClosed_test.go | 84 +++++ ...NameCompletionUnderElementUnclosed_test.go | 84 +++++ .../tests/gen/quickInfoOnNarrowedType_test.go | 2 +- internal/ls/autoimportfixes.go | 108 +++--- internal/ls/autoimports.go | 159 ++++++--- internal/ls/autoimportsexportinfo.go | 3 +- internal/ls/changetracker.go | 54 ++- internal/ls/changetrackerimpl.go | 4 +- internal/ls/completions.go | 113 +++---- internal/ls/organizeimports.go | 259 +++++++++++++++ internal/module/resolver.go | 5 +- internal/modulespecifiers/specifiers.go | 8 +- internal/packagejson/cache.go | 1 + internal/packagejson/packagejson.go | 27 ++ internal/stringutil/compare.go | 20 ++ .../autoImportCompletion2.baseline.md | 2 +- .../autoImportCompletion3.baseline.md | 2 +- ...arationErrorNotEmittedForNonEmittedFile.js | 85 +---- ...onErrorNotEmittedForNonEmittedFile.js.diff | 87 +---- ...arationsIndirectGeneratedAliasReference.js | 28 +- ...onsIndirectGeneratedAliasReference.js.diff | 32 -- .../nodeModuleReexportFromDottedPath.js | 29 +- .../nodeModuleReexportFromDottedPath.js.diff | 34 -- 153 files changed, 9715 insertions(+), 490 deletions(-) create mode 100644 internal/fourslash/tests/gen/autoImportCompletionAmbientMergedModule1_test.go create mode 100644 internal/fourslash/tests/gen/autoImportCompletionExportEqualsWithDefault1_test.go create mode 100644 internal/fourslash/tests/gen/autoImportCompletionExportListAugmentation1_test.go create mode 100644 internal/fourslash/tests/gen/autoImportCompletionExportListAugmentation2_test.go create mode 100644 internal/fourslash/tests/gen/autoImportCompletionExportListAugmentation3_test.go create mode 100644 internal/fourslash/tests/gen/autoImportCompletionExportListAugmentation4_test.go create mode 100644 internal/fourslash/tests/gen/autoImportFileExcludePatterns3_test.go create mode 100644 internal/fourslash/tests/gen/autoImportPathsAliasesAndBarrels_test.go create mode 100644 internal/fourslash/tests/gen/autoImportProvider6_test.go create mode 100644 internal/fourslash/tests/gen/autoImportProvider_exportMap1_test.go create mode 100644 internal/fourslash/tests/gen/autoImportProvider_exportMap2_test.go create mode 100644 internal/fourslash/tests/gen/autoImportProvider_exportMap3_test.go create mode 100644 internal/fourslash/tests/gen/autoImportProvider_exportMap4_test.go create mode 100644 internal/fourslash/tests/gen/autoImportProvider_exportMap5_test.go create mode 100644 internal/fourslash/tests/gen/autoImportProvider_exportMap6_test.go create mode 100644 internal/fourslash/tests/gen/autoImportProvider_exportMap7_test.go create mode 100644 internal/fourslash/tests/gen/autoImportProvider_exportMap8_test.go create mode 100644 internal/fourslash/tests/gen/autoImportProvider_exportMap9_test.go create mode 100644 internal/fourslash/tests/gen/autoImportProvider_globalTypingsCache_test.go create mode 100644 internal/fourslash/tests/gen/autoImportProvider_namespaceSameNameAsIntrinsic_test.go create mode 100644 internal/fourslash/tests/gen/autoImportProvider_wildcardExports1_test.go create mode 100644 internal/fourslash/tests/gen/autoImportProvider_wildcardExports2_test.go create mode 100644 internal/fourslash/tests/gen/autoImportProvider_wildcardExports3_test.go create mode 100644 internal/fourslash/tests/gen/autoImportReExportFromAmbientModule_test.go create mode 100644 internal/fourslash/tests/gen/autoImportSameNameDefaultExported_test.go create mode 100644 internal/fourslash/tests/gen/autoImportSortCaseSensitivity2_test.go create mode 100644 internal/fourslash/tests/gen/autoImportTypeOnlyPreferred1_test.go create mode 100644 internal/fourslash/tests/gen/autoImportVerbatimTypeOnly1_test.go create mode 100644 internal/fourslash/tests/gen/completionForObjectProperty_test.go create mode 100644 internal/fourslash/tests/gen/completionPropertyShorthandForObjectLiteral5_test.go create mode 100644 internal/fourslash/tests/gen/completionsClassMemberImportTypeNodeParameter1_test.go create mode 100644 internal/fourslash/tests/gen/completionsClassMemberImportTypeNodeParameter2_test.go create mode 100644 internal/fourslash/tests/gen/completionsClassMemberImportTypeNodeParameter3_test.go create mode 100644 internal/fourslash/tests/gen/completionsClassMemberImportTypeNodeParameter4_test.go create mode 100644 internal/fourslash/tests/gen/completionsImportBaseUrl_test.go create mode 100644 internal/fourslash/tests/gen/completionsImportDefaultExportCrash2_test.go create mode 100644 internal/fourslash/tests/gen/completionsImportFromJSXTag_test.go create mode 100644 internal/fourslash/tests/gen/completionsImportModuleAugmentationWithJS_test.go create mode 100644 internal/fourslash/tests/gen/completionsImportPathsConflict_test.go create mode 100644 internal/fourslash/tests/gen/completionsImportTypeKeyword_test.go create mode 100644 internal/fourslash/tests/gen/completionsImportYieldExpression_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_46332_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_ambient_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_augmentation_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_compilerOptionsModule_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_defaultAndNamedConflict_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_defaultFalsePositive_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_default_addToNamedImports_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_default_addToNamespaceImport_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_default_alreadyExistedWithRename_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_default_anonymous_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_default_didNotExistBefore_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_default_exportDefaultIdentifier_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_default_fromMergedDeclarations_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_default_reExport_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_default_symbolName_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_details_withMisspelledName_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_duplicatePackages_scopedTypesAndNotTypes_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_duplicatePackages_scopedTypes_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_duplicatePackages_scoped_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_duplicatePackages_typesAndNotTypes_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_duplicatePackages_types_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_exportEqualsNamespace_noDuplicate_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_exportEquals_anonymous_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_exportEquals_global_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_exportEquals_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_filteredByInvalidPackageJson_direct_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_@typesImplicit_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_@typesOnly_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_ambient_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_direct_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_nested_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_peerDependencies_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_fromAmbientModule_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_importType_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_jsxOpeningTagImportDefault_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_mergedReExport_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_multipleWithSameName_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_named_addToNamedImports_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_named_didNotExistBefore_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_named_exportEqualsNamespace_merged_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_named_exportEqualsNamespace_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_named_fromMergedDeclarations_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_named_namespaceImportExists_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_noSemicolons_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_ofAlias_preferShortPath_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_packageJsonImportsPreference_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_preferUpdatingExistingImport_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_previousTokenIsSemicolon_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_quoteStyle_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_reExportDefault2_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_reExportDefault_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_reExport_wrongName_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_reexportTransient_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_require_addNew_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_require_addToExisting_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_require_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_sortingModuleSpecifiers_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_tsx_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_typeOnly_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_umdDefaultNoCrash1_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_umdModules1_globalAccess_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_umdModules2_moduleExports_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_umdModules3_script_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_uriStyleNodeCoreModules1_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_uriStyleNodeCoreModules2_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_weirdDefaultSynthesis_test.go create mode 100644 internal/fourslash/tests/gen/completionsImport_windowsPathsProjectRelative_test.go create mode 100644 internal/fourslash/tests/gen/completionsRecommended_namespace_test.go create mode 100644 internal/fourslash/tests/gen/completionsUniqueSymbol_import_test.go create mode 100644 internal/fourslash/tests/gen/completionsWithDeprecatedTag10_test.go create mode 100644 internal/fourslash/tests/gen/importNameCodeFixDefaultExport6_test.go create mode 100644 internal/fourslash/tests/gen/importNameCodeFixExportAsDefault_test.go create mode 100644 internal/fourslash/tests/gen/importSuggestionsCache_exportUndefined_test.go create mode 100644 internal/fourslash/tests/gen/importSuggestionsCache_invalidPackageJson_test.go create mode 100644 internal/fourslash/tests/gen/importTypeCompletions1_test.go create mode 100644 internal/fourslash/tests/gen/importTypeCompletions3_test.go create mode 100644 internal/fourslash/tests/gen/importTypeCompletions4_test.go create mode 100644 internal/fourslash/tests/gen/importTypeCompletions5_test.go create mode 100644 internal/fourslash/tests/gen/importTypeCompletions6_test.go create mode 100644 internal/fourslash/tests/gen/importTypeCompletions7_test.go create mode 100644 internal/fourslash/tests/gen/importTypeCompletions8_test.go create mode 100644 internal/fourslash/tests/gen/importTypeCompletions9_test.go create mode 100644 internal/fourslash/tests/gen/jsFileImportNoTypes2_test.go create mode 100644 internal/fourslash/tests/gen/jsxTagNameCompletionClosed_test.go create mode 100644 internal/fourslash/tests/gen/jsxTagNameCompletionUnclosed_test.go create mode 100644 internal/fourslash/tests/gen/jsxTagNameCompletionUnderElementClosed_test.go create mode 100644 internal/fourslash/tests/gen/jsxTagNameCompletionUnderElementUnclosed_test.go diff --git a/internal/fourslash/_scripts/convertFourslash.mts b/internal/fourslash/_scripts/convertFourslash.mts index 534b7d69c7..72a6d879a6 100644 --- a/internal/fourslash/_scripts/convertFourslash.mts +++ b/internal/fourslash/_scripts/convertFourslash.mts @@ -151,14 +151,17 @@ function parseFourslashStatement(statement: ts.Statement): Cmd[] | undefined { } const namespace = callExpression.expression.expression; const func = callExpression.expression.name; - if (!(ts.isIdentifier(namespace) || namespace.getText() === "verify.not") || !ts.isIdentifier(func)) { - console.error(`Expected identifiers for namespace and function, got ${namespace.getText()} and ${func.getText()}`); - return undefined; - } if (!ts.isIdentifier(namespace)) { switch (func.text) { case "quickInfoExists": return parseQuickInfoArgs("notQuickInfoExists", callExpression.arguments); + case "andApplyCodeAction": + // verify.completions({ ... }).andApplyCodeAction(...) + if (!(ts.isCallExpression(namespace) && namespace.expression.getText() === "verify.completions")) { + console.error(`Unrecognized fourslash statement: ${statement.getText()}`); + return undefined; + } + return parseVerifyCompletionsArgs(namespace.arguments, callExpression.arguments); } console.error(`Unrecognized fourslash statement: ${statement.getText()}`); return undefined; @@ -169,6 +172,9 @@ function parseFourslashStatement(statement: ts.Statement): Cmd[] | undefined { case "completions": // `verify.completions(...)` return parseVerifyCompletionsArgs(callExpression.arguments); + case "applyCodeActionFromCompletion": + // `verify.applyCodeActionFromCompletion(...)` + return parseVerifyApplyCodeActionFromCompletionArgs(callExpression.arguments); case "quickInfoAt": case "quickInfoExists": case "quickInfoIs": @@ -271,6 +277,13 @@ function parseEditStatement(funcName: string, args: readonly ts.Expression[]): E } } +function getGoMultiLineStringLiteral(text: string): string { + if (!text.includes("`") && !text.includes("\\")) { + return "`" + text + "`"; + } + return getGoStringLiteral(text); +} + function getGoStringLiteral(text: string): string { return `${JSON.stringify(text)}`; } @@ -362,18 +375,170 @@ function parseGoToArgs(args: readonly ts.Expression[], funcName: string): GoToCm } } -function parseVerifyCompletionsArgs(args: readonly ts.Expression[]): VerifyCompletionsCmd[] | undefined { +function parseVerifyCompletionsArgs(args: readonly ts.Expression[], codeActionArgs?: readonly ts.Expression[]): VerifyCompletionsCmd[] | undefined { const cmds = []; + const codeAction = codeActionArgs?.[0] && parseAndApplyCodeActionArg(codeActionArgs[0]); for (const arg of args) { - const result = parseVerifyCompletionArg(arg); + const result = parseVerifyCompletionArg(arg, codeAction); if (!result) { return undefined; } + if (codeActionArgs?.length) { + result.andApplyCodeActionArgs = parseAndApplyCodeActionArg(codeActionArgs[0]); + } cmds.push(result); } return cmds; } +function parseVerifyApplyCodeActionFromCompletionArgs(args: readonly ts.Expression[]): VerifyApplyCodeActionFromCompletionCmd[] | undefined { + const cmds: VerifyApplyCodeActionFromCompletionCmd[] = []; + if (args.length !== 2) { + console.error(`Expected two arguments in verify.applyCodeActionFromCompletion, got ${args.map(arg => arg.getText()).join(", ")}`); + return undefined; + } + if (!ts.isStringLiteralLike(args[0]) && args[0].getText() !== "undefined") { + console.error(`Expected string literal or "undefined" in verify.applyCodeActionFromCompletion, got ${args[0].getText()}`); + return undefined; + } + const markerName = getStringLiteralLike(args[0])?.text; + const marker = markerName === undefined ? "nil" : `PtrTo(${getGoStringLiteral(markerName)})`; + const options = parseVerifyApplyCodeActionArgs(args[1]); + if (options === undefined) { + return undefined; + } + + cmds.push({ kind: "verifyApplyCodeActionFromCompletion", marker, options }); + return cmds; +} + +function parseVerifyApplyCodeActionArgs(arg: ts.Expression): string | undefined { + const obj = getObjectLiteralExpression(arg); + if (!obj) { + console.error(`Expected object literal for verify.applyCodeActionFromCompletion options, got ${arg.getText()}`); + return undefined; + } + let nameInit, sourceInit, descInit, dataInit; + const props: string[] = []; + for (const prop of obj.properties) { + if (!ts.isPropertyAssignment(prop) || !ts.isIdentifier(prop.name)) { + if (ts.isShorthandPropertyAssignment(prop) && prop.name.text === "preferences") { + continue; // !!! parse once preferences are supported in fourslash + } + console.error(`Expected property assignment with identifier name in verify.applyCodeActionFromCompletion options, got ${prop.getText()}`); + return undefined; + } + const propName = prop.name.text; + const init = prop.initializer; + switch (propName) { + case "name": + nameInit = getStringLiteralLike(init); + if (!nameInit) { + console.error(`Expected string literal for name in verify.applyCodeActionFromCompletion options, got ${init.getText()}`); + return undefined; + } + props.push(`Name: ${getGoStringLiteral(nameInit.text)},`); + break; + case "source": + sourceInit = getStringLiteralLike(init); + if (!sourceInit) { + console.error(`Expected string literal for source in verify.applyCodeActionFromCompletion options, got ${init.getText()}`); + return undefined; + } + props.push(`Source: ${getGoStringLiteral(sourceInit.text)},`); + break; + case "data": + dataInit = getObjectLiteralExpression(init); + if (!dataInit) { + console.error(`Expected object literal for data in verify.applyCodeActionFromCompletion options, got ${init.getText()}`); + return undefined; + } + const dataProps: string[] = []; + for (const dataProp of dataInit.properties) { + if (!ts.isPropertyAssignment(dataProp) || !ts.isIdentifier(dataProp.name)) { + console.error(`Expected property assignment with identifier name in verify.applyCodeActionFromCompletion data, got ${dataProp.getText()}`); + return undefined; + } + const dataPropName = dataProp.name.text; + switch (dataPropName) { + case "moduleSpecifier": + const moduleSpecifierInit = getStringLiteralLike(dataProp.initializer); + if (!moduleSpecifierInit) { + console.error(`Expected string literal for moduleSpecifier in verify.applyCodeActionFromCompletion data, got ${dataProp.initializer.getText()}`); + return undefined; + } + dataProps.push(`ModuleSpecifier: ${getGoStringLiteral(moduleSpecifierInit.text)},`); + break; + case "exportName": + const exportNameInit = getStringLiteralLike(dataProp.initializer); + if (!exportNameInit) { + console.error(`Expected string literal for exportName in verify.applyCodeActionFromCompletion data, got ${dataProp.initializer.getText()}`); + return undefined; + } + dataProps.push(`ExportName: ${getGoStringLiteral(exportNameInit.text)},`); + break; + case "fileName": + const fileNameInit = getStringLiteralLike(dataProp.initializer); + if (!fileNameInit) { + console.error(`Expected string literal for fileName in verify.applyCodeActionFromCompletion data, got ${dataProp.initializer.getText()}`); + return undefined; + } + dataProps.push(`FileName: ${getGoStringLiteral(fileNameInit.text)},`); + break; + default: + console.error(`Unrecognized property in verify.applyCodeActionFromCompletion data: ${dataProp.getText()}`); + return undefined; + } + } + props.push(`AutoImportData: &ls.AutoImportData{\n${dataProps.join("\n")}\n},`); + break; + case "description": + descInit = getStringLiteralLike(init); + if (!descInit) { + console.error(`Expected string literal for description in verify.applyCodeActionFromCompletion options, got ${init.getText()}`); + return undefined; + } + props.push(`Description: ${getGoStringLiteral(descInit.text)},`); + break; + case "newFileContent": + const newFileContentInit = getStringLiteralLike(init); + if (!newFileContentInit) { + console.error(`Expected string literal for newFileContent in verify.applyCodeActionFromCompletion options, got ${init.getText()}`); + return undefined; + } + props.push(`NewFileContent: PtrTo(${getGoMultiLineStringLiteral(newFileContentInit.text)}),`); + break; + case "newRangeContent": + const newRangeContentInit = getStringLiteralLike(init); + if (!newRangeContentInit) { + console.error(`Expected string literal for newRangeContent in verify.applyCodeActionFromCompletion options, got ${init.getText()}`); + return undefined; + } + props.push(`NewRangeContent: PtrTo(${getGoMultiLineStringLiteral(newRangeContentInit.text)}),`); + break; + case "preferences": + // Few if any tests use non-default preferences + break; + default: + console.error(`Unrecognized property in verify.applyCodeActionFromCompletion options: ${prop.getText()}`); + return undefined; + } + } + if (!nameInit) { + console.error(`Expected name property in verify.applyCodeActionFromCompletion options`); + return undefined; + } + if (!sourceInit && !dataInit) { + console.error(`Expected source property in verify.applyCodeActionFromCompletion options`); + return undefined; + } + if (!descInit) { + console.error(`Expected description property in verify.applyCodeActionFromCompletion options`); + return undefined; + } + return `&fourslash.ApplyCodeActionFromCompletionOptions{\n${props.join("\n")}\n}`; +} + const completionConstants = new Map([ ["completion.globals", "CompletionGlobals"], ["completion.globalTypes", "CompletionGlobalTypes"], @@ -397,7 +562,7 @@ const completionPlus = new Map([ ["completion.typeKeywordsPlus", "CompletionTypeKeywordsPlus"], ]); -function parseVerifyCompletionArg(arg: ts.Expression): VerifyCompletionsCmd | undefined { +function parseVerifyCompletionArg(arg: ts.Expression, codeActionArgs?: VerifyApplyCodeActionArgs): VerifyCompletionsCmd | undefined { let marker: string | undefined; let goArgs: VerifyCompletionsArgs | undefined; const obj = getObjectLiteralExpression(arg); @@ -408,6 +573,9 @@ function parseVerifyCompletionArg(arg: ts.Expression): VerifyCompletionsCmd | un let isNewIdentifierLocation: true | undefined; for (const prop of obj.properties) { if (!ts.isPropertyAssignment(prop) || !ts.isIdentifier(prop.name)) { + if (ts.isShorthandPropertyAssignment(prop) && prop.name.text === "preferences") { + continue; // !!! parse once preferences are supported in fourslash + } console.error(`Expected property assignment with identifier name, got ${prop.getText()}`); return undefined; } @@ -478,7 +646,7 @@ function parseVerifyCompletionArg(arg: ts.Expression): VerifyCompletionsCmd | un } expected = `${funcName}(\n[]fourslash.CompletionsExpectedItem{`; for (const elem of items.elements) { - const result = parseExpectedCompletionItem(elem); + const result = parseExpectedCompletionItem(elem, codeActionArgs); if (!result) { return undefined; } @@ -589,7 +757,7 @@ function parseVerifyCompletionArg(arg: ts.Expression): VerifyCompletionsCmd | un }; } -function parseExpectedCompletionItem(expr: ts.Expression): string | undefined { +function parseExpectedCompletionItem(expr: ts.Expression, codeActionArgs?: VerifyApplyCodeActionArgs): string | undefined { if (completionConstants.has(expr.getText())) { return completionConstants.get(expr.getText())!; } @@ -600,6 +768,7 @@ function parseExpectedCompletionItem(expr: ts.Expression): string | undefined { if (strExpr = getObjectLiteralExpression(expr)) { let isDeprecated = false; // !!! let isOptional = false; + let sourceInit: ts.StringLiteralLike | undefined; let extensions: string[] = []; // !!! let itemProps: string[] = []; let name: string | undefined; @@ -708,6 +877,33 @@ function parseExpectedCompletionItem(expr: ts.Expression): string | undefined { } case "isFromUncheckedFile": break; // Ignored + case "hasAction": + itemProps.push("AdditionalTextEdits: fourslash.AnyTextEdits,"); + break; + case "source": + case "sourceDisplay": + if (sourceInit !== undefined) { + break; + } + if (sourceInit = getStringLiteralLike(init)) { + if (propName === "source" && sourceInit.text.endsWith("/")) { + // source: "ClassMemberSnippet/" + itemProps.push(`Data: PtrTo(any(&ls.CompletionItemData{ + Source: ${getGoStringLiteral(sourceInit.text)}, + })),`); + break; + } + itemProps.push(`Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: ${getGoStringLiteral(sourceInit.text)}, + }, + })),`); + } + else { + console.error(`Expected string literal for source/sourceDisplay, got ${init.getText()}`); + return undefined; + } + break; case "commitCharacters": // !!! support these later break; @@ -732,6 +928,11 @@ function parseExpectedCompletionItem(expr: ts.Expression): string | undefined { if (!name) { return undefined; // Shouldn't happen } + if (codeActionArgs && codeActionArgs.name === name && codeActionArgs.source === sourceInit?.text) { + itemProps.push(`LabelDetails: &lsproto.CompletionItemLabelDetails{ + Description: PtrTo(${getGoStringLiteral(codeActionArgs.source)}), + },`); + } if (replacementSpanIdx) { itemProps.push(`TextEdit: &lsproto.TextEditOrInsertReplaceEdit{ TextEdit: &lsproto.TextEdit{ @@ -754,6 +955,60 @@ function parseExpectedCompletionItem(expr: ts.Expression): string | undefined { return undefined; // Unsupported expression type } +function parseAndApplyCodeActionArg(arg: ts.Expression): VerifyApplyCodeActionArgs | undefined { + const obj = getObjectLiteralExpression(arg); + if (!obj) { + console.error(`Expected object literal for code action argument, got ${arg.getText()}`); + return undefined; + } + const nameProperty = obj.properties.find(prop => + ts.isPropertyAssignment(prop) && + ts.isIdentifier(prop.name) && + prop.name.text === "name" && + ts.isStringLiteralLike(prop.initializer) + ) as ts.PropertyAssignment | undefined; + if (!nameProperty) { + console.error(`Expected name property in code action argument, got ${obj.getText()}`); + return undefined; + } + const sourceProperty = obj.properties.find(prop => + ts.isPropertyAssignment(prop) && + ts.isIdentifier(prop.name) && + prop.name.text === "source" && + ts.isStringLiteralLike(prop.initializer) + ) as ts.PropertyAssignment | undefined; + if (!sourceProperty) { + console.error(`Expected source property in code action argument, got ${obj.getText()}`); + return undefined; + } + const descriptionProperty = obj.properties.find(prop => + ts.isPropertyAssignment(prop) && + ts.isIdentifier(prop.name) && + prop.name.text === "description" && + ts.isStringLiteralLike(prop.initializer) + ) as ts.PropertyAssignment | undefined; + if (!descriptionProperty) { + console.error(`Expected description property in code action argument, got ${obj.getText()}`); + return undefined; + } + const newFileContentProperty = obj.properties.find(prop => + ts.isPropertyAssignment(prop) && + ts.isIdentifier(prop.name) && + prop.name.text === "newFileContent" && + ts.isStringLiteralLike(prop.initializer) + ) as ts.PropertyAssignment | undefined; + if (!newFileContentProperty) { + console.error(`Expected newFileContent property in code action argument, got ${obj.getText()}`); + return undefined; + } + return { + name: (nameProperty.initializer as ts.StringLiteralLike).text, + source: (sourceProperty.initializer as ts.StringLiteralLike).text, + description: (descriptionProperty.initializer as ts.StringLiteralLike).text, + newFileContent: (newFileContentProperty.initializer as ts.StringLiteralLike).text, + }; +} + function parseBaselineFindAllReferencesArgs(args: readonly ts.Expression[]): [VerifyBaselineFindAllReferencesCmd] | undefined { const newArgs = []; for (const arg of args) { @@ -1287,6 +1542,7 @@ interface VerifyCompletionsCmd { marker: string; isNewIdentifierLocation?: true; args?: VerifyCompletionsArgs | "nil"; + andApplyCodeActionArgs?: VerifyApplyCodeActionArgs; } interface VerifyCompletionsArgs { @@ -1296,6 +1552,19 @@ interface VerifyCompletionsArgs { unsorted?: string; } +interface VerifyApplyCodeActionArgs { + name: string; + source: string; + description: string; + newFileContent: string; +} + +interface VerifyApplyCodeActionFromCompletionCmd { + kind: "verifyApplyCodeActionFromCompletion"; + marker: string; + options: string; +} + interface VerifyBaselineFindAllReferencesCmd { kind: "verifyBaselineFindAllReferences"; markers: string[]; @@ -1360,6 +1629,7 @@ interface VerifyRenameInfoCmd { type Cmd = | VerifyCompletionsCmd + | VerifyApplyCodeActionFromCompletionCmd | VerifyBaselineFindAllReferencesCmd | VerifyBaselineDocumentHighlightsCmd | VerifyBaselineGoToDefinitionCmd @@ -1371,7 +1641,7 @@ type Cmd = | VerifyBaselineRenameCmd | VerifyRenameInfoCmd; -function generateVerifyCompletions({ marker, args, isNewIdentifierLocation }: VerifyCompletionsCmd): string { +function generateVerifyCompletions({ marker, args, isNewIdentifierLocation, andApplyCodeActionArgs }: VerifyCompletionsCmd): string { let expectedList: string; if (args === "nil") { expectedList = "nil"; @@ -1395,7 +1665,21 @@ function generateVerifyCompletions({ marker, args, isNewIdentifierLocation }: Ve }, }`; } - return `f.VerifyCompletions(t, ${marker}, ${expectedList})`; + + const call = `f.VerifyCompletions(t, ${marker}, ${expectedList})`; + if (andApplyCodeActionArgs) { + return `${call}.AndApplyCodeAction(t, &fourslash.CompletionsExpectedCodeAction{ + Name: ${getGoStringLiteral(andApplyCodeActionArgs.name)}, + Source: ${getGoStringLiteral(andApplyCodeActionArgs.source)}, + Description: ${getGoStringLiteral(andApplyCodeActionArgs.description)}, + NewFileContent: ${getGoMultiLineStringLiteral(andApplyCodeActionArgs.newFileContent)}, + })`; + } + return call; +} + +function generateVerifyApplyCodeActionFromCompletion({ marker, options }: VerifyApplyCodeActionFromCompletionCmd): string { + return `f.VerifyApplyCodeActionFromCompletion(t, ${marker}, ${options})`; } function generateBaselineFindAllReferences({ markers, ranges }: VerifyBaselineFindAllReferencesCmd): string { @@ -1456,6 +1740,8 @@ function generateCmd(cmd: Cmd): string { switch (cmd.kind) { case "verifyCompletions": return generateVerifyCompletions(cmd); + case "verifyApplyCodeActionFromCompletion": + return generateVerifyApplyCodeActionFromCompletion(cmd); case "verifyBaselineFindAllReferences": return generateBaselineFindAllReferences(cmd); case "verifyBaselineDocumentHighlights": @@ -1497,7 +1783,7 @@ interface GoTest { } function generateGoTest(failingTests: Set, test: GoTest): string { - const testName = (test.name[0].toUpperCase() + test.name.substring(1)).replaceAll("-", "_"); + const testName = (test.name[0].toUpperCase() + test.name.substring(1)).replaceAll("-", "_").replaceAll(/[^a-zA-Z0-9_]/g, ""); const content = test.content; const commands = test.commands.map(cmd => generateCmd(cmd)).join("\n"); const imports = [`"github.com/microsoft/typescript-go/internal/fourslash"`]; diff --git a/internal/fourslash/_scripts/failingTests.txt b/internal/fourslash/_scripts/failingTests.txt index 09435b6337..3596e01173 100644 --- a/internal/fourslash/_scripts/failingTests.txt +++ b/internal/fourslash/_scripts/failingTests.txt @@ -3,6 +3,29 @@ TestAmbientShorthandGotoDefinition TestArgumentsAreAvailableAfterEditsAtEndOfFunction TestAugmentedTypesClass1 TestAugmentedTypesClass3Fourslash +TestAutoImportCompletionAmbientMergedModule1 +TestAutoImportCompletionExportEqualsWithDefault1 +TestAutoImportCompletionExportListAugmentation1 +TestAutoImportCompletionExportListAugmentation2 +TestAutoImportCompletionExportListAugmentation3 +TestAutoImportCompletionExportListAugmentation4 +TestAutoImportFileExcludePatterns3 +TestAutoImportPathsAliasesAndBarrels +TestAutoImportProvider_exportMap1 +TestAutoImportProvider_exportMap2 +TestAutoImportProvider_exportMap3 +TestAutoImportProvider_exportMap4 +TestAutoImportProvider_exportMap5 +TestAutoImportProvider_exportMap6 +TestAutoImportProvider_exportMap7 +TestAutoImportProvider_exportMap8 +TestAutoImportProvider_exportMap9 +TestAutoImportProvider_globalTypingsCache +TestAutoImportProvider_namespaceSameNameAsIntrinsic +TestAutoImportProvider_wildcardExports1 +TestAutoImportProvider_wildcardExports2 +TestAutoImportProvider_wildcardExports3 +TestAutoImportVerbatimTypeOnly1 TestBestCommonTypeObjectLiterals TestBestCommonTypeObjectLiterals1 TestCodeCompletionEscaping @@ -20,6 +43,7 @@ TestCompletionEntryForUnionProperty TestCompletionEntryForUnionProperty2 TestCompletionForComputedStringProperties TestCompletionForMetaProperty +TestCompletionForObjectProperty TestCompletionForStringLiteral TestCompletionForStringLiteral4 TestCompletionForStringLiteralExport @@ -65,7 +89,6 @@ TestCompletionImportModuleSpecifierEndingUnsupportedExtension TestCompletionInChecks1 TestCompletionInFunctionLikeBody_includesPrimitiveTypes TestCompletionInJsDoc -TestCompletionInNamedImportLocation TestCompletionInUncheckedJSFile TestCompletionListBuilderLocations_VariableDeclarations TestCompletionListForDerivedType1 @@ -115,13 +138,51 @@ TestCompletionOfAwaitPromise6 TestCompletionOfAwaitPromise7 TestCompletionOfInterfaceAndVar TestCompletionPreferredSuggestions1 +TestCompletionPropertyShorthandForObjectLiteral5 TestCompletionWithConditionalOperatorMissingColon TestCompletionsAfterJSDoc TestCompletionsBeforeRestArg1 +TestCompletionsClassMemberImportTypeNodeParameter1 +TestCompletionsClassMemberImportTypeNodeParameter2 +TestCompletionsClassMemberImportTypeNodeParameter3 +TestCompletionsClassMemberImportTypeNodeParameter4 TestCompletionsElementAccessNumeric TestCompletionsExportImport TestCompletionsGenericTypeWithMultipleBases1 +TestCompletionsImportBaseUrl TestCompletionsImportOrExportSpecifier +TestCompletionsImport_default_alreadyExistedWithRename +TestCompletionsImport_default_anonymous +TestCompletionsImport_default_didNotExistBefore +TestCompletionsImport_default_exportDefaultIdentifier +TestCompletionsImport_details_withMisspelledName +TestCompletionsImport_exportEquals_anonymous +TestCompletionsImport_exportEquals_global +TestCompletionsImport_filteredByInvalidPackageJson_direct +TestCompletionsImport_filteredByPackageJson_direct +TestCompletionsImport_filteredByPackageJson_nested +TestCompletionsImport_filteredByPackageJson_peerDependencies +TestCompletionsImport_filteredByPackageJson_typesImplicit +TestCompletionsImport_filteredByPackageJson_typesOnly +TestCompletionsImport_importType +TestCompletionsImport_jsxOpeningTagImportDefault +TestCompletionsImport_mergedReExport +TestCompletionsImport_multipleWithSameName +TestCompletionsImport_named_didNotExistBefore +TestCompletionsImport_named_exportEqualsNamespace +TestCompletionsImport_named_namespaceImportExists +TestCompletionsImport_noSemicolons +TestCompletionsImport_ofAlias_preferShortPath +TestCompletionsImport_packageJsonImportsPreference +TestCompletionsImport_quoteStyle +TestCompletionsImport_reExportDefault +TestCompletionsImport_reExportDefault2 +TestCompletionsImport_reExport_wrongName +TestCompletionsImport_require_addToExisting +TestCompletionsImport_typeOnly +TestCompletionsImport_umdDefaultNoCrash1 +TestCompletionsImport_uriStyleNodeCoreModules2 +TestCompletionsImport_windowsPathsProjectRelative TestCompletionsInExport TestCompletionsInExport_moduleBlock TestCompletionsInRequire @@ -153,6 +214,7 @@ TestCompletionsPaths_kinds TestCompletionsPaths_pathMapping TestCompletionsPaths_pathMapping_nonTrailingWildcard1 TestCompletionsPaths_pathMapping_parentDirectory +TestCompletionsRecommended_namespace TestCompletionsRecommended_union TestCompletionsRedeclareModuleAsGlobal TestCompletionsStringsWithTriggerCharacter @@ -160,6 +222,8 @@ TestCompletionsSymbolMembers TestCompletionsTriggerCharacter TestCompletionsTuple TestCompletionsUniqueSymbol1 +TestCompletionsUniqueSymbol_import +TestCompletionsWithDeprecatedTag10 TestConstEnumQuickInfoAndCompletionList TestConstQuickInfoAndCompletionList TestContextuallyTypedFunctionExpressionGeneric1 @@ -215,6 +279,16 @@ TestImportCompletions_importsMap2 TestImportCompletions_importsMap3 TestImportCompletions_importsMap4 TestImportCompletions_importsMap5 +TestImportNameCodeFixExportAsDefault +TestImportSuggestionsCache_exportUndefined +TestImportTypeCompletions1 +TestImportTypeCompletions3 +TestImportTypeCompletions4 +TestImportTypeCompletions5 +TestImportTypeCompletions6 +TestImportTypeCompletions7 +TestImportTypeCompletions8 +TestImportTypeCompletions9 TestIndexerReturnTypes1 TestIndirectClassInstantiation TestInstanceTypesForGenericType1 @@ -245,6 +319,7 @@ TestJsDocPropertyDescription8 TestJsDocPropertyDescription9 TestJsDocServices TestJsDocTagsWithHyphen +TestJsFileImportNoTypes2 TestJsQuickInfoGenerallyAcceptableSize TestJsRequireQuickInfo TestJsdocCallbackTag @@ -386,7 +461,6 @@ TestQuickInfoOnGenericWithConstraints1 TestQuickInfoOnInternalAliases TestQuickInfoOnJsxNamespacedNameWithDoc1 TestQuickInfoOnMethodOfImportEquals -TestQuickInfoOnNarrowedType TestQuickInfoOnNarrowedTypeInModule TestQuickInfoOnNewKeyword01 TestQuickInfoOnObjectLiteralWithAccessors diff --git a/internal/fourslash/fourslash.go b/internal/fourslash/fourslash.go index ddac550413..00f39aac1e 100644 --- a/internal/fourslash/fourslash.go +++ b/internal/fourslash/fourslash.go @@ -503,19 +503,31 @@ type CompletionsExpectedItems struct { Unsorted []CompletionsExpectedItem } +type CompletionsExpectedCodeAction struct { + Name string + Source string + Description string + NewFileContent string +} + +type VerifyCompletionsResult struct { + AndApplyCodeAction func(t *testing.T, expectedAction *CompletionsExpectedCodeAction) +} + // string | *Marker | []string | []*Marker type MarkerInput = any // !!! user preferences param // !!! completion context param -func (f *FourslashTest) VerifyCompletions(t *testing.T, markerInput MarkerInput, expected *CompletionsExpectedList) { +func (f *FourslashTest) VerifyCompletions(t *testing.T, markerInput MarkerInput, expected *CompletionsExpectedList) VerifyCompletionsResult { + var list *lsproto.CompletionList switch marker := markerInput.(type) { case string: f.GoToMarker(t, marker) - f.verifyCompletionsWorker(t, expected) + list = f.verifyCompletionsWorker(t, expected) case *Marker: f.goToMarker(t, marker) - f.verifyCompletionsWorker(t, expected) + list = f.verifyCompletionsWorker(t, expected) case []string: for _, markerName := range marker { f.GoToMarker(t, markerName) @@ -527,13 +539,41 @@ func (f *FourslashTest) VerifyCompletions(t *testing.T, markerInput MarkerInput, f.verifyCompletionsWorker(t, expected) } case nil: - f.verifyCompletionsWorker(t, expected) + list = f.verifyCompletionsWorker(t, expected) default: t.Fatalf("Invalid marker input type: %T. Expected string, *Marker, []string, or []*Marker.", markerInput) } + + return VerifyCompletionsResult{ + AndApplyCodeAction: func(t *testing.T, expectedAction *CompletionsExpectedCodeAction) { + item := core.Find(list.Items, func(item *lsproto.CompletionItem) bool { + if item.Label != expectedAction.Name || item.Data == nil { + return false + } + data, ok := (*item.Data).(*ls.CompletionItemData) + if !ok || data.AutoImport == nil { + return false + } + return data.AutoImport.ModuleSpecifier == expectedAction.Source + }) + if item == nil { + t.Fatalf("Code action '%s' from source '%s' not found in completions.", expectedAction.Name, expectedAction.Source) + } + assert.Check(t, strings.Contains(*item.Detail, expectedAction.Description), "Completion item detail does not contain expected description.") + f.applyTextEdits(t, *item.AdditionalTextEdits) + assert.Equal(t, f.getScriptInfo(f.activeFilename).content, expectedAction.NewFileContent, fmt.Sprintf("File content after applying code action '%s' did not match expected content.", expectedAction.Name)) + }, + } } -func (f *FourslashTest) verifyCompletionsWorker(t *testing.T, expected *CompletionsExpectedList) { +func (f *FourslashTest) verifyCompletionsWorker(t *testing.T, expected *CompletionsExpectedList) *lsproto.CompletionList { + prefix := f.getCurrentPositionPrefix() + list := f.getCompletions(t) + f.verifyCompletionsResult(t, list, expected, prefix) + return list +} + +func (f *FourslashTest) getCompletions(t *testing.T) *lsproto.CompletionList { prefix := f.getCurrentPositionPrefix() params := &lsproto.CompletionParams{ TextDocument: lsproto.TextDocumentIdentifier{ @@ -549,7 +589,7 @@ func (f *FourslashTest) verifyCompletionsWorker(t *testing.T, expected *Completi if !resultOk { t.Fatalf(prefix+"Unexpected response type for completion request: %T", resMsg.AsResponse().Result) } - f.verifyCompletionsResult(t, result.List, expected, prefix) + return result.List } func (f *FourslashTest) verifyCompletionsResult( @@ -633,9 +673,9 @@ func (f *FourslashTest) verifyCompletionsItems(t *testing.T, prefix string, actu } return } - nameToActualItem := make(map[string]*lsproto.CompletionItem) + nameToActualItems := make(map[string][]*lsproto.CompletionItem) for _, item := range actual { - nameToActualItem[item.Label] = item + nameToActualItems[item.Label] = append(nameToActualItems[item.Label], item) } if expected.Unsorted != nil { if expected.Includes != nil { @@ -647,24 +687,30 @@ func (f *FourslashTest) verifyCompletionsItems(t *testing.T, prefix string, actu for _, item := range expected.Unsorted { switch item := item.(type) { case string: - _, ok := nameToActualItem[item] + _, ok := nameToActualItems[item] if !ok { t.Fatalf("%sLabel '%s' not found in actual items. Actual items: %s", prefix, item, cmp.Diff(actual, nil)) } - delete(nameToActualItem, item) + delete(nameToActualItems, item) case *lsproto.CompletionItem: - actualItem, ok := nameToActualItem[item.Label] + actualItems, ok := nameToActualItems[item.Label] if !ok { t.Fatalf("%sLabel '%s' not found in actual items. Actual items: %s", prefix, item.Label, cmp.Diff(actual, nil)) } - delete(nameToActualItem, item.Label) + actualItem := actualItems[0] + actualItems = actualItems[1:] + if len(actualItems) == 0 { + delete(nameToActualItems, item.Label) + } else { + nameToActualItems[item.Label] = actualItems + } f.verifyCompletionItem(t, prefix+"Includes completion item mismatch for label "+item.Label+": ", actualItem, item) default: t.Fatalf("%sExpected completion item to be a string or *lsproto.CompletionItem, got %T", prefix, item) } } if len(expected.Unsorted) != len(actual) { - unmatched := slices.Collect(maps.Keys(nameToActualItem)) + unmatched := slices.Collect(maps.Keys(nameToActualItems)) t.Fatalf("%sAdditional completions found but not included in 'unsorted': %s", prefix, strings.Join(unmatched, "\n")) } return @@ -673,15 +719,22 @@ func (f *FourslashTest) verifyCompletionsItems(t *testing.T, prefix string, actu for _, item := range expected.Includes { switch item := item.(type) { case string: - _, ok := nameToActualItem[item] + _, ok := nameToActualItems[item] if !ok { t.Fatalf("%sLabel '%s' not found in actual items. Actual items: %s", prefix, item, cmp.Diff(actual, nil)) } case *lsproto.CompletionItem: - actualItem, ok := nameToActualItem[item.Label] + actualItems, ok := nameToActualItems[item.Label] if !ok { t.Fatalf("%sLabel '%s' not found in actual items. Actual items: %s", prefix, item.Label, cmp.Diff(actual, nil)) } + actualItem := actualItems[0] + actualItems = actualItems[1:] + if len(actualItems) == 0 { + delete(nameToActualItems, item.Label) + } else { + nameToActualItems[item.Label] = actualItems + } f.verifyCompletionItem(t, prefix+"Includes completion item mismatch for label "+item.Label+": ", actualItem, item) default: t.Fatalf("%sExpected completion item to be a string or *lsproto.CompletionItem, got %T", prefix, item) @@ -689,7 +742,7 @@ func (f *FourslashTest) verifyCompletionsItems(t *testing.T, prefix string, actu } } for _, exclude := range expected.Excludes { - if _, ok := nameToActualItem[exclude]; ok { + if _, ok := nameToActualItems[exclude]; ok { t.Fatalf("%sLabel '%s' should not be in actual items but was found. Actual items: %s", prefix, exclude, cmp.Diff(actual, nil)) } } @@ -712,36 +765,80 @@ func (f *FourslashTest) verifyCompletionsAreExactly(t *testing.T, prefix string, } } -var completionIgnoreOpts = cmp.FilterPath( - func(p cmp.Path) bool { - switch p.Last().String() { - case ".Kind", ".SortText", ".Data": - return true - default: +func ignorePaths(paths ...string) cmp.Option { + return cmp.FilterPath( + func(p cmp.Path) bool { + for _, path := range paths { + if p.Last().String() == path { + return true + } + } return false - } - }, - cmp.Ignore(), + }, + cmp.Ignore(), + ) +} + +var ( + completionIgnoreOpts = ignorePaths(".Kind", ".SortText", ".FilterText", ".Data") + autoImportIgnoreOpts = ignorePaths(".Kind", ".SortText", ".FilterText", ".Data", ".LabelDetails", ".Detail", ".AdditionalTextEdits") ) func (f *FourslashTest) verifyCompletionItem(t *testing.T, prefix string, actual *lsproto.CompletionItem, expected *lsproto.CompletionItem) { - if expected.Detail != nil || expected.Documentation != nil { - resMsg, result, resultOk := sendRequest(t, f, lsproto.CompletionItemResolveInfo, actual) - if resMsg == nil { - t.Fatal(prefix + "Expected non-nil response for completion item resolve, got nil") + var actualAutoImportData, expectedAutoImportData *ls.AutoImportData + if actual.Data != nil { + if data, ok := (*actual.Data).(*ls.CompletionItemData); ok { + actualAutoImportData = data.AutoImport } - if !resultOk { - t.Fatalf(prefix+"Unexpected response type for completion item resolve: %T", resMsg.AsResponse().Result) + } + if expected.Data != nil { + if data, ok := (*expected.Data).(*ls.CompletionItemData); ok { + expectedAutoImportData = data.AutoImport + } + } + if (actualAutoImportData == nil) != (expectedAutoImportData == nil) { + t.Fatal(prefix + "Mismatch in auto-import data presence") + } + + if expected.Detail != nil || expected.Documentation != nil || actualAutoImportData != nil { + actual = f.resolveCompletionItem(t, actual) + } + + if actualAutoImportData != nil { + assertDeepEqual(t, actual, expected, prefix, autoImportIgnoreOpts) + if expected.AdditionalTextEdits == AnyTextEdits { + assert.Check(t, actual.AdditionalTextEdits != nil && len(*actual.AdditionalTextEdits) > 0, prefix+" Expected non-nil AdditionalTextEdits for auto-import completion item") } - actual = result + if expected.LabelDetails != nil { + assertDeepEqual(t, actual.LabelDetails, expected.LabelDetails, prefix+" LabelDetails mismatch") + } + + assert.Equal(t, actualAutoImportData.ModuleSpecifier, expectedAutoImportData.ModuleSpecifier, prefix+" ModuleSpecifier mismatch") + } else { + assertDeepEqual(t, actual, expected, prefix, completionIgnoreOpts) + } + + if expected.FilterText != nil { + assertDeepEqual(t, actual.FilterText, expected.FilterText, prefix+" FilterText mismatch") } - assertDeepEqual(t, actual, expected, prefix, completionIgnoreOpts) if expected.Kind != nil { assertDeepEqual(t, actual.Kind, expected.Kind, prefix+" Kind mismatch") } assertDeepEqual(t, actual.SortText, core.OrElse(expected.SortText, ptrTo(string(ls.SortTextLocationPriority))), prefix+" SortText mismatch") } +func (f *FourslashTest) resolveCompletionItem(t *testing.T, item *lsproto.CompletionItem) *lsproto.CompletionItem { + prefix := f.getCurrentPositionPrefix() + resMsg, result, resultOk := sendRequest(t, f, lsproto.CompletionItemResolveInfo, item) + if resMsg == nil { + t.Fatal(prefix + "Expected non-nil response for completion item resolve, got nil") + } + if !resultOk { + t.Fatalf(prefix+"Unexpected response type for completion item resolve: %T, Error: %v", resMsg.AsResponse().Result, resMsg.AsResponse().Error) + } + return result +} + func getExpectedLabel(t *testing.T, item CompletionsExpectedItem) string { switch item := item.(type) { case string: @@ -763,6 +860,57 @@ func assertDeepEqual(t *testing.T, actual any, expected any, prefix string, opts } } +type ApplyCodeActionFromCompletionOptions struct { + Name string + Source string + AutoImportData *ls.AutoImportData + Description string + NewFileContent *string + NewRangeContent *string +} + +func (f *FourslashTest) VerifyApplyCodeActionFromCompletion(t *testing.T, markerName *string, options *ApplyCodeActionFromCompletionOptions) { + f.GoToMarker(t, *markerName) + completionsList := f.getCompletions(t) + item := core.Find(completionsList.Items, func(item *lsproto.CompletionItem) bool { + if item.Label != options.Name || item.Data == nil { + return false + } + data, ok := (*item.Data).(*ls.CompletionItemData) + if !ok { + return false + } + if options.AutoImportData != nil { + return data.AutoImport != nil && ((data.AutoImport.FileName == options.AutoImportData.FileName) && + (options.AutoImportData.ModuleSpecifier == "" || data.AutoImport.ModuleSpecifier == options.AutoImportData.ModuleSpecifier) && + (options.AutoImportData.ExportName == "" || data.AutoImport.ExportName == options.AutoImportData.ExportName) && + (options.AutoImportData.AmbientModuleName == nil || data.AutoImport.AmbientModuleName == options.AutoImportData.AmbientModuleName) && + (options.AutoImportData.IsPackageJsonImport == core.TSUnknown || data.AutoImport.IsPackageJsonImport == options.AutoImportData.IsPackageJsonImport)) + } + if data.AutoImport == nil && data.Source != "" && data.Source == options.Source { + return true + } + if data.AutoImport != nil && data.AutoImport.ModuleSpecifier == options.Source { + return true + } + return false + }) + if item == nil { + t.Fatalf("Code action '%s' from source '%s' not found in completions.", options.Name, options.Source) + } + item = f.resolveCompletionItem(t, item) + assert.Check(t, strings.Contains(*item.Detail, options.Description), "Completion item detail does not contain expected description.") + if item.AdditionalTextEdits == nil { + t.Fatalf("Expected non-nil AdditionalTextEdits for code action completion item.") + } + f.applyTextEdits(t, *item.AdditionalTextEdits) + if options.NewFileContent != nil { + assert.Equal(t, f.getScriptInfo(f.activeFilename).content, *options.NewFileContent, "File content after applying code action did not match expected content.") + } else if options.NewRangeContent != nil { + t.Fatal("!!! TODO") + } +} + func (f *FourslashTest) VerifyBaselineFindAllReferences( t *testing.T, markers ...string, @@ -1247,6 +1395,22 @@ func (f *FourslashTest) getSelection() core.TextRange { ) } +func (f *FourslashTest) applyTextEdits(t *testing.T, edits []*lsproto.TextEdit) { + script := f.getScriptInfo(f.activeFilename) + slices.SortFunc(edits, func(a, b *lsproto.TextEdit) int { + aStart := f.converters.LineAndCharacterToPosition(script, a.Range.Start) + bStart := f.converters.LineAndCharacterToPosition(script, b.Range.Start) + return int(aStart) - int(bStart) + }) + // Apply edits in reverse order to avoid affecting the positions of earlier edits. + for i := len(edits) - 1; i >= 0; i-- { + edit := edits[i] + start := int(f.converters.LineAndCharacterToPosition(script, edit.Range.Start)) + end := int(f.converters.LineAndCharacterToPosition(script, edit.Range.End)) + f.editScriptAndUpdateMarkers(t, f.activeFilename, start, end, edit.NewText) + } +} + func (f *FourslashTest) Replace(t *testing.T, start int, length int, text string) { f.editScriptAndUpdateMarkers(t, f.activeFilename, start, start+length, text) // f.checkPostEditInvariants() // !!! do we need this? @@ -1558,7 +1722,7 @@ func (f *FourslashTest) BaselineAutoImportsCompletions(t *testing.T, markerNames t.Fatalf(prefix+"Nil response received for resolve completion", f.lastKnownMarkerName) } if !resultOk { - t.Fatalf(prefix+"Unexpected response type for resolve completion: %T", resMsg.AsResponse().Result) + t.Fatalf(prefix+"Unexpected response type for resolve completion: %T, Error: %v", resMsg.AsResponse().Result, resMsg.AsResponse().Error) } if details == nil || details.AdditionalTextEdits == nil || len(*details.AdditionalTextEdits) == 0 { t.Fatalf(prefix+"Entry %s from %s returned no code changes from completion details request", item.Label, item.Detail) @@ -1792,3 +1956,7 @@ func (f *FourslashTest) verifyBaselines(t *testing.T) { baseline.Run(t, getBaselineFileName(t, command), content.String(), getBaselineOptions(command)) } } + +type anyTextEdits *[]*lsproto.TextEdit + +var AnyTextEdits = anyTextEdits(nil) diff --git a/internal/fourslash/tests/gen/autoImportCompletionAmbientMergedModule1_test.go b/internal/fourslash/tests/gen/autoImportCompletionAmbientMergedModule1_test.go new file mode 100644 index 0000000000..273f99b13e --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportCompletionAmbientMergedModule1_test.go @@ -0,0 +1,78 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportCompletionAmbientMergedModule1(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @strict: true +// @module: commonjs +// @filename: /node_modules/@types/vscode/index.d.ts +declare module "vscode" { + export class Position { + readonly line: number; + readonly character: number; + } +} +// @filename: src/motion.ts +import { Position } from "vscode"; + +export abstract class MoveQuoteMatch { + public override async execActionWithCount( + position: Position, + ): Promise {} +} + +declare module "vscode" { + interface Position { + toString(): string; + } +} +// @filename: src/smartQuotes.ts +import { MoveQuoteMatch } from "./motion"; + +export class MoveInsideNextQuote extends MoveQuoteMatch {/*1*/ + keys = ["i", "n", "q"]; +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "execActionWithCount", + InsertText: PtrTo("public execActionWithCount(position: Position): Promise {\n}"), + FilterText: PtrTo("execActionWithCount"), + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + Source: "ClassMemberSnippet/", + })), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo("1"), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "execActionWithCount", + Source: "ClassMemberSnippet/", + Description: "Includes imports of types referenced by 'execActionWithCount'", + NewFileContent: PtrTo(`import { Position } from "vscode"; +import { MoveQuoteMatch } from "./motion"; + +export class MoveInsideNextQuote extends MoveQuoteMatch { + keys = ["i", "n", "q"]; +}`), + }) +} diff --git a/internal/fourslash/tests/gen/autoImportCompletionExportEqualsWithDefault1_test.go b/internal/fourslash/tests/gen/autoImportCompletionExportEqualsWithDefault1_test.go new file mode 100644 index 0000000000..e5036d3293 --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportCompletionExportEqualsWithDefault1_test.go @@ -0,0 +1,104 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportCompletionExportEqualsWithDefault1(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @strict: true +// @module: commonjs +// @esModuleInterop: false +// @allowSyntheticDefaultImports: false +// @filename: node.ts +import Container from "./container.js"; +import Document from "./document.js"; + +declare namespace Node { + class Node extends Node_ {} + + export { Node as default }; +} + +declare abstract class Node_ { + parent: Container | Document | undefined; +} + +declare class Node extends Node_ {} + +export = Node; +// @filename: document.ts +import Container from "./container.js"; + +declare namespace Document { + export { Document_ as default }; +} + +declare class Document_ extends Container {} + +declare class Document extends Document_ {} + +export = Document; +// @filename: container.ts +import Node from "./node.js"; + +declare namespace Container { + export { Container_ as default }; +} + +declare abstract class Container_ extends Node { + p/*1*/ +} + +declare class Container extends Container_ {} + +export = Container;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "parent", + InsertText: PtrTo("parent: Container_ | Document_ | undefined;"), + FilterText: PtrTo("parent"), + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + Source: "ClassMemberSnippet/", + })), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo("1"), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "parent", + Source: "ClassMemberSnippet/", + Description: "Includes imports of types referenced by 'parent'", + NewFileContent: PtrTo(`import Document_ from "./document.js"; +import Node from "./node.js"; + +declare namespace Container { + export { Container_ as default }; +} + +declare abstract class Container_ extends Node { + p +} + +declare class Container extends Container_ {} + +export = Container;`), + }) +} diff --git a/internal/fourslash/tests/gen/autoImportCompletionExportListAugmentation1_test.go b/internal/fourslash/tests/gen/autoImportCompletionExportListAugmentation1_test.go new file mode 100644 index 0000000000..725856e637 --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportCompletionExportListAugmentation1_test.go @@ -0,0 +1,70 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportCompletionExportListAugmentation1(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: node18 +// @Filename: /node_modules/@sapphire/pieces/index.d.ts +interface Container { + stores: unknown; +} + +declare class Piece { + container: Container; +} + +export { Piece, type Container }; +// @FileName: /augmentation.ts +declare module "@sapphire/pieces" { + interface Container { + client: unknown; + } + export { Container }; +} +// @Filename: /index.ts +import { Piece } from "@sapphire/pieces"; +class FullPiece extends Piece { + /*1*/ +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "container", + InsertText: PtrTo("container: Container;"), + FilterText: PtrTo("container"), + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + Source: "ClassMemberSnippet/", + })), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo("1"), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "container", + Source: "ClassMemberSnippet/", + Description: "Includes imports of types referenced by 'container'", + NewFileContent: PtrTo(`import { Container, Piece } from "@sapphire/pieces"; +class FullPiece extends Piece { + +}`), + }) +} diff --git a/internal/fourslash/tests/gen/autoImportCompletionExportListAugmentation2_test.go b/internal/fourslash/tests/gen/autoImportCompletionExportListAugmentation2_test.go new file mode 100644 index 0000000000..34b6d1c7eb --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportCompletionExportListAugmentation2_test.go @@ -0,0 +1,80 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportCompletionExportListAugmentation2(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: node18 +// @Filename: /node_modules/@sapphire/pieces/index.d.ts +interface Container { + stores: unknown; +} + +declare class Piece { + get container(): Container; +} + +declare class AliasPiece extends Piece {} + +export { AliasPiece, type Container }; +// @Filename: /node_modules/@sapphire/framework/index.d.ts +import { AliasPiece } from "@sapphire/pieces"; + +declare class Command extends AliasPiece {} + +declare module "@sapphire/pieces" { + interface Container { + client: unknown; + } +} + +export { Command }; +// @Filename: /index.ts +import "@sapphire/pieces"; +import { Command } from "@sapphire/framework"; +class PingCommand extends Command { + /*1*/ +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "container", + InsertText: PtrTo("get container(): Container {\n}"), + FilterText: PtrTo("container"), + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + Source: "ClassMemberSnippet/", + })), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo("1"), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "container", + Source: "ClassMemberSnippet/", + Description: "Includes imports of types referenced by 'container'", + NewFileContent: PtrTo(`import "@sapphire/pieces"; +import { Command } from "@sapphire/framework"; +import { Container } from "@sapphire/pieces"; +class PingCommand extends Command { + +}`), + }) +} diff --git a/internal/fourslash/tests/gen/autoImportCompletionExportListAugmentation3_test.go b/internal/fourslash/tests/gen/autoImportCompletionExportListAugmentation3_test.go new file mode 100644 index 0000000000..1877ab0244 --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportCompletionExportListAugmentation3_test.go @@ -0,0 +1,69 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportCompletionExportListAugmentation3(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: node18 +// @Filename: /node_modules/@sapphire/pieces/index.d.ts +export interface Container { + stores: unknown; +} + +declare class Piece { + container: Container; +} + +export { Piece }; +// @FileName: /augmentation.ts +declare module "@sapphire/pieces" { + interface Container { + client: unknown; + } +} +// @Filename: /index.ts +import { Piece } from "@sapphire/pieces"; +class FullPiece extends Piece { + /*1*/ +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "container", + InsertText: PtrTo("container: Container;"), + FilterText: PtrTo("container"), + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + Source: "ClassMemberSnippet/", + })), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo("1"), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "container", + Source: "ClassMemberSnippet/", + Description: "Includes imports of types referenced by 'container'", + NewFileContent: PtrTo(`import { Container, Piece } from "@sapphire/pieces"; +class FullPiece extends Piece { + +}`), + }) +} diff --git a/internal/fourslash/tests/gen/autoImportCompletionExportListAugmentation4_test.go b/internal/fourslash/tests/gen/autoImportCompletionExportListAugmentation4_test.go new file mode 100644 index 0000000000..b64b116e1b --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportCompletionExportListAugmentation4_test.go @@ -0,0 +1,78 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportCompletionExportListAugmentation4(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: node18 +// @Filename: /node_modules/@sapphire/pieces/index.d.ts +interface Container { + stores: unknown; +} + +declare class Piece { + get container(): Container; +} + +export { Piece as Alias, type Container }; +// @Filename: /node_modules/@sapphire/framework/index.d.ts +import { Alias } from "@sapphire/pieces"; + +declare class Command extends Alias {} + +declare module "@sapphire/pieces" { + interface Container { + client: unknown; + } +} + +export { Command as CommandAlias }; +// @Filename: /index.ts +import "@sapphire/pieces"; +import { CommandAlias } from "@sapphire/framework"; +class PingCommand extends CommandAlias { + /*1*/ +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "container", + InsertText: PtrTo("get container(): Container {\n}"), + FilterText: PtrTo("container"), + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + Source: "ClassMemberSnippet/", + })), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo("1"), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "container", + Source: "ClassMemberSnippet/", + Description: "Includes imports of types referenced by 'container'", + NewFileContent: PtrTo(`import "@sapphire/pieces"; +import { CommandAlias } from "@sapphire/framework"; +import { Container } from "@sapphire/pieces"; +class PingCommand extends CommandAlias { + +}`), + }) +} diff --git a/internal/fourslash/tests/gen/autoImportFileExcludePatterns3_test.go b/internal/fourslash/tests/gen/autoImportFileExcludePatterns3_test.go new file mode 100644 index 0000000000..e693dda53e --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportFileExcludePatterns3_test.go @@ -0,0 +1,71 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportFileExcludePatterns3(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: commonjs +// @Filename: /ambient1.d.ts +declare module "foo" { + export const x = 1; +} +// @Filename: /ambient2.d.ts +declare module "foo" { + export const y = 2; +} +// @Filename: /index.ts +/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "x", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "foo", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "y", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "foo", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, false), + }, + }) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobals, + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportPathsAliasesAndBarrels_test.go b/internal/fourslash/tests/gen/autoImportPathsAliasesAndBarrels_test.go new file mode 100644 index 0000000000..3848049ba1 --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportPathsAliasesAndBarrels_test.go @@ -0,0 +1,83 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportPathsAliasesAndBarrels(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /tsconfig.json + { + "compilerOptions": { + "module": "commonjs", + "paths": { + "~/*": ["src/*"] + } + } +} +// @Filename: /src/dirA/index.ts + export * from "./thing1A"; + export * from "./thing2A"; +// @Filename: /src/dirA/thing1A.ts + export class Thing1A {} + Thing/**/ +// @Filename: /src/dirA/thing2A.ts + export class Thing2A {} +// @Filename: /src/dirB/index.ts + export * from "./thing1B"; + export * from "./thing2B"; +// @Filename: /src/dirB/thing1B.ts + export class Thing1B {} +// @Filename: /src/dirB/thing2B.ts + export class Thing2B {}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Thing2A", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./thing2A", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "Thing1B", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "~/dirB", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "Thing2B", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "~/dirB", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportProvider6_test.go b/internal/fourslash/tests/gen/autoImportProvider6_test.go new file mode 100644 index 0000000000..eeb92339c0 --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportProvider6_test.go @@ -0,0 +1,50 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportProvider6(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /home/src/workspaces/project/tsconfig.json +{ "compilerOptions": { "module": "commonjs", "lib": ["es2019"] } } +// @Filename: /home/src/workspaces/project/package.json +{ "dependencies": { "antd": "*", "react": "*" } } +// @Filename: /home/src/workspaces/project/node_modules/@types/react/index.d.ts +export declare function Component(): void; +// @Filename: /home/src/workspaces/project/node_modules/antd/index.d.ts +import "react"; +// @Filename: /home/src/workspaces/project/index.ts +Component/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Component", + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "react", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportProvider_exportMap1_test.go b/internal/fourslash/tests/gen/autoImportProvider_exportMap1_test.go new file mode 100644 index 0000000000..82b994d822 --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportProvider_exportMap1_test.go @@ -0,0 +1,83 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportProvider_exportMap1(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /home/src/workspaces/project/tsconfig.json +{ + "compilerOptions": { + "module": "nodenext" + } +} +// @Filename: /home/src/workspaces/project/package.json +{ + "type": "module", + "dependencies": { + "dependency": "^1.0.0" + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/package.json +{ + "type": "module", + "name": "dependency", + "version": "1.0.0", + "exports": { + ".": { + "types": "./lib/index.d.ts" + }, + "./lol": { + "types": "./lib/lol.d.ts" + } + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/index.d.ts +export function fooFromIndex(): void; +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/lol.d.ts +export function fooFromLol(): void; +// @Filename: /home/src/workspaces/project/src/foo.ts +fooFrom/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "fooFromIndex", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "dependency", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + &lsproto.CompletionItem{ + Label: "fooFromLol", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "dependency/lol", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportProvider_exportMap2_test.go b/internal/fourslash/tests/gen/autoImportProvider_exportMap2_test.go new file mode 100644 index 0000000000..57eb4b8e9a --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportProvider_exportMap2_test.go @@ -0,0 +1,76 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportProvider_exportMap2(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /home/src/workspaces/project/tsconfig.json +{ + "compilerOptions": { + "module": "commonjs" + "moduleResolution": "node10", + } +} +// @Filename: /home/src/workspaces/project/package.json +{ + "type": "module", + "dependencies": { + "dependency": "^1.0.0" + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/package.json +{ + "type": "module", + "name": "dependency", + "version": "1.0.0", + "types": "./lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts" + }, + "./lol": { + "types": "./lib/lol.d.ts" + } + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/index.d.ts +export function fooFromIndex(): void; +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/lol.d.ts +export function fooFromLol(): void; +// @Filename: /home/src/workspaces/project/src/foo.ts +fooFrom/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "fooFromIndex", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "dependency", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + }, false), + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportProvider_exportMap3_test.go b/internal/fourslash/tests/gen/autoImportProvider_exportMap3_test.go new file mode 100644 index 0000000000..8f44b395be --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportProvider_exportMap3_test.go @@ -0,0 +1,69 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportProvider_exportMap3(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /home/src/workspaces/project/tsconfig.json +{ + "compilerOptions": { + "module": "nodenext" + } +} +// @Filename: /home/src/workspaces/project/package.json +{ + "type": "module", + "dependencies": { + "dependency": "^1.0.0" + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/package.json +{ + "name": "dependency", + "version": "1.0.0", + "main": "./lib/index.js", + "exports": "./lib/lol.d.ts" +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/index.d.ts +export function fooFromIndex(): void; +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/lol.d.ts +export function fooFromLol(): void; +// @Filename: /home/src/workspaces/project/src/foo.ts +fooFrom/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "fooFromLol", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "dependency", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + }, + Excludes: []string{ + "fooFromIndex", + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportProvider_exportMap4_test.go b/internal/fourslash/tests/gen/autoImportProvider_exportMap4_test.go new file mode 100644 index 0000000000..9df1a5a2fd --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportProvider_exportMap4_test.go @@ -0,0 +1,72 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportProvider_exportMap4(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /home/src/workspaces/project/tsconfig.json +{ + "compilerOptions": { + "module": "nodenext" + } +} +// @Filename: /home/src/workspaces/project/package.json +{ + "type": "module", + "dependencies": { + "dependency": "^1.0.0" + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/package.json +{ + "type": "module", + "name": "dependency", + "version": "1.0.0", + "exports": { + "types": "./lib/index.d.ts", + "require": "./lib/lol.js" + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/index.d.ts +export function fooFromIndex(): void; +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/lol.d.ts +export function fooFromLol(): void; +// @Filename: /home/src/workspaces/project/src/foo.ts +fooFrom/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "fooFromIndex", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "dependency", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + }, + Excludes: []string{ + "fooFromLol", + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportProvider_exportMap5_test.go b/internal/fourslash/tests/gen/autoImportProvider_exportMap5_test.go new file mode 100644 index 0000000000..7e92a21a2b --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportProvider_exportMap5_test.go @@ -0,0 +1,94 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportProvider_exportMap5(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @types package lookup +// @Filename: /home/src/workspaces/project/tsconfig.json +{ + "compilerOptions": { + "module": "nodenext" + } +} +// @Filename: /home/src/workspaces/project/package.json +{ + "type": "module", + "dependencies": { + "dependency": "^1.0.0" + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/package.json +{ + "type": "module", + "name": "dependency", + "version": "1.0.0", + "exports": { + ".": "./lib/index.js", + "./lol": "./lib/lol.js" + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/index.js +export function fooFromIndex() {} +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/lol.js +export function fooFromLol() {} +// @Filename: /home/src/workspaces/project/node_modules/@types/dependency/package.json +{ + "type": "module", + "name": "@types/dependency", + "version": "1.0.0", + "exports": { + ".": "./lib/index.d.ts", + "./lol": "./lib/lol.d.ts" + } +} +// @Filename: /home/src/workspaces/project/node_modules/@types/dependency/lib/index.d.ts +export declare function fooFromIndex(): void; +// @Filename: /home/src/workspaces/project/node_modules/@types/dependency/lib/lol.d.ts +export declare function fooFromLol(): void; +// @Filename: /home/src/workspaces/project/src/foo.ts +fooFrom/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "fooFromIndex", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "dependency", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + &lsproto.CompletionItem{ + Label: "fooFromLol", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "dependency/lol", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportProvider_exportMap6_test.go b/internal/fourslash/tests/gen/autoImportProvider_exportMap6_test.go new file mode 100644 index 0000000000..47d78b34d8 --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportProvider_exportMap6_test.go @@ -0,0 +1,101 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportProvider_exportMap6(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @types package should be ignored because implementation package has types +// @Filename: /home/src/workspaces/project/tsconfig.json +{ + "compilerOptions": { + "module": "nodenext" + } +} +// @Filename: /home/src/workspaces/project/package.json +{ + "type": "module", + "dependencies": { + "dependency": "^1.0.0" + }, + "devDependencies": { + "@types/dependency": "^1.0.0" + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/package.json +{ + "type": "module", + "name": "dependency", + "version": "1.0.0", + "exports": { + ".": "./lib/index.js", + "./lol": "./lib/lol.js" + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/index.js +export function fooFromIndex() {} +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/index.d.ts +export declare function fooFromIndex(): void +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/lol.js +export function fooFromLol() {} +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/lol.d.ts +export declare function fooFromLol(): void +// @Filename: /home/src/workspaces/project/node_modules/@types/dependency/package.json +{ + "type": "module", + "name": "@types/dependency", + "version": "1.0.0", + "exports": { + ".": "./lib/index.d.ts", + "./lol": "./lib/lol.d.ts" + } +} +// @Filename: /home/src/workspaces/project/node_modules/@types/dependency/lib/index.d.ts +export declare function fooFromAtTypesIndex(): void; +// @Filename: /home/src/workspaces/project/node_modules/@types/dependency/lib/lol.d.ts +export declare function fooFromAtTypesLol(): void; +// @Filename: /home/src/workspaces/project/src/foo.ts +fooFrom/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "fooFromIndex", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "dependency", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + &lsproto.CompletionItem{ + Label: "fooFromLol", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "dependency/lol", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportProvider_exportMap7_test.go b/internal/fourslash/tests/gen/autoImportProvider_exportMap7_test.go new file mode 100644 index 0000000000..7088378a8e --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportProvider_exportMap7_test.go @@ -0,0 +1,85 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportProvider_exportMap7(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /home/src/workspaces/project/tsconfig.json +{ + "compilerOptions": { + "module": "nodenext" + } +} +// @Filename: /home/src/workspaces/project/package.json +{ + "type": "module", + "dependencies": { + "dependency": "^1.0.0" + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/package.json +{ + "type": "module", + "name": "dependency", + "version": "1.0.0", + "exports": { + ".": { + "types": "./lib/index.d.ts" + }, + "./lol": { + "types": "./lib/lol.d.ts" + } + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/index.d.ts +export function fooFromIndex(): void; +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/lol.d.ts +export function fooFromLol(): void; +// @Filename: /home/src/workspaces/project/src/bar.ts +import { fooFromIndex } from "dependency"; +// @Filename: /home/src/workspaces/project/src/foo.ts +fooFrom/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "fooFromIndex", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "dependency", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + &lsproto.CompletionItem{ + Label: "fooFromLol", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "dependency/lol", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportProvider_exportMap8_test.go b/internal/fourslash/tests/gen/autoImportProvider_exportMap8_test.go new file mode 100644 index 0000000000..c31f19f053 --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportProvider_exportMap8_test.go @@ -0,0 +1,103 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportProvider_exportMap8(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /home/src/workspaces/project/tsconfig.json +{ + "compilerOptions": { + "module": "nodenext" + } +} +// @Filename: /home/src/workspaces/project/package.json +{ + "type": "module", + "dependencies": { + "dependency": "^1.0.0" + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/package.json +{ + "type": "module", + "name": "dependency", + "version": "1.0.0", + "exports": { + "./lol": { + "import": "./lib/index.js", + "require": "./lib/lol.js" + } + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/index.d.ts +export function fooFromIndex(): void; +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/lol.d.ts +export function fooFromLol(): void; +// @Filename: /home/src/workspaces/project/src/bar.ts +import { fooFromIndex } from "dependency"; +// @Filename: /home/src/workspaces/project/src/foo.cts +fooFrom/*cts*/ +// @Filename: /home/src/workspaces/project/src/foo.mts +fooFrom/*mts*/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "cts") + f.VerifyCompletions(t, "cts", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "fooFromLol", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "dependency/lol", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + }, + Excludes: []string{ + "fooFromIndex", + }, + }, + }) + f.GoToMarker(t, "mts") + f.VerifyCompletions(t, "mts", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "fooFromIndex", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "dependency/lol", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + }, + Excludes: []string{ + "fooFromLol", + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportProvider_exportMap9_test.go b/internal/fourslash/tests/gen/autoImportProvider_exportMap9_test.go new file mode 100644 index 0000000000..dd90f2c0fa --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportProvider_exportMap9_test.go @@ -0,0 +1,73 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportProvider_exportMap9(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /home/src/workspaces/project/tsconfig.json +{ + "compilerOptions": { + "module": "nodenext" + } +} +// @Filename: /home/src/workspaces/project/package.json +{ + "type": "module", + "dependencies": { + "dependency": "^1.0.0" + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/package.json +{ + "type": "module", + "name": "dependency", + "version": "1.0.0", + "exports": { + "./lol": ["./lib/index.js", "./lib/lol.js"] + } +} +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/index.d.ts +export function fooFromIndex(): void; +// @Filename: /home/src/workspaces/project/node_modules/dependency/lib/lol.d.ts +export function fooFromLol(): void; +// @Filename: /home/src/workspaces/project/src/bar.ts +import { fooFromIndex } from "dependency"; +// @Filename: /home/src/workspaces/project/src/foo.ts +fooFrom/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "fooFromIndex", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "dependency/lol", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + }, + Excludes: []string{ + "fooFromLol", + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportProvider_globalTypingsCache_test.go b/internal/fourslash/tests/gen/autoImportProvider_globalTypingsCache_test.go new file mode 100644 index 0000000000..e4c20f6b8c --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportProvider_globalTypingsCache_test.go @@ -0,0 +1,57 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportProvider_globalTypingsCache(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /home/src/Library/Caches/typescript/node_modules/@types/react-router-dom/package.json + { "name": "@types/react-router-dom", "version": "16.8.4", "types": "index.d.ts" } +// @Filename: /home/src/Library/Caches/typescript/node_modules/@types/react-router-dom/index.d.ts + export class BrowserRouterFromDts {} +// @Filename: /home/src/workspaces/project/package.json + { "dependencies": { "react-router-dom": "*" } } +// @Filename: /home/src/workspaces/project/tsconfig.json + { "compilerOptions": { "module": "commonjs", "allowJs": true, "checkJs": true, "maxNodeModuleJsDepth": 2 }, "typeAcquisition": { "enable": true } } +// @Filename: /home/src/workspaces/project/node_modules/react-router-dom/package.json + { "name": "react-router-dom", "version": "16.8.4", "main": "index.js" } +// @Filename: /home/src/workspaces/project/node_modules/react-router-dom/index.js + import "./BrowserRouter"; + export {}; +// @Filename: /home/src/workspaces/project/node_modules/react-router-dom/BrowserRouter.js + export const BrowserRouterFromJs = () => null; +// @Filename: /home/src/workspaces/project/index.js +BrowserRouter/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsInJSPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "BrowserRouterFromDts", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "react-router-dom", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, false), + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportProvider_namespaceSameNameAsIntrinsic_test.go b/internal/fourslash/tests/gen/autoImportProvider_namespaceSameNameAsIntrinsic_test.go new file mode 100644 index 0000000000..958cb934c0 --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportProvider_namespaceSameNameAsIntrinsic_test.go @@ -0,0 +1,57 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportProvider_namespaceSameNameAsIntrinsic(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /home/src/workspaces/project/node_modules/fp-ts/package.json +{ "name": "fp-ts", "version": "0.10.4" } +// @Filename: /home/src/workspaces/project/node_modules/fp-ts/index.d.ts +export * as string from "./lib/string"; +// @Filename: /home/src/workspaces/project/node_modules/fp-ts/lib/string.d.ts +export declare const fromString: (s: string) => string; +export type SafeString = string; +// @Filename: /home/src/workspaces/project/package.json +{ "dependencies": { "fp-ts": "^0.10.4" } } +// @Filename: /home/src/workspaces/project/tsconfig.json +{ "compilerOptions": { "module": "commonjs" } } +// @Filename: /home/src/workspaces/project/index.ts +type A = { name: string/**/ }` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "string", + SortText: PtrTo(string(ls.SortTextGlobalsOrKeywords)), + }, + &lsproto.CompletionItem{ + Label: "string", + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "fp-ts", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportProvider_wildcardExports1_test.go b/internal/fourslash/tests/gen/autoImportProvider_wildcardExports1_test.go new file mode 100644 index 0000000000..4a12fc1dde --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportProvider_wildcardExports1_test.go @@ -0,0 +1,122 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportProvider_wildcardExports1(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /home/src/workspaces/project/node_modules/pkg/package.json +{ + "name": "pkg", + "version": "1.0.0", + "exports": { + "./*": "./a/*.js", + "./b/*.js": "./b/*.js", + "./c/*": "./c/*", + "./d/*": { + "import": "./d/*.mjs" + } + } +} +// @Filename: /home/src/workspaces/project/node_modules/pkg/a/a1.d.ts +export const a1: number; +// @Filename: /home/src/workspaces/project/node_modules/pkg/b/b1.d.ts +export const b1: number; +// @Filename: /home/src/workspaces/project/node_modules/pkg/b/b2.d.mts +export const NOT_REACHABLE: number; +// @Filename: /home/src/workspaces/project/node_modules/pkg/c/c1.d.ts +export const c1: number; +// @Filename: /home/src/workspaces/project/node_modules/pkg/c/subfolder/c2.d.mts +export const c2: number; +// @Filename: /home/src/workspaces/project/node_modules/pkg/d/d1.d.mts +export const d1: number; +// @Filename: /home/src/workspaces/project/package.json +{ + "type": "module", + "dependencies": { + "pkg": "1.0.0" + } +} +// @Filename: /home/src/workspaces/project/tsconfig.json +{ + "compilerOptions": { + "module": "nodenext" + } +} +// @Filename: /home/src/workspaces/project/main.ts +/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "a1", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "pkg/a1", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "b1", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "pkg/b/b1.js", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "c1", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "pkg/c/c1.js", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "c2", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "pkg/c/subfolder/c2.mjs", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "d1", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "pkg/d/d1", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + Excludes: []string{ + "NOT_REACHABLE", + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportProvider_wildcardExports2_test.go b/internal/fourslash/tests/gen/autoImportProvider_wildcardExports2_test.go new file mode 100644 index 0000000000..efaa6244a9 --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportProvider_wildcardExports2_test.go @@ -0,0 +1,67 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportProvider_wildcardExports2(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /home/src/workspaces/project/node_modules/pkg/package.json +{ + "name": "pkg", + "version": "1.0.0", + "exports": { + "./core/*": { + "types": "./lib/core/*.d.ts", + "default": "./lib/core/*.js" + } + } +} +// @Filename: /home/src/workspaces/project/node_modules/pkg/lib/core/test.d.ts +export function test(): void; +// @Filename: /home/src/workspaces/project/package.json +{ + "type": "module", + "dependencies": { + "pkg": "1.0.0" + } +} +// @Filename: /home/src/workspaces/project/tsconfig.json +{ + "compilerOptions": { + "module": "nodenext" + } +} +// @Filename: /home/src/workspaces/project/main.ts +/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "test", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "pkg/core/test", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportProvider_wildcardExports3_test.go b/internal/fourslash/tests/gen/autoImportProvider_wildcardExports3_test.go new file mode 100644 index 0000000000..ac0430073b --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportProvider_wildcardExports3_test.go @@ -0,0 +1,71 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportProvider_wildcardExports3(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /home/src/workspaces/project/packages/ui/package.json +{ + "name": "@repo/ui", + "version": "1.0.0", + "exports": { + "./*": "./src/*.tsx" + } +} +// @Filename: /home/src/workspaces/project/packages/ui/src/Card.tsx +export const Card = () => null; +// @Filename: /home/src/workspaces/project/apps/web/package.json +{ + "name": "web", + "version": "1.0.0", + "dependencies": { + "@repo/ui": "workspace:*" + } +} +// @Filename: /home/src/workspaces/project/apps/web/tsconfig.json +{ + "compilerOptions": { + "module": "esnext", + "moduleResolution": "bundler", + "noEmit": true, + "jsx": "preserve" + }, + "include": ["app"] +} +// @Filename: /home/src/workspaces/project/apps/web/app/index.tsx +(); +// @link: /home/src/workspaces/project/packages/ui -> /home/src/workspaces/project/apps/web/node_modules/@repo/ui` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, nil, &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Card", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "@repo/ui/Card", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportReExportFromAmbientModule_test.go b/internal/fourslash/tests/gen/autoImportReExportFromAmbientModule_test.go new file mode 100644 index 0000000000..a685a1a371 --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportReExportFromAmbientModule_test.go @@ -0,0 +1,76 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportReExportFromAmbientModule(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /home/src/workspaces/project/tsconfig.json +{ + "compilerOptions": { + "module": "commonjs" + } +} +// @Filename: /home/src/workspaces/project/node_modules/@types/node/index.d.ts +declare module "fs" { + export function accessSync(path: string): void; +} +// @Filename: /home/src/workspaces/project/node_modules/@types/fs-extra/index.d.ts +export * from "fs"; +// @Filename: /home/src/workspaces/project/index.ts +access/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "accessSync", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "fs", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "accessSync", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "fs-extra", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "accessSync", + Source: "fs-extra", + Description: "Add import from \"fs-extra\"", + NewFileContent: PtrTo(`import { accessSync } from "fs-extra"; + +access`), + AutoImportData: &ls.AutoImportData{ + ExportName: "accessSync", + FileName: "/home/src/workspaces/project/node_modules/@types/fs-extra/index.d.ts", + ModuleSpecifier: "fs-extra", + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportSameNameDefaultExported_test.go b/internal/fourslash/tests/gen/autoImportSameNameDefaultExported_test.go new file mode 100644 index 0000000000..1c4e6a85be --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportSameNameDefaultExported_test.go @@ -0,0 +1,59 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportSameNameDefaultExported(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: commonjs +// @Filename: /node_modules/antd/index.d.ts +declare function Table(): void; +export default Table; +// @Filename: /node_modules/rc-table/index.d.ts +declare function Table(): void; +export default Table; +// @Filename: /index.ts +Table/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Table", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "antd", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + &lsproto.CompletionItem{ + Label: "Table", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "rc-table", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + }, false), + }, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportSortCaseSensitivity2_test.go b/internal/fourslash/tests/gen/autoImportSortCaseSensitivity2_test.go new file mode 100644 index 0000000000..ff585d978d --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportSortCaseSensitivity2_test.go @@ -0,0 +1,56 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportSortCaseSensitivity2(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /a.ts +export interface HasBar { bar: number } +export function hasBar(x: unknown): x is HasBar { return x && typeof x.bar === "number" } +export function foo() {} +export type __String = string; +// @Filename: /b.ts +import { __String, HasBar, hasBar } from "./a"; +f/**/;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + Detail: PtrTo("function foo(): void"), + Kind: PtrTo(lsproto.CompletionItemKindFunction), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "foo", + Source: "./a", + Description: "Update import from \"./a\"", + NewFileContent: PtrTo(`import { __String, foo, HasBar, hasBar } from "./a"; +f;`), + }) +} diff --git a/internal/fourslash/tests/gen/autoImportTypeOnlyPreferred1_test.go b/internal/fourslash/tests/gen/autoImportTypeOnlyPreferred1_test.go new file mode 100644 index 0000000000..3a89a0273c --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportTypeOnlyPreferred1_test.go @@ -0,0 +1,63 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportTypeOnlyPreferred1(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @verbatimModuleSyntax: true +// @module: esnext +// @moduleResolution: bundler +// @Filename: /ts.d.ts +declare namespace ts { + interface SourceFile { + text: string; + } + function createSourceFile(): SourceFile; +} +export = ts; +// @Filename: /types.ts +export interface VFS { + getSourceFile(path: string): ts/**/ +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "ts", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./ts", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }).AndApplyCodeAction(t, &fourslash.CompletionsExpectedCodeAction{ + Name: "ts", + Source: "./ts", + Description: "Add import from \"./ts\"", + NewFileContent: `import type ts from "./ts"; + +export interface VFS { + getSourceFile(path: string): ts +}`, + }) +} diff --git a/internal/fourslash/tests/gen/autoImportVerbatimTypeOnly1_test.go b/internal/fourslash/tests/gen/autoImportVerbatimTypeOnly1_test.go new file mode 100644 index 0000000000..6d8622d386 --- /dev/null +++ b/internal/fourslash/tests/gen/autoImportVerbatimTypeOnly1_test.go @@ -0,0 +1,52 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestAutoImportVerbatimTypeOnly1(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: node18 +// @verbatimModuleSyntax: true +// @Filename: /mod.ts +export const value = 0; +export class C { constructor(v: any) {} } +export interface I {} +// @Filename: /a.mts +const x: /**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "I", + Source: "./mod", + Description: "Add import from \"./mod.js\"", + AutoImportData: &ls.AutoImportData{ + ExportName: "I", + FileName: "/mod.ts", + ModuleSpecifier: "./mod.js", + }, + NewFileContent: PtrTo(`import type { I } from "./mod.js"; + +const x: `), + }) + f.Insert(t, "I = new C") + f.VerifyApplyCodeActionFromCompletion(t, nil, &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "C", + Source: "./mod", + Description: "Update import from \"./mod.js\"", + AutoImportData: &ls.AutoImportData{ + ExportName: "C", + FileName: "/mod.ts", + ModuleSpecifier: "./mod.js", + }, + NewFileContent: PtrTo(`import { C, type I } from "./mod.js"; + +const x: I = new C`), + }) +} diff --git a/internal/fourslash/tests/gen/completionForObjectProperty_test.go b/internal/fourslash/tests/gen/completionForObjectProperty_test.go new file mode 100644 index 0000000000..3ccb4b9527 --- /dev/null +++ b/internal/fourslash/tests/gen/completionForObjectProperty_test.go @@ -0,0 +1,189 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionForObjectProperty(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /a.ts +export const foo = { bar: 'baz' }; +// @Filename: /b.ts +const test = foo/*1*/ +// @Filename: /c.ts +const test2 = {...foo/*2*/} +// @Filename: /d.ts +const test3 = [{...foo/*3*/}] +// @Filename: /e.ts +const test4 = { foo/*4*/ } +// @Filename: /f.ts +const test5 = { foo: /*5*/ } +// @Filename: /g.ts +const test6 = { unrelated: foo/*6*/ } +// @Filename: /i.ts +const test7: { foo/*7*/: "unrelated" } +// @Filename: /h.ts +const test8: { foo: string } = { foo/*8*/ }` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyCompletions(t, "2", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyCompletions(t, "3", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyCompletions(t, "4", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyCompletions(t, "5", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyCompletions(t, "6", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyCompletions(t, "7", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Excludes: []string{ + "foo", + }, + }, + }) + f.VerifyCompletions(t, "8", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + SortText: PtrTo(string(ls.SortTextLocationPriority)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionInNamedImportLocation_test.go b/internal/fourslash/tests/gen/completionInNamedImportLocation_test.go index 70e23f84fa..dd636cca8b 100644 --- a/internal/fourslash/tests/gen/completionInNamedImportLocation_test.go +++ b/internal/fourslash/tests/gen/completionInNamedImportLocation_test.go @@ -12,7 +12,7 @@ import ( func TestCompletionInNamedImportLocation(t *testing.T) { t.Parallel() - t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `// @Filename: file.ts export var x = 10; diff --git a/internal/fourslash/tests/gen/completionPropertyShorthandForObjectLiteral5_test.go b/internal/fourslash/tests/gen/completionPropertyShorthandForObjectLiteral5_test.go new file mode 100644 index 0000000000..ed5e08c7ff --- /dev/null +++ b/internal/fourslash/tests/gen/completionPropertyShorthandForObjectLiteral5_test.go @@ -0,0 +1,45 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionPropertyShorthandForObjectLiteral5(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: esnext +// @Filename: /a.ts +export const exportedConstant = 0; +// @Filename: /b.ts +const foo = 'foo' +const obj = { exp/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "exportedConstant", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "/a", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsClassMemberImportTypeNodeParameter1_test.go b/internal/fourslash/tests/gen/completionsClassMemberImportTypeNodeParameter1_test.go new file mode 100644 index 0000000000..1a537ea7ce --- /dev/null +++ b/internal/fourslash/tests/gen/completionsClassMemberImportTypeNodeParameter1_test.go @@ -0,0 +1,47 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsClassMemberImportTypeNodeParameter1(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: node18 +// @Filename: /generation.d.ts +export type GenerationConfigType = { max_length?: number }; +// @FileName: /index.d.ts +export declare class PreTrainedModel { + _get_generation_config( + param: import("./generation.js").GenerationConfigType, + ): import("./generation.js").GenerationConfigType; +} + +export declare class BlenderbotSmallPreTrainedModel extends PreTrainedModel { + /*1*/ +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "_get_generation_config", + InsertText: PtrTo("_get_generation_config(param: import(\"./generation.js\").GenerationConfigType): import(\"./generation.js\").GenerationConfigType;"), + FilterText: PtrTo("_get_generation_config"), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsClassMemberImportTypeNodeParameter2_test.go b/internal/fourslash/tests/gen/completionsClassMemberImportTypeNodeParameter2_test.go new file mode 100644 index 0000000000..291c5f4023 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsClassMemberImportTypeNodeParameter2_test.go @@ -0,0 +1,45 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsClassMemberImportTypeNodeParameter2(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: node18 +// @FileName: /index.d.ts +export declare class Cls { + method( + param: import("./doesntexist.js").Foo, + ): import("./doesntexist.js").Foo; +} + +export declare class Derived extends Cls { + /*1*/ +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "method", + InsertText: PtrTo("method(param: import(\"./doesntexist.js\").Foo);"), + FilterText: PtrTo("method"), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsClassMemberImportTypeNodeParameter3_test.go b/internal/fourslash/tests/gen/completionsClassMemberImportTypeNodeParameter3_test.go new file mode 100644 index 0000000000..d3a0eb7fc7 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsClassMemberImportTypeNodeParameter3_test.go @@ -0,0 +1,49 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsClassMemberImportTypeNodeParameter3(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: node18 +// @FileName: /other/foo.d.ts +export declare type Bar = { baz: string }; +// @FileName: /other/cls.d.ts +export declare class Cls { + method( + param: import("./foo.js").Bar, + ): import("./foo.js").Bar; +} +// @FileName: /index.d.ts +import { Cls } from "./other/cls.js"; + +export declare class Derived extends Cls { + /*1*/ +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "method", + InsertText: PtrTo("method(param: import(\"./other/foo.js\").Bar): import(\"./other/foo.js\").Bar;"), + FilterText: PtrTo("method"), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsClassMemberImportTypeNodeParameter4_test.go b/internal/fourslash/tests/gen/completionsClassMemberImportTypeNodeParameter4_test.go new file mode 100644 index 0000000000..52343b3055 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsClassMemberImportTypeNodeParameter4_test.go @@ -0,0 +1,47 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsClassMemberImportTypeNodeParameter4(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: node18 +// @FileName: /other/cls.d.ts +export declare class Cls { + method( + param: import("./doesntexist.js").Foo, + ): import("./doesntexist.js").Foo; +} +// @FileName: /index.d.ts +import { Cls } from "./other/cls.js"; + +export declare class Derived extends Cls { + /*1*/ +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "method", + InsertText: PtrTo("method(param: import(\"./doesntexist.js\").Foo);"), + FilterText: PtrTo("method"), + AdditionalTextEdits: fourslash.AnyTextEdits, + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImportBaseUrl_test.go b/internal/fourslash/tests/gen/completionsImportBaseUrl_test.go new file mode 100644 index 0000000000..e73fae4069 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImportBaseUrl_test.go @@ -0,0 +1,52 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImportBaseUrl(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /tsconfig.json +{ + "compilerOptions": { + "baseUrl": ".", + "module": "esnext" + } +} +// @Filename: /src/a.ts +export const foo = 0; +// @Filename: /src/b.ts +fo/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "/src/a", + }, + })), + Detail: PtrTo("const foo: 0"), + Kind: PtrTo(lsproto.CompletionItemKindVariable), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImportDefaultExportCrash2_test.go b/internal/fourslash/tests/gen/completionsImportDefaultExportCrash2_test.go new file mode 100644 index 0000000000..f300628828 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImportDefaultExportCrash2_test.go @@ -0,0 +1,77 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImportDefaultExportCrash2(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: node18 +// @allowJs: true +// @Filename: /node_modules/dom7/index.d.ts +export interface Dom7Array { + length: number; + prop(propName: string): any; +} + +export interface Dom7 { + (): Dom7Array; + fn: any; +} + +declare const Dom7: Dom7; + +export { + Dom7 as $, +}; +// @Filename: /dom7.js +import * as methods from 'dom7'; +Object.keys(methods).forEach((methodName) => { + if (methodName === '$') return; + methods.$.fn[methodName] = methods[methodName]; +}); + +export default methods.$; +// @Filename: /swipe-back.js +/*1*/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "$", + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "dom7", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "Dom7", + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./dom7", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImportFromJSXTag_test.go b/internal/fourslash/tests/gen/completionsImportFromJSXTag_test.go new file mode 100644 index 0000000000..c0488b300a --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImportFromJSXTag_test.go @@ -0,0 +1,45 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImportFromJSXTag(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @jsx: react +// @Filename: /types.d.ts +declare namespace JSX { + interface IntrinsicElements { a } +} +// @Filename: /Box.tsx +export function Box(props: any) { return null; } +// @Filename: /App.tsx +export function App() { + return ( +

+ + ) +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "Box", + Source: "./Box", + Description: "Add import from \"./Box\"", + NewFileContent: PtrTo(`import { Box } from "./Box"; + +export function App() { + return ( +
+ + ) +}`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImportModuleAugmentationWithJS_test.go b/internal/fourslash/tests/gen/completionsImportModuleAugmentationWithJS_test.go new file mode 100644 index 0000000000..39ec087d07 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImportModuleAugmentationWithJS_test.go @@ -0,0 +1,47 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImportModuleAugmentationWithJS(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @checkJs: true +// @noEmit: true +// @Filename: /test.js +class Abcde { + x +} + +module.exports = { + Abcde +}; +// @Filename: /index.ts +export {}; +declare module "./test" { + interface Abcde { b: string } +} + +Abcde/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "Abcde", + Source: "./test", + Description: "Add import from \"./test\"", + NewFileContent: PtrTo(`import { Abcde } from "./test"; + +export {}; +declare module "./test" { + interface Abcde { b: string } +} + +Abcde`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImportPathsConflict_test.go b/internal/fourslash/tests/gen/completionsImportPathsConflict_test.go new file mode 100644 index 0000000000..da67a8a511 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImportPathsConflict_test.go @@ -0,0 +1,68 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImportPathsConflict(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /tsconfig.json +{ + "compilerOptions": { + "module": "esnext", + "paths": { + "@reduxjs/toolkit": ["src/index.ts"], + "@internal/*": ["src/*"] + } + } +} +// @Filename: /src/index.ts +export { configureStore } from "./configureStore"; +// @Filename: /src/configureStore.ts +export function configureStore() {} +// @Filename: /src/tests/createAsyncThunk.typetest.ts +import {} from "@reduxjs/toolkit"; +/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "configureStore", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "@reduxjs/toolkit", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "configureStore", + Source: "@reduxjs/toolkit", + AutoImportData: &ls.AutoImportData{ + ExportName: "configureStore", + FileName: "/src/configureStore.ts", + ModuleSpecifier: "@reduxjs/toolkit", + }, + Description: "Update import from \"@reduxjs/toolkit\"", + NewFileContent: PtrTo(`import { configureStore } from "@reduxjs/toolkit"; +`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImportTypeKeyword_test.go b/internal/fourslash/tests/gen/completionsImportTypeKeyword_test.go new file mode 100644 index 0000000000..42b83f978e --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImportTypeKeyword_test.go @@ -0,0 +1,50 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImportTypeKeyword(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: node18 +// @Filename: /os.d.ts +declare module "os" { + export function type(): string; +} +// @Filename: /index.ts +type/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "type", + SortText: PtrTo(string(ls.SortTextGlobalsOrKeywords)), + }, + &lsproto.CompletionItem{ + Label: "type", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "os", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImportYieldExpression_test.go b/internal/fourslash/tests/gen/completionsImportYieldExpression_test.go new file mode 100644 index 0000000000..f0c76cee39 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImportYieldExpression_test.go @@ -0,0 +1,32 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImportYieldExpression(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /a.ts +export function a() {} +// @Filename: /b.ts +function *f() { + yield a/**/ +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "a", + Source: "./a", + Description: "Add import from \"./a\"", + NewFileContent: PtrTo(`import { a } from "./a"; + +function *f() { + yield a +}`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_46332_test.go b/internal/fourslash/tests/gen/completionsImport_46332_test.go new file mode 100644 index 0000000000..bee727e2cc --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_46332_test.go @@ -0,0 +1,101 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_46332(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: esnext +// @moduleResolution: bundler +// @Filename: /node_modules/vue/package.json +{ + "name": "vue", + "types": "dist/vue.d.ts" +} +// @Filename: /node_modules/vue/dist/vue.d.ts +export * from "@vue/runtime-dom" +// @Filename: /node_modules/@vue/runtime-dom/package.json +{ + "name": "@vue/runtime-dom", + "types": "dist/runtime-dom.d.ts" +} +// @Filename: /node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +export * from "@vue/runtime-core"; +export {} +declare module '@vue/reactivity' { + export interface RefUnwrapBailTypes { + runtimeDOMBailTypes: any + } +} +// @Filename: /node_modules/@vue/runtime-core/package.json +{ + "name": "@vue/runtime-core", + "types": "dist/runtime-core.d.ts" +} +// @Filename: /node_modules/@vue/runtime-core/dist/runtime-core.d.ts +import { ref } from '@vue/reactivity'; +export { ref }; +declare module '@vue/reactivity' { + export interface RefUnwrapBailTypes { + runtimeCoreBailTypes: any + } +} +// @Filename: /node_modules/@vue/reactivity/package.json +{ + "name": "@vue/reactivity", + "types": "dist/reactivity.d.ts" +} +// @Filename: /node_modules/@vue/reactivity/dist/reactivity.d.ts +export declare function ref(): T; +// @Filename: /package.json +{ + "dependencies": { + "vue": "*" + } +} +// @Filename: /index.ts +import {} from "vue"; +ref/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "ref", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "vue", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "ref", + Source: "vue", + Description: "Update import from \"vue\"", + AutoImportData: &ls.AutoImportData{ + ExportName: "ref", + FileName: "/node_modules/vue/dist/vue.d.ts", + }, + NewFileContent: PtrTo(`import { ref } from "vue"; +ref`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_ambient_test.go b/internal/fourslash/tests/gen/completionsImport_ambient_test.go new file mode 100644 index 0000000000..611fdb9572 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_ambient_test.go @@ -0,0 +1,76 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_ambient(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: commonjs +// @Filename: a.d.ts +declare namespace foo { class Bar {} } +declare module 'path1' { + import Bar = foo.Bar; + export default Bar; +} +declare module 'path2longer' { + import Bar = foo.Bar; + export {Bar}; +} + +// @Filename: b.ts +Ba/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + SortText: PtrTo(string(ls.SortTextGlobalsOrKeywords)), + }, + &lsproto.CompletionItem{ + Label: "Bar", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "path1", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "Bar", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "path2longer", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, false), + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "Bar", + Source: "path2longer", + Description: "Add import from \"path2longer\"", + NewFileContent: PtrTo(`import { Bar } from "path2longer"; + +Ba`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_augmentation_test.go b/internal/fourslash/tests/gen/completionsImport_augmentation_test.go new file mode 100644 index 0000000000..2c7cdce25b --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_augmentation_test.go @@ -0,0 +1,60 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_augmentation(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /a.ts +export const foo = 0; +// @Filename: /bar.ts +export {}; +declare module "./a" { + export const bar = 0; +} +// @Filename: /user.ts +/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Detail: PtrTo("const foo: 0"), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "bar", + Detail: PtrTo("const bar: 0"), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_compilerOptionsModule_test.go b/internal/fourslash/tests/gen/completionsImport_compilerOptionsModule_test.go new file mode 100644 index 0000000000..62a31af0ac --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_compilerOptionsModule_test.go @@ -0,0 +1,65 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_compilerOptionsModule(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @module: commonjs +// @Filename: /node_modules/a/index.d.ts +export const foo = 0; +// @Filename: /b.js +const a = require("./a"); +fo/*b*/ +// @Filename: /c.js +const x = 0;/*c*/ +// @Filename: /c1.js +// @ts-check +const x = 0;/*ccheck*/ +// @Filename: /c2.ts +const x = 0;/*cts*/ +// @Filename: /d.js +const a = import("./a"); // Does not make this an external module +fo/*d*/ +// @Filename: /d1.js +// @ts-check +const a = import("./a"); // Does not make this an external module +fo/*dcheck*/ +// @Filename: /d2.ts +const a = import("./a"); // Does not make this an external module +fo/*dts*/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, []string{"b", "c", "ccheck", "cts", "d", "dcheck", "dts"}, &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "a", + }, + })), + Detail: PtrTo("const foo: 0"), + Kind: PtrTo(lsproto.CompletionItemKindVariable), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_defaultAndNamedConflict_test.go b/internal/fourslash/tests/gen/completionsImport_defaultAndNamedConflict_test.go new file mode 100644 index 0000000000..f60bf9f376 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_defaultAndNamedConflict_test.go @@ -0,0 +1,72 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_defaultAndNamedConflict(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noLib: true +// @Filename: /someModule.ts +export const someModule = 0; +export default 1; +// @Filename: /index.ts +someMo/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "someModule", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./someModule", + }, + })), + Detail: PtrTo("(property) default: 1"), + Kind: PtrTo(lsproto.CompletionItemKindField), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "someModule", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./someModule", + }, + })), + Detail: PtrTo("const someModule: 0"), + Kind: PtrTo(lsproto.CompletionItemKindVariable), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, true), + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "someModule", + Source: "./someModule", + AutoImportData: &ls.AutoImportData{ + ExportName: "default", + FileName: "/someModule.ts", + }, + Description: "Add import from \"./someModule\"", + NewFileContent: PtrTo(`import someModule from "./someModule"; + +someMo`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_defaultFalsePositive_test.go b/internal/fourslash/tests/gen/completionsImport_defaultFalsePositive_test.go new file mode 100644 index 0000000000..38d4aef0f8 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_defaultFalsePositive_test.go @@ -0,0 +1,58 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_defaultFalsePositive(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /node_modules/foo/index.ts +export default function f(): void; +// @Filename: /node_modules/bar/concat.d.ts +export const concat = 0; +// @Filename: /a.ts +export {}; +conca/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToFile(t, "/a.ts") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "concat", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "bar/concat", + }, + })), + Detail: PtrTo("const concat: 0"), + Kind: PtrTo(lsproto.CompletionItemKindVariable), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "concat", + Source: "bar/concat", + Description: "Add import from \"bar/concat\"", + NewFileContent: PtrTo(`import { concat } from "bar/concat"; + +export {}; +conca`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_default_addToNamedImports_test.go b/internal/fourslash/tests/gen/completionsImport_default_addToNamedImports_test.go new file mode 100644 index 0000000000..d98caac868 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_default_addToNamedImports_test.go @@ -0,0 +1,54 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_default_addToNamedImports(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /a.ts +export default function foo() {} +export const x = 0; +// @Filename: /b.ts +import { x } from "./a"; +f/**/;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + Detail: PtrTo("function foo(): void"), + Kind: PtrTo(lsproto.CompletionItemKindFunction), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "foo", + Source: "./a", + Description: "Update import from \"./a\"", + NewFileContent: PtrTo(`import foo, { x } from "./a"; +f;`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_default_addToNamespaceImport_test.go b/internal/fourslash/tests/gen/completionsImport_default_addToNamespaceImport_test.go new file mode 100644 index 0000000000..23d8638a44 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_default_addToNamespaceImport_test.go @@ -0,0 +1,53 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_default_addToNamespaceImport(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /a.ts +export default function foo() {} +// @Filename: /b.ts +import * as a from "./a"; +f/**/;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + Detail: PtrTo("function foo(): void"), + Kind: PtrTo(lsproto.CompletionItemKindFunction), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "foo", + Source: "./a", + Description: "Update import from \"./a\"", + NewFileContent: PtrTo(`import foo, * as a from "./a"; +f;`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_default_alreadyExistedWithRename_test.go b/internal/fourslash/tests/gen/completionsImport_default_alreadyExistedWithRename_test.go new file mode 100644 index 0000000000..4ffdba061b --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_default_alreadyExistedWithRename_test.go @@ -0,0 +1,54 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_default_alreadyExistedWithRename(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /a.ts +export default function foo() {} +// @Filename: /b.ts +import f_o_o from "./a"; +f/**/;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + Detail: PtrTo("function foo(): void"), + Kind: PtrTo(lsproto.CompletionItemKindFunction), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "foo", + Source: "./a", + Description: "Add import from \"./a\"", + NewFileContent: PtrTo(`import foo from "./a"; +import f_o_o from "./a"; +f;`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_default_anonymous_test.go b/internal/fourslash/tests/gen/completionsImport_default_anonymous_test.go new file mode 100644 index 0000000000..fce12a0932 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_default_anonymous_test.go @@ -0,0 +1,69 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_default_anonymous(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: esnext +// @noLib: true +// @Filename: /src/foo-bar.ts +export default 0; +// @Filename: /src/b.ts +def/*0*/ +fooB/*1*/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "0") + f.VerifyCompletions(t, "0", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{}, true), + }, + }) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "fooBar", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "/src/foo-bar", + }, + })), + Detail: PtrTo("(property) default: 0"), + Kind: PtrTo(lsproto.CompletionItemKindField), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo("1"), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "fooBar", + Source: "/src/foo-bar", + Description: "Add import from \"./foo-bar\"", + NewFileContent: PtrTo(`import fooBar from "./foo-bar" + +def +fooB`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_default_didNotExistBefore_test.go b/internal/fourslash/tests/gen/completionsImport_default_didNotExistBefore_test.go new file mode 100644 index 0000000000..26576cab49 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_default_didNotExistBefore_test.go @@ -0,0 +1,54 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_default_didNotExistBefore(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: esnext +// @Filename: /a.ts +export default function foo() {} +// @Filename: /b.ts +f/**/;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "/a", + }, + })), + Detail: PtrTo("function foo(): void"), + Kind: PtrTo(lsproto.CompletionItemKindFunction), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "foo", + Source: "/a", + Description: "Add import from \"./a\"", + NewFileContent: PtrTo(`import foo from "./a"; + +f;`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_default_exportDefaultIdentifier_test.go b/internal/fourslash/tests/gen/completionsImport_default_exportDefaultIdentifier_test.go new file mode 100644 index 0000000000..ae41e12f86 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_default_exportDefaultIdentifier_test.go @@ -0,0 +1,56 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_default_exportDefaultIdentifier(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: esnext +// @Filename: /a.ts +const foo = 0; +export default foo; +// @Filename: /b.ts +f/**/;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "/a", + }, + })), + Detail: PtrTo("(alias) const foo: 0\nexport default foo"), + Kind: PtrTo(lsproto.CompletionItemKindVariable), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "foo", + Source: "/a", + Description: "Add import from \"./a\"", + NewFileContent: PtrTo(`import foo from "./a"; + +f;`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_default_fromMergedDeclarations_test.go b/internal/fourslash/tests/gen/completionsImport_default_fromMergedDeclarations_test.go new file mode 100644 index 0000000000..5123c8e3cd --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_default_fromMergedDeclarations_test.go @@ -0,0 +1,60 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_default_fromMergedDeclarations(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: esnext +// @Filename: /a.ts +declare module "m" { + export default class M {} +} +// @Filename: /b.ts +declare module "m" { + export default interface M {} +} +// @Filename: /c.ts +/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "M", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "m", + }, + })), + Detail: PtrTo("class M"), + Kind: PtrTo(lsproto.CompletionItemKindClass), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "M", + Source: "m", + Description: "Add import from \"m\"", + NewFileContent: PtrTo(`import M from "m"; + +`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_default_reExport_test.go b/internal/fourslash/tests/gen/completionsImport_default_reExport_test.go new file mode 100644 index 0000000000..52e55cdecb --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_default_reExport_test.go @@ -0,0 +1,64 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_default_reExport(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: commonjs +// @allowJs: true +// @Filename: /file1.js +const a = 1; +export { + a as b +}; +export default a; +// @Filename: /file2.js +import * as foo from './file1'; +/**/ +export default foo.b;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsInJSPlus( + []fourslash.CompletionsExpectedItem{ + "foo", + &lsproto.CompletionItem{ + Label: "a", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./file1", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "b", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./file1", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, false), + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_default_symbolName_test.go b/internal/fourslash/tests/gen/completionsImport_default_symbolName_test.go new file mode 100644 index 0000000000..bae20c6a6d --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_default_symbolName_test.go @@ -0,0 +1,62 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_default_symbolName(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: commonjs +// @esModuleInterop: false +// @allowSyntheticDefaultImports: false +// @Filename: /node_modules/@types/range-parser/index.d.ts +declare function RangeParser(): string; +declare namespace RangeParser { + interface Options { + combine?: boolean; + } +} +export = RangeParser; +// @Filename: /b.ts +R/*0*/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "0", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "RangeParser", + Kind: PtrTo(lsproto.CompletionItemKindFunction), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "range-parser", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + Detail: PtrTo("namespace RangeParser\nfunction RangeParser(): string"), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo("0"), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "RangeParser", + Source: "range-parser", + Description: "Add import from \"range-parser\"", + NewFileContent: PtrTo(`import RangeParser = require("range-parser"); + +R`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_details_withMisspelledName_test.go b/internal/fourslash/tests/gen/completionsImport_details_withMisspelledName_test.go new file mode 100644 index 0000000000..f0201764ec --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_details_withMisspelledName_test.go @@ -0,0 +1,46 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_details_withMisspelledName(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /a.ts +export const abc = 0; +// @Filename: /b.ts +acb/*1*/; +// @Filename: /c.ts +acb/*2*/;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "1") + f.VerifyApplyCodeActionFromCompletion(t, PtrTo("1"), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "abc", + Source: "./a", + Description: "Add import from \"./a\"", + NewFileContent: PtrTo(`import { abc } from "./a"; + +acb;`), + }) + f.GoToMarker(t, "2") + f.VerifyApplyCodeActionFromCompletion(t, PtrTo("2"), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "abc", + Source: "./a", + AutoImportData: &ls.AutoImportData{ + ExportName: "abc", + FileName: "/a.ts", + ModuleSpecifier: "./a", + }, + Description: "Add import from \"./a\"", + NewFileContent: PtrTo(`import { abc } from "./a"; + +acb;`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_duplicatePackages_scopedTypesAndNotTypes_test.go b/internal/fourslash/tests/gen/completionsImport_duplicatePackages_scopedTypesAndNotTypes_test.go new file mode 100644 index 0000000000..650cff95f6 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_duplicatePackages_scopedTypesAndNotTypes_test.go @@ -0,0 +1,74 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_duplicatePackages_scopedTypesAndNotTypes(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: commonjs +// @esModuleInterop: true +// @Filename: /node_modules/@types/scope__react-dom/package.json +{ "name": "react-dom", "version": "1.0.0", "types": "./index.d.ts" } +// @Filename: /node_modules/@types/scope__react-dom/index.d.ts +import * as React from "react"; +export function render(): void; +// @Filename: /node_modules/@types/scope__react/package.json +{ "name": "react", "version": "1.0.0", "types": "./index.d.ts" } +// @Filename: /node_modules/@types/scope__react/index.d.ts +import "./other"; +export declare function useState(): void; +// @Filename: /node_modules/@types/scope__react/other.d.ts +export declare function useRef(): void; +// @Filename: /packages/a/node_modules/@scope/react/package.json +{ "name": "react", "version": "1.0.1", "types": "./index.d.ts" } +// @Filename: /packages/a/node_modules/@scope/react/index.d.ts +export declare function useState(): void; +// @Filename: /packages/a/index.ts +import "react-dom"; +import "react"; +// @Filename: /packages/a/foo.ts +/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "render", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "@scope/react-dom", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "useState", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "@scope/react", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, false), + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_duplicatePackages_scopedTypes_test.go b/internal/fourslash/tests/gen/completionsImport_duplicatePackages_scopedTypes_test.go new file mode 100644 index 0000000000..ef1bbfc4b9 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_duplicatePackages_scopedTypes_test.go @@ -0,0 +1,74 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_duplicatePackages_scopedTypes(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: commonjs +// @esModuleInterop: true +// @Filename: /node_modules/@types/scope__react-dom/package.json +{ "name": "react-dom", "version": "1.0.0", "types": "./index.d.ts" } +// @Filename: /node_modules/@types/scope__react-dom/index.d.ts +import * as React from "react"; +export function render(): void; +// @Filename: /node_modules/@types/scope__react/package.json +{ "name": "react", "version": "1.0.0", "types": "./index.d.ts" } +// @Filename: /node_modules/@types/scope__react/index.d.ts +import "./other"; +export declare function useState(): void; +// @Filename: /node_modules/@types/scope__react/other.d.ts +export declare function useRef(): void; +// @Filename: /packages/a/node_modules/@types/scope__react/package.json +{ "name": "react", "version": "1.0.1", "types": "./index.d.ts" } +// @Filename: /packages/a/node_modules/@types/scope__react/index.d.ts +export declare function useState(): void; +// @Filename: /packages/a/index.ts +import "@scope/react-dom"; +import "@scope/react"; +// @Filename: /packages/a/foo.ts +/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "render", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "@scope/react-dom", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "useState", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "@scope/react", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, false), + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_duplicatePackages_scoped_test.go b/internal/fourslash/tests/gen/completionsImport_duplicatePackages_scoped_test.go new file mode 100644 index 0000000000..7bdc35017a --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_duplicatePackages_scoped_test.go @@ -0,0 +1,74 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_duplicatePackages_scoped(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: commonjs +// @esModuleInterop: true +// @Filename: /node_modules/@scope/react-dom/package.json +{ "name": "react-dom", "version": "1.0.0", "types": "./index.d.ts" } +// @Filename: /node_modules/@scope/react-dom/index.d.ts +import * as React from "react"; +export function render(): void; +// @Filename: /node_modules/@scope/react/package.json +{ "name": "react", "version": "1.0.0", "types": "./index.d.ts" } +// @Filename: /node_modules/@scope/react/index.d.ts +import "./other"; +export declare function useState(): void; +// @Filename: /node_modules/@scope/react/other.d.ts +export declare function useRef(): void; +// @Filename: /packages/a/node_modules/@scope/react/package.json +{ "name": "react", "version": "1.0.1", "types": "./index.d.ts" } +// @Filename: /packages/a/node_modules/@scope/react/index.d.ts +export declare function useState(): void; +// @Filename: /packages/a/index.ts +import "@scope/react-dom"; +import "@scope/react"; +// @Filename: /packages/a/foo.ts +/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "render", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "@scope/react-dom", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "useState", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "@scope/react", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, false), + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_duplicatePackages_typesAndNotTypes_test.go b/internal/fourslash/tests/gen/completionsImport_duplicatePackages_typesAndNotTypes_test.go new file mode 100644 index 0000000000..380ddb701d --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_duplicatePackages_typesAndNotTypes_test.go @@ -0,0 +1,64 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_duplicatePackages_typesAndNotTypes(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: commonjs +// @esModuleInterop: true +// @Filename: /node_modules/@types/react-dom/package.json +{ "name": "react-dom", "version": "1.0.0", "types": "./index.d.ts" } +// @Filename: /node_modules/@types/react-dom/index.d.ts +import * as React from "react"; +export function render(): void; +// @Filename: /node_modules/@types/react/package.json +{ "name": "react", "version": "1.0.0", "types": "./index.d.ts" } +// @Filename: /node_modules/@types/react/index.d.ts +import "./other"; +export declare function useState(): void; +// @Filename: /node_modules/@types/react/other.d.ts +export declare function useRef(): void; +// @Filename: /packages/a/node_modules/react/package.json +{ "name": "react", "version": "1.0.1", "types": "./index.d.ts" } +// @Filename: /packages/a/node_modules/react/index.d.ts +export declare function useState(): void; +// @Filename: /packages/a/index.ts +import "react-dom"; +import "react"; +// @Filename: /packages/a/foo.ts +useState/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "useState", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "react", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, false), + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_duplicatePackages_types_test.go b/internal/fourslash/tests/gen/completionsImport_duplicatePackages_types_test.go new file mode 100644 index 0000000000..6653f114ec --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_duplicatePackages_types_test.go @@ -0,0 +1,74 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_duplicatePackages_types(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: commonjs +// @esModuleInterop: true +// @Filename: /node_modules/@types/react-dom/package.json +{ "name": "react-dom", "version": "1.0.0", "types": "./index.d.ts" } +// @Filename: /node_modules/@types/react-dom/index.d.ts +import * as React from "react"; +export function render(): void; +// @Filename: /node_modules/@types/react/package.json +{ "name": "react", "version": "1.0.0", "types": "./index.d.ts" } +// @Filename: /node_modules/@types/react/index.d.ts +import "./other"; +export declare function useState(): void; +// @Filename: /node_modules/@types/react/other.d.ts +export declare function useRef(): void; +// @Filename: /packages/a/node_modules/@types/react/package.json +{ "name": "react", "version": "1.0.1", "types": "./index.d.ts" } +// @Filename: /packages/a/node_modules/@types/react/index.d.ts +export declare function useState(): void; +// @Filename: /packages/a/index.ts +import "react-dom"; +import "react"; +// @Filename: /packages/a/foo.ts +/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "render", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "react-dom", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "useState", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "react", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, false), + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_exportEqualsNamespace_noDuplicate_test.go b/internal/fourslash/tests/gen/completionsImport_exportEqualsNamespace_noDuplicate_test.go new file mode 100644 index 0000000000..df2677b55e --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_exportEqualsNamespace_noDuplicate_test.go @@ -0,0 +1,52 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_exportEqualsNamespace_noDuplicate(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /node_modules/a/index.d.ts +declare namespace core { + const foo: number; +} +declare module "a" { + export = core; +} +declare module "a/alias" { + export = core; +} +// @Filename: /user.ts +import * as a from "a"; +/**/foo;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "a", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_exportEquals_anonymous_test.go b/internal/fourslash/tests/gen/completionsImport_exportEquals_anonymous_test.go new file mode 100644 index 0000000000..f3b7805d04 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_exportEquals_anonymous_test.go @@ -0,0 +1,72 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_exportEquals_anonymous(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noLib: true +// @module: commonjs +// @esModuleInterop: false +// @allowSyntheticDefaultImports: false +// @Filename: /src/foo-bar.ts +export = 0; +// @Filename: /src/b.ts +exp/*0*/ +fooB/*1*/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "0") + f.VerifyCompletions(t, "0", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{}, true), + }, + }) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "fooBar", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./foo-bar", + }, + })), + Detail: PtrTo("(property) export=: 0"), + Kind: PtrTo(lsproto.CompletionItemKindField), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, true), + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo("0"), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "fooBar", + Source: "./foo-bar", + Description: "Add import from \"./foo-bar\"", + NewFileContent: PtrTo(`import fooBar = require("./foo-bar") + +exp +fooB`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_exportEquals_global_test.go b/internal/fourslash/tests/gen/completionsImport_exportEquals_global_test.go new file mode 100644 index 0000000000..9f4f618159 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_exportEquals_global_test.go @@ -0,0 +1,50 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_exportEquals_global(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: es6 +// @Filename: /console.d.ts + interface Console {} + declare var console: Console; + declare module "console" { + export = console; + } +// @Filename: /react-native.d.ts + import 'console'; + declare global { + interface Console {} + var console: Console; + } +// @Filename: /a.ts +conso/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "console", + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextGlobalsOrKeywords)), + }, + }, false), + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_exportEquals_test.go b/internal/fourslash/tests/gen/completionsImport_exportEquals_test.go new file mode 100644 index 0000000000..5a1ef9edd0 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_exportEquals_test.go @@ -0,0 +1,91 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_exportEquals(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: commonjs +// @esModuleInterop: false +// @allowSyntheticDefaultImports: false +// @Filename: /a.d.ts +declare function a(): void; +declare namespace a { + export interface b {} +} +export = a; +// @Filename: /b.ts +a/*0*/; +let x: b/*1*/;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "0", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "a", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "b", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo("1"), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "b", + Source: "./a", + Description: "Add import from \"./a\"", + NewFileContent: PtrTo(`import { b } from "./a"; + +a; +let x: b;`), + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo("0"), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "a", + Source: "./a", + Description: "Add import from \"./a\"", + NewFileContent: PtrTo(`import { b } from "./a"; +import a = require("./a"); + +a; +let x: b;`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_filteredByInvalidPackageJson_direct_test.go b/internal/fourslash/tests/gen/completionsImport_filteredByInvalidPackageJson_direct_test.go new file mode 100644 index 0000000000..7d7f135186 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_filteredByInvalidPackageJson_direct_test.go @@ -0,0 +1,73 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_filteredByInvalidPackageJson_direct(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `//@noEmit: true +//@Filename: /package.json +{ + "mod" + "dependencies": { + "react": "*" + } +} +//@Filename: /node_modules/react/index.d.ts +export declare var React: any; +//@Filename: /node_modules/react/package.json +{ + "name": "react", + "types": "./index.d.ts" +} +//@Filename: /node_modules/fake-react/index.d.ts +export declare var ReactFake: any; +//@Filename: /node_modules/fake-react/package.json +{ + "name": "fake-react", + "types": "./index.d.ts" +} +//@Filename: /src/index.ts +const x = Re/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "React", + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "react", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "ReactFake", + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "fake-react", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_@typesImplicit_test.go b/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_@typesImplicit_test.go new file mode 100644 index 0000000000..bd53aa7be8 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_@typesImplicit_test.go @@ -0,0 +1,63 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_filteredByPackageJson_typesImplicit(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `//@noEmit: true +//@Filename: /package.json +{ + "dependencies": { + "react": "*" + } +} +//@Filename: /node_modules/@types/react/index.d.ts +export declare var React: any; +//@Filename: /node_modules/@types/react/package.json +{ + "name": "@types/react" +} +//@Filename: /node_modules/@types/fake-react/index.d.ts +export declare var ReactFake: any; +//@Filename: /node_modules/@types/fake-react/package.json +{ + "name": "@types/fake-react" +} +//@Filename: /src/index.ts +const x = Re/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "React", + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "react", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + Excludes: []string{ + "ReactFake", + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_@typesOnly_test.go b/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_@typesOnly_test.go new file mode 100644 index 0000000000..27ccbf38d8 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_@typesOnly_test.go @@ -0,0 +1,63 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_filteredByPackageJson_typesOnly(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `//@noEmit: true +//@Filename: /package.json +{ + "devDependencies": { + "@types/react": "*" + } +} +//@Filename: /node_modules/@types/react/index.d.ts +export declare var React: any; +//@Filename: /node_modules/@types/react/package.json +{ + "name": "@types/react" +} +//@Filename: /node_modules/@types/fake-react/index.d.ts +export declare var ReactFake: any; +//@Filename: /node_modules/@types/fake-react/package.json +{ + "name": "@types/fake-react" +} +//@Filename: /src/index.ts +const x = Re/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "React", + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "react", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + Excludes: []string{ + "ReactFake", + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_ambient_test.go b/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_ambient_test.go new file mode 100644 index 0000000000..69fd73678f --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_ambient_test.go @@ -0,0 +1,153 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_filteredByPackageJson_ambient(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `//@noEmit: true +//@Filename: /package.json +{ + "dependencies": { + "react-syntax-highlighter": "*", + "declared-by-foo": "*" + } +} +//@Filename: /node_modules/@types/foo/index.d.ts +declare module "foo" { + export const foo: any; +} +declare module "declared-by-foo" { + export const declaredBySomethingNotInPackageJson: any; +} +//@Filename: /node_modules/@types/foo/package.json +{ + "name": "@types/node" +} +//@Filename: /node_modules/@types/react-syntax-highlighter/index.d.ts +declare module "react-syntax-highlighter/sub" { + const agate: any; + export default agate; +} +declare module "something-else" { + export const somethingElse: any; +} +//@Filename: /node_modules/@types/react-syntax-highlighter/package.json +{ + "name": "@types/react-syntax-highlighter" +} +//@Filename: /src/ambient.ts +declare module "local" { + export const local: any'; +} +//@Filename: /src/index.ts +fo/*1*/ +aga/*2*/ +somethi/*3*/ +declaredBy/*4*/ +loca/*5*/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobals, + }, + }) + f.VerifyCompletions(t, "2", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "agate", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "react-syntax-highlighter/sub", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyCompletions(t, "3", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "somethingElse", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "something-else", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyCompletions(t, "4", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "declaredBySomethingNotInPackageJson", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "declared-by-foo", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyCompletions(t, "5", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "local", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "local", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_direct_test.go b/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_direct_test.go new file mode 100644 index 0000000000..52dee82f49 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_direct_test.go @@ -0,0 +1,65 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_filteredByPackageJson_direct(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `//@noEmit: true +//@Filename: /package.json +{ + "dependencies": { + "react": "*" + } +} +//@Filename: /node_modules/react/index.d.ts +export declare var React: any; +//@Filename: /node_modules/react/package.json +{ + "name": "react", + "types": "./index.d.ts" +} +//@Filename: /node_modules/fake-react/index.d.ts +export declare var ReactFake: any; +//@Filename: /node_modules/fake-react/package.json +{ + "name": "fake-react", + "types": "./index.d.ts" +} +//@Filename: /src/index.ts +const x = Re/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "React", + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "react", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + Excludes: []string{ + "ReactFake", + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_nested_test.go b/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_nested_test.go new file mode 100644 index 0000000000..f2116414aa --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_nested_test.go @@ -0,0 +1,89 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_filteredByPackageJson_nested(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `//@noEmit: true +//@Filename: /package.json +{ + "dependencies": { + "react": "*" + } +} +//@Filename: /node_modules/react/index.d.ts +export declare var React: any; +//@Filename: /node_modules/react/package.json +{ + "name": "react", + "types": "./index.d.ts" +} +//@Filename: /dir/package.json +{ + "dependencies": { + "redux": "*" + } +} +//@Filename: /dir/node_modules/redux/package.json +{ + "name": "redux", + "types": "./index.d.ts" +} +//@Filename: /dir/node_modules/redux/index.d.ts +export declare var Redux: any; +//@Filename: /dir/index.ts +const x = Re/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "React", + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "react", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Redux", + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "redux", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_peerDependencies_test.go b/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_peerDependencies_test.go new file mode 100644 index 0000000000..8997b6e93a --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_filteredByPackageJson_peerDependencies_test.go @@ -0,0 +1,65 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_filteredByPackageJson_peerDependencies(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `//@noEmit: true +//@Filename: /package.json +{ + "peerDependencies": { + "react": "*" + } +} +//@Filename: /node_modules/react/index.d.ts +export declare var React: any; +//@Filename: /node_modules/react/package.json +{ + "name": "react", + "types": "./index.d.ts" +} +//@Filename: /node_modules/fake-react/index.d.ts +export declare var ReactFake: any; +//@Filename: /node_modules/fake-react/package.json +{ + "name": "fake-react", + "types": "./index.d.ts" +} +//@Filename: /src/index.ts +const x = Re/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "React", + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "react", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + Excludes: []string{ + "ReactFake", + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_fromAmbientModule_test.go b/internal/fourslash/tests/gen/completionsImport_fromAmbientModule_test.go new file mode 100644 index 0000000000..e070b3e47f --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_fromAmbientModule_test.go @@ -0,0 +1,31 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_fromAmbientModule(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: esnext +// @Filename: /a.ts +declare module "m" { + export const x: number; +} +// @Filename: /b.ts +/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "x", + Source: "m", + Description: "Add import from \"m\"", + NewFileContent: PtrTo(`import { x } from "m"; + +`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_importType_test.go b/internal/fourslash/tests/gen/completionsImport_importType_test.go new file mode 100644 index 0000000000..28c24d84d2 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_importType_test.go @@ -0,0 +1,83 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_importType(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @Filename: /a.js +export const x = 0; +export class C {} +/** @typedef {number} T */ +// @Filename: /b.js +export const m = 0; +/** @type {/*0*/} */ +/** @type {/*1*/} */` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, []string{"0", "1"}, &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "C", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + Detail: PtrTo("class C"), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "T", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + Detail: PtrTo("type T = number"), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + Excludes: []string{ + "x", + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo("0"), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "C", + Source: "./a", + Description: "Add import from \"./a\"", + NewFileContent: PtrTo(`import { C } from "./a"; + +export const m = 0; +/** @type {} */ +/** @type {} */`), + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo("1"), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "T", + Source: "./a", + Description: "Change 'T' to 'import(\"./a\").T'", + NewFileContent: PtrTo(`import { C } from "./a"; + +export const m = 0; +/** @type {} */ +/** @type {import("./a").} */`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_jsxOpeningTagImportDefault_test.go b/internal/fourslash/tests/gen/completionsImport_jsxOpeningTagImportDefault_test.go new file mode 100644 index 0000000000..1dc2706366 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_jsxOpeningTagImportDefault_test.go @@ -0,0 +1,61 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_jsxOpeningTagImportDefault(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: commonjs +// @jsx: react +// @Filename: /component.tsx +export default function (props: any) {} +// @Filename: /index.tsx +export function Index() { + return void; +declare const namedExport: () => void; + +export default defaultExport; +export { namedExport }; +// @Filename: /node_modules/example/dist/index.d.ts +export { default, namedExport } from "./nested/module"; +// @Filename: /index.mjs +import { namedExport } from "example"; +defaultExp/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsInJSPlus( + []fourslash.CompletionsExpectedItem{ + "namedExport", + &lsproto.CompletionItem{ + Label: "defaultExport", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "example", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, false), + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_reExportDefault_test.go b/internal/fourslash/tests/gen/completionsImport_reExportDefault_test.go new file mode 100644 index 0000000000..f6e4129652 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_reExportDefault_test.go @@ -0,0 +1,58 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_reExportDefault(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: esnext +// @moduleResolution: node10 +// @Filename: /a/b/impl.ts +export default function foo() {} +// @Filename: /a/index.ts +export { default as foo } from "./b/impl"; +// @Filename: /use.ts +fo/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "/a/b/impl", + }, + })), + Detail: PtrTo("function foo(): void"), + Kind: PtrTo(lsproto.CompletionItemKindFunction), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, false), + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "foo", + Source: "/a/b/impl", + Description: "Add import from \"./a\"", + NewFileContent: PtrTo(`import { foo } from "./a"; + +fo`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_reExport_wrongName_test.go b/internal/fourslash/tests/gen/completionsImport_reExport_wrongName_test.go new file mode 100644 index 0000000000..4651f917c1 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_reExport_wrongName_test.go @@ -0,0 +1,76 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_reExport_wrongName(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @moduleResolution: bundler +// @Filename: /a.ts +export const x = 0; +// @Filename: /index.ts +export { x as y } from "./a"; +// @Filename: /c.ts +/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "x", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + Detail: PtrTo("const x: 0"), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "y", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: ".", + }, + })), + Detail: PtrTo("(alias) const y: 0\nexport y"), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "x", + Source: "./a", + Description: "Add import from \"./a\"", + NewFileContent: PtrTo(`import { x } from "./a"; + +`), + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "y", + Source: ".", + Description: "Add import from \".\"", + NewFileContent: PtrTo(`import { y } from "."; +import { x } from "./a"; + +`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_reexportTransient_test.go b/internal/fourslash/tests/gen/completionsImport_reexportTransient_test.go new file mode 100644 index 0000000000..14e7c532c9 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_reexportTransient_test.go @@ -0,0 +1,51 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_reexportTransient(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @esModuleInterop: true +// @Filename: /transient.d.ts +declare const map: { [K in "one"]: number }; +export = map; +// @Filename: /r1.ts +export { one } from "./transient"; +// @Filename: /r2.ts +export { one } from "./r1"; +// @Filename: /index.ts +one/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "one", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./transient", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, false), + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_require_addNew_test.go b/internal/fourslash/tests/gen/completionsImport_require_addNew_test.go new file mode 100644 index 0000000000..5f38f4b5b1 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_require_addNew_test.go @@ -0,0 +1,54 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_require_addNew(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @Filename: /a.js +const x = 0; +module.exports = { x }; +// @Filename: /b.js +x/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "x", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + Detail: PtrTo("(alias) const x: 0\nimport x"), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "x", + Source: "./a", + Description: "Add import from \"./a\"", + NewFileContent: PtrTo(`const { x } = require("./a"); + +x`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_require_addToExisting_test.go b/internal/fourslash/tests/gen/completionsImport_require_addToExisting_test.go new file mode 100644 index 0000000000..e0ee34df82 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_require_addToExisting_test.go @@ -0,0 +1,57 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_require_addToExisting(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @Filename: /a.js +const x = 0; +function f() {} +module.exports = { x, f }; +// @Filename: /b.js +const { f } = require("./a"); + +x/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "x", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + Detail: PtrTo("(alias) const x: 0\nimport x"), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "x", + Source: "./a", + Description: "Update import from \"./a\"", + NewFileContent: PtrTo(`const { f, x } = require("./a"); + +x`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_require_test.go b/internal/fourslash/tests/gen/completionsImport_require_test.go new file mode 100644 index 0000000000..aab622f2ef --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_require_test.go @@ -0,0 +1,55 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_require(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @Filename: /a.ts +export const foo = 0; +// @Filename: /b.js +import * as s from "something"; +fo/*b*/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "b", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + Detail: PtrTo("const foo: 0"), + Kind: PtrTo(lsproto.CompletionItemKindVariable), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo("b"), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "foo", + Source: "./a", + Description: "Add import from \"./a\"", + NewFileContent: PtrTo(`import * as s from "something"; +import { foo } from "./a"; +fo`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_sortingModuleSpecifiers_test.go b/internal/fourslash/tests/gen/completionsImport_sortingModuleSpecifiers_test.go new file mode 100644 index 0000000000..625ab87cce --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_sortingModuleSpecifiers_test.go @@ -0,0 +1,74 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_sortingModuleSpecifiers(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: tsconfig.json +{ "compilerOptions": { "module": "commonjs" } } +// @Filename: path.d.ts +declare module "path/posix" { + export function normalize(p: string): string; +} +declare module "path/win32" { + export function normalize(p: string): string; +} +declare module "path" { + export function normalize(p: string): string; +} +// @Filename: main.ts +normalize/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "normalize", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "path", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "normalize", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "path/posix", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "normalize", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "path/win32", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, false), + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_tsx_test.go b/internal/fourslash/tests/gen/completionsImport_tsx_test.go new file mode 100644 index 0000000000..4f8e7c38b5 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_tsx_test.go @@ -0,0 +1,49 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_tsx(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noLib: true +// @jsx: preserve +// @Filename: /a.tsx +export type Bar = 0; +export default function Foo() {}; +// @Filename: /b.tsx +;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + Excludes: []string{ + "Bar", + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_typeOnly_test.go b/internal/fourslash/tests/gen/completionsImport_typeOnly_test.go new file mode 100644 index 0000000000..27d374d54e --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_typeOnly_test.go @@ -0,0 +1,32 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_typeOnly(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @target: esnext +// @moduleResolution: bundler +// @Filename: /a.ts +export class A {} +export class B {} +// @Filename: /b.ts +import type { A } from './a'; +const b: B/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToFile(t, "/b.ts") + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "B", + Source: "./a", + Description: "Update import from \"./a\"", + NewFileContent: PtrTo(`import type { A, B } from './a'; +const b: B`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_umdDefaultNoCrash1_test.go b/internal/fourslash/tests/gen/completionsImport_umdDefaultNoCrash1_test.go new file mode 100644 index 0000000000..f76355c039 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_umdDefaultNoCrash1_test.go @@ -0,0 +1,70 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_umdDefaultNoCrash1(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @moduleResolution: bundler +// @allowJs: true +// @checkJs: true +// @Filename: /node_modules/dottie/package.json +{ + "name": "dottie", + "main": "dottie.js" +} +// @Filename: /node_modules/dottie/dottie.js +(function (undefined) { + var root = this; + + var Dottie = function () {}; + + Dottie["default"] = function (object, path, value) {}; + + if (typeof module !== "undefined" && module.exports) { + exports = module.exports = Dottie; + } else { + root["Dottie"] = Dottie; + root["Dot"] = Dottie; + + if (typeof define === "function") { + define([], function () { + return Dottie; + }); + } + } +})(); +// @Filename: /src/index.js +/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Dottie", + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "dottie", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_umdModules1_globalAccess_test.go b/internal/fourslash/tests/gen/completionsImport_umdModules1_globalAccess_test.go new file mode 100644 index 0000000000..331af0b944 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_umdModules1_globalAccess_test.go @@ -0,0 +1,49 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_umdModules1_globalAccess(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @filename: /package.json +{ "dependencies": { "@types/classnames": "*" } } +// @filename: /tsconfig.json +{ "compilerOptions": { "allowUmdGlobalAccess": true } } +// @filename: /node_modules/@types/classnames/package.json +{ "name": "@types/classnames", "types": "index.d.ts" } +// @filename: /node_modules/@types/classnames/index.d.ts +declare const classNames: () => string; +export = classNames; +export as namespace classNames; +// @filename: /SomeReactComponent.tsx +import * as React from 'react'; + +const el1 =
foo
;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "1") + f.VerifyCompletions(t, nil, &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "classNames", + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextGlobalsOrKeywords)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_umdModules2_moduleExports_test.go b/internal/fourslash/tests/gen/completionsImport_umdModules2_moduleExports_test.go new file mode 100644 index 0000000000..a1dfd2d6d8 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_umdModules2_moduleExports_test.go @@ -0,0 +1,54 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_umdModules2_moduleExports(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @filename: /package.json +{ "dependencies": { "@types/classnames": "*" } } +// @filename: /tsconfig.json +{} +// @filename: /node_modules/@types/classnames/package.json +{ "name": "@types/classnames", "types": "index.d.ts" } +// @filename: /node_modules/@types/classnames/index.d.ts +declare const classNames: () => string; +export = classNames; +export as namespace classNames; +// @filename: /SomeReactComponent.tsx +import * as React from 'react'; + +const el1 =
foo
;` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "1") + f.VerifyCompletions(t, nil, &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "classNames", + AdditionalTextEdits: fourslash.AnyTextEdits, + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "classnames", + }, + })), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_umdModules3_script_test.go b/internal/fourslash/tests/gen/completionsImport_umdModules3_script_test.go new file mode 100644 index 0000000000..f3781b3757 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_umdModules3_script_test.go @@ -0,0 +1,48 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_umdModules3_script(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @filename: /package.json +{ "dependencies": { "@types/classnames": "*" } } +// @filename: /tsconfig.json +{ "compilerOptions": { "module": "es2015" }} +// @filename: /node_modules/@types/classnames/package.json +{ "name": "@types/classnames", "types": "index.d.ts" } +// @filename: /node_modules/@types/classnames/index.d.ts +declare const classNames: () => string; +export = classNames; +export as namespace classNames; +// @filename: /SomeReactComponent.tsx + +const el1 =
foo
` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "1") + f.VerifyCompletions(t, nil, &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "classNames", + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextGlobalsOrKeywords)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_uriStyleNodeCoreModules1_test.go b/internal/fourslash/tests/gen/completionsImport_uriStyleNodeCoreModules1_test.go new file mode 100644 index 0000000000..993593f4d2 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_uriStyleNodeCoreModules1_test.go @@ -0,0 +1,78 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_uriStyleNodeCoreModules1(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: commonjs +// @Filename: /node_modules/@types/node/index.d.ts +declare module "fs" { function writeFile(): void } +declare module "fs/promises" { function writeFile(): Promise } +declare module "node:fs" { export * from "fs"; } +declare module "node:fs/promises" { export * from "fs/promises"; } +// @Filename: /index.ts +write/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "writeFile", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "fs", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "writeFile", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "node:fs", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "writeFile", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "fs/promises", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "writeFile", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "node:fs/promises", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, false), + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_uriStyleNodeCoreModules2_test.go b/internal/fourslash/tests/gen/completionsImport_uriStyleNodeCoreModules2_test.go new file mode 100644 index 0000000000..5c295f65f2 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_uriStyleNodeCoreModules2_test.go @@ -0,0 +1,60 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_uriStyleNodeCoreModules2(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: commonjs +// @Filename: /node_modules/@types/node/index.d.ts +declare module "fs" { function writeFile(): void } +declare module "fs/promises" { function writeFile(): Promise } +declare module "node:fs" { export * from "fs"; } +declare module "node:fs/promises" { export * from "fs/promises"; } +// @Filename: /other.ts +import "node:fs/promises"; +// @Filename: /index.ts +write/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: CompletionGlobalsPlus( + []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "writeFile", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "node:fs", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "writeFile", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "node:fs/promises", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, false), + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_weirdDefaultSynthesis_test.go b/internal/fourslash/tests/gen/completionsImport_weirdDefaultSynthesis_test.go new file mode 100644 index 0000000000..5514308ba0 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_weirdDefaultSynthesis_test.go @@ -0,0 +1,34 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_weirdDefaultSynthesis(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: commonjs +// @esModuleInterop: false +// @allowSyntheticDefaultImports: false +// @Filename: /collection.ts +class Collection { + public static readonly default: typeof Collection = Collection; +} +export = Collection as typeof Collection & { default: typeof Collection }; +// @Filename: /index.ts +Colle/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "Collection", + Source: "./collection", + Description: "Add import from \"./collection\"", + NewFileContent: PtrTo(`import Collection = require("./collection"); + +Colle`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsImport_windowsPathsProjectRelative_test.go b/internal/fourslash/tests/gen/completionsImport_windowsPathsProjectRelative_test.go new file mode 100644 index 0000000000..8533cb5bea --- /dev/null +++ b/internal/fourslash/tests/gen/completionsImport_windowsPathsProjectRelative_test.go @@ -0,0 +1,131 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsImport_windowsPathsProjectRelative(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: c:/project/tsconfig.json +{ + "compilerOptions": { + "paths": { + "~/noIndex/*": ["./src/noIndex/*"], + "~/withIndex": ["./src/withIndex/index.ts"] + } + } +} +// @Filename: c:/project/package.json +{} +// @Filename: c:/project/src/noIndex/a.ts +export const myFunctionA = () => {}; +// @Filename: c:/project/src/withIndex/b.ts +export const myFunctionB = () => {}; +// @Filename: c:/project/src/withIndex/index.ts +export * from './b'; +// @Filename: c:/project/src/reproduction/1.ts +myFunction/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, nil, &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "myFunctionA", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "~/noIndex/a", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "myFunctionB", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "~/withIndex", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyCompletions(t, nil, &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "myFunctionA", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "../noIndex/a", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "myFunctionB", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "../withIndex", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyCompletions(t, nil, &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "myFunctionA", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "../noIndex/a", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + &lsproto.CompletionItem{ + Label: "myFunctionB", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "../withIndex", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsRecommended_namespace_test.go b/internal/fourslash/tests/gen/completionsRecommended_namespace_test.go new file mode 100644 index 0000000000..f81d6b2f98 --- /dev/null +++ b/internal/fourslash/tests/gen/completionsRecommended_namespace_test.go @@ -0,0 +1,92 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsRecommended_namespace(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noLib: true +// @Filename: /a.ts +export namespace Name { + export class C {} +} +export function f(c: Name.C) {} +f(new N/*a0*/); +f(new /*a1*/); +// @Filename: /b.ts +import { f } from "./a"; +f(new N/*b0*/); +f(new /*b1*/); +// @Filename: /c.ts +import * as alpha from "./a"; +alpha.f(new a/*c0*/); +alpha.f(new /*c1*/);` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, []string{"a0", "a1"}, &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Name", + Detail: PtrTo("namespace Name"), + Kind: PtrTo(lsproto.CompletionItemKindModule), + Preselect: PtrTo(true), + }, + }, + }, + }) + f.VerifyCompletions(t, []string{"b0", "b1"}, &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Name", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./a", + }, + })), + Detail: PtrTo("namespace Name"), + Kind: PtrTo(lsproto.CompletionItemKindModule), + AdditionalTextEdits: fourslash.AnyTextEdits, + Preselect: PtrTo(true), + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) + f.VerifyCompletions(t, []string{"c0", "c1"}, &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "alpha", + Detail: PtrTo("import alpha"), + Kind: PtrTo(lsproto.CompletionItemKindVariable), + Preselect: PtrTo(true), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/completionsUniqueSymbol_import_test.go b/internal/fourslash/tests/gen/completionsUniqueSymbol_import_test.go new file mode 100644 index 0000000000..acdd1674ab --- /dev/null +++ b/internal/fourslash/tests/gen/completionsUniqueSymbol_import_test.go @@ -0,0 +1,70 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsUniqueSymbol_import(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noLib: true +// @Filename: /globals.d.ts +declare const Symbol: () => symbol; +// @Filename: /a.ts +const privateSym = Symbol(); +export const publicSym = Symbol(); +export interface I { + [privateSym]: number; + [publicSym]: number; + [defaultPublicSym]: number; + n: number; +} +export const i: I; +// @Filename: /user.ts +import { i } from "./a"; +i[|./**/|];` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: []fourslash.CompletionsExpectedItem{ + "n", + &lsproto.CompletionItem{ + Label: "publicSym", + InsertText: PtrTo("[publicSym]"), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "/a", + }, + })), + SortText: PtrTo(string(ls.SortTextGlobalsOrKeywords)), + AdditionalTextEdits: fourslash.AnyTextEdits, + TextEdit: &lsproto.TextEditOrInsertReplaceEdit{ + TextEdit: &lsproto.TextEdit{ + NewText: "publicSym", + Range: f.Ranges()[0].LSRange, + }, + }, + }, + }, + }, + }) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "publicSym", + Source: "/a", + Description: "Update import from \"./a\"", + NewFileContent: PtrTo(`import { i, publicSym } from "./a"; +i.;`), + }) +} diff --git a/internal/fourslash/tests/gen/completionsWithDeprecatedTag10_test.go b/internal/fourslash/tests/gen/completionsWithDeprecatedTag10_test.go new file mode 100644 index 0000000000..104b77761c --- /dev/null +++ b/internal/fourslash/tests/gen/completionsWithDeprecatedTag10_test.go @@ -0,0 +1,45 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestCompletionsWithDeprecatedTag10(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /foo.ts +/** @deprecated foo */ +export const foo = 0; +// @Filename: /index.ts +/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "foo", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./foo", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + Kind: PtrTo(lsproto.CompletionItemKindVariable), + SortText: PtrTo(string(ls.DeprecateSortText(ls.SortTextAutoImportSuggestions))), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/importNameCodeFixDefaultExport6_test.go b/internal/fourslash/tests/gen/importNameCodeFixDefaultExport6_test.go new file mode 100644 index 0000000000..43b6d1076a --- /dev/null +++ b/internal/fourslash/tests/gen/importNameCodeFixDefaultExport6_test.go @@ -0,0 +1,28 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestImportNameCodeFixDefaultExport6(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /a.ts +export default Math.foo; +// @Filename: /index.ts +a/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "a", + Source: "./a", + Description: "Add import from \"./a\"", + NewFileContent: PtrTo(`import a from "./a"; + +a`), + }) +} diff --git a/internal/fourslash/tests/gen/importNameCodeFixExportAsDefault_test.go b/internal/fourslash/tests/gen/importNameCodeFixExportAsDefault_test.go new file mode 100644 index 0000000000..d5b712b078 --- /dev/null +++ b/internal/fourslash/tests/gen/importNameCodeFixExportAsDefault_test.go @@ -0,0 +1,29 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestImportNameCodeFixExportAsDefault(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /foo.ts +const foo = 'foo' +export { foo as default } +// @Filename: /index.ts + foo/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyApplyCodeActionFromCompletion(t, PtrTo(""), &fourslash.ApplyCodeActionFromCompletionOptions{ + Name: "foo", + Source: "./foo", + Description: "Add import from \"./foo\"", + NewFileContent: PtrTo(`import foo from "./foo"; + +foo`), + }) +} diff --git a/internal/fourslash/tests/gen/importSuggestionsCache_exportUndefined_test.go b/internal/fourslash/tests/gen/importSuggestionsCache_exportUndefined_test.go new file mode 100644 index 0000000000..33022ac27d --- /dev/null +++ b/internal/fourslash/tests/gen/importSuggestionsCache_exportUndefined_test.go @@ -0,0 +1,70 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestImportSuggestionsCache_exportUndefined(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /home/src/workspaces/project/tsconfig.json +{ "compilerOptions": { "module": "esnext" } } +// @Filename: /home/src/workspaces/project/undefined.ts +export = undefined; +// @Filename: /home/src/workspaces/project/undefinedAlias.ts +const x = undefined; +export = x; +// @Filename: /home/src/workspaces/project/index.ts + /**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, nil, &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "x", + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "/home/src/workspaces/project/undefinedAlias", + }, + })), + }, + }, + }, + }) + f.VerifyCompletions(t, nil, &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "x", + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "/home/src/workspaces/project/undefinedAlias", + }, + })), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/importSuggestionsCache_invalidPackageJson_test.go b/internal/fourslash/tests/gen/importSuggestionsCache_invalidPackageJson_test.go new file mode 100644 index 0000000000..7ca5b026fc --- /dev/null +++ b/internal/fourslash/tests/gen/importSuggestionsCache_invalidPackageJson_test.go @@ -0,0 +1,58 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestImportSuggestionsCache_invalidPackageJson(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: /home/src/workspaces/project/jsconfig.json +{ + "compilerOptions": { + "module": "commonjs", + }, +} +// @Filename: /home/src/workspaces/project/node_modules/@types/node/index.d.ts +declare module 'fs' { + export function readFile(): void; +} +declare module 'util' { + export function promisify(): void; +} +// @Filename: /home/src/workspaces/project/package.json +{ "mod" } +// @Filename: /home/src/workspaces/project/a.js + +readF/**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "") + f.VerifyCompletions(t, nil, &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "readFile", + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "fs", + }, + })), + AdditionalTextEdits: fourslash.AnyTextEdits, + SortText: PtrTo(string(ls.SortTextAutoImportSuggestions)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/importTypeCompletions1_test.go b/internal/fourslash/tests/gen/importTypeCompletions1_test.go new file mode 100644 index 0000000000..3e586eb516 --- /dev/null +++ b/internal/fourslash/tests/gen/importTypeCompletions1_test.go @@ -0,0 +1,50 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestImportTypeCompletions1(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @target: esnext +// @filename: /foo.ts +export interface Foo {} +// @filename: /bar.ts +[|import type F/**/|]` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToFile(t, "/bar.ts") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + InsertText: PtrTo("import type { Foo } from \"./foo\";"), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./foo", + }, + })), + TextEdit: &lsproto.TextEditOrInsertReplaceEdit{ + TextEdit: &lsproto.TextEdit{ + NewText: "Foo", + Range: f.Ranges()[0].LSRange, + }, + }, + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/importTypeCompletions3_test.go b/internal/fourslash/tests/gen/importTypeCompletions3_test.go new file mode 100644 index 0000000000..64d207be07 --- /dev/null +++ b/internal/fourslash/tests/gen/importTypeCompletions3_test.go @@ -0,0 +1,50 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestImportTypeCompletions3(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @target: esnext +// @filename: /foo.ts +export interface Foo {} +// @filename: /bar.ts +[|import type { F/**/ }|]` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToFile(t, "/bar.ts") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + InsertText: PtrTo("import type { Foo } from \"./foo\";"), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./foo", + }, + })), + TextEdit: &lsproto.TextEditOrInsertReplaceEdit{ + TextEdit: &lsproto.TextEdit{ + NewText: "Foo", + Range: f.Ranges()[0].LSRange, + }, + }, + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/importTypeCompletions4_test.go b/internal/fourslash/tests/gen/importTypeCompletions4_test.go new file mode 100644 index 0000000000..ba2465a5e1 --- /dev/null +++ b/internal/fourslash/tests/gen/importTypeCompletions4_test.go @@ -0,0 +1,51 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestImportTypeCompletions4(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @esModuleInterop: true +// @Filename: /foo.ts +interface Foo { }; +export = Foo; +// @Filename: /bar.ts + [|import type f/**/|]` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToFile(t, "/bar.ts") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + InsertText: PtrTo("import type Foo from \"./foo\";"), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./foo", + }, + })), + TextEdit: &lsproto.TextEditOrInsertReplaceEdit{ + TextEdit: &lsproto.TextEdit{ + NewText: "Foo", + Range: f.Ranges()[0].LSRange, + }, + }, + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/importTypeCompletions5_test.go b/internal/fourslash/tests/gen/importTypeCompletions5_test.go new file mode 100644 index 0000000000..543d69aa3f --- /dev/null +++ b/internal/fourslash/tests/gen/importTypeCompletions5_test.go @@ -0,0 +1,52 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestImportTypeCompletions5(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowSyntheticDefaultImports: false +// @esModuleInterop: false +// @Filename: /foo.ts +interface Foo { }; +export = Foo; +// @Filename: /bar.ts + [|import type f/**/|]` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToFile(t, "/bar.ts") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + InsertText: PtrTo("import type Foo = require(\"./foo\");"), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./foo", + }, + })), + TextEdit: &lsproto.TextEditOrInsertReplaceEdit{ + TextEdit: &lsproto.TextEdit{ + NewText: "Foo", + Range: f.Ranges()[0].LSRange, + }, + }, + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/importTypeCompletions6_test.go b/internal/fourslash/tests/gen/importTypeCompletions6_test.go new file mode 100644 index 0000000000..49d825be38 --- /dev/null +++ b/internal/fourslash/tests/gen/importTypeCompletions6_test.go @@ -0,0 +1,51 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestImportTypeCompletions6(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @module: esnext +// @Filename: /foo.ts +export const foo = { }; +export interface Foo { }; +// @Filename: /bar.ts + [|import type * as f/**/|]` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToFile(t, "/bar.ts") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + InsertText: PtrTo("import type { Foo } from \"./foo\";"), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./foo", + }, + })), + TextEdit: &lsproto.TextEditOrInsertReplaceEdit{ + TextEdit: &lsproto.TextEdit{ + NewText: "Foo", + Range: f.Ranges()[0].LSRange, + }, + }, + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/importTypeCompletions7_test.go b/internal/fourslash/tests/gen/importTypeCompletions7_test.go new file mode 100644 index 0000000000..e927da63ff --- /dev/null +++ b/internal/fourslash/tests/gen/importTypeCompletions7_test.go @@ -0,0 +1,56 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestImportTypeCompletions7(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @target: es2020 +// @module: esnext +// @Filename: /foo.d.ts +declare namespace Foo {} +export = Foo; +// @Filename: /test.ts +[|import F/**/|]` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToFile(t, "/test.ts") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + InsertText: PtrTo("import * as Foo from \"./foo\";"), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./foo", + }, + })), + TextEdit: &lsproto.TextEditOrInsertReplaceEdit{ + TextEdit: &lsproto.TextEdit{ + NewText: "Foo", + Range: f.Ranges()[0].LSRange, + }, + }, + }, + &lsproto.CompletionItem{ + Label: "type", + SortText: PtrTo(string(ls.SortTextGlobalsOrKeywords)), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/importTypeCompletions8_test.go b/internal/fourslash/tests/gen/importTypeCompletions8_test.go new file mode 100644 index 0000000000..024b38ff05 --- /dev/null +++ b/internal/fourslash/tests/gen/importTypeCompletions8_test.go @@ -0,0 +1,50 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestImportTypeCompletions8(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @target: esnext +// @filename: /foo.ts +export interface Foo {} +// @filename: /bar.ts +[|import { type F/**/ }|]` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToFile(t, "/bar.ts") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + InsertText: PtrTo("import { type Foo } from \"./foo\";"), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./foo", + }, + })), + TextEdit: &lsproto.TextEditOrInsertReplaceEdit{ + TextEdit: &lsproto.TextEdit{ + NewText: "Foo", + Range: f.Ranges()[0].LSRange, + }, + }, + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/importTypeCompletions9_test.go b/internal/fourslash/tests/gen/importTypeCompletions9_test.go new file mode 100644 index 0000000000..d6460a2e54 --- /dev/null +++ b/internal/fourslash/tests/gen/importTypeCompletions9_test.go @@ -0,0 +1,50 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestImportTypeCompletions9(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @target: esnext +// @filename: /foo.ts +export interface Foo {} +// @filename: /bar.ts +[|import { type /**/ }|]` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToFile(t, "/bar.ts") + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + InsertText: PtrTo("import { type Foo } from \"./foo\";"), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./foo", + }, + })), + TextEdit: &lsproto.TextEditOrInsertReplaceEdit{ + TextEdit: &lsproto.TextEdit{ + NewText: "Foo", + Range: f.Ranges()[0].LSRange, + }, + }, + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/jsFileImportNoTypes2_test.go b/internal/fourslash/tests/gen/jsFileImportNoTypes2_test.go new file mode 100644 index 0000000000..84c2d97611 --- /dev/null +++ b/internal/fourslash/tests/gen/jsFileImportNoTypes2_test.go @@ -0,0 +1,84 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/ls" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsFileImportNoTypes2(t *testing.T) { + t.Parallel() + t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @Filename: /default.ts +export default class TestDefaultClass {} +// @Filename: /defaultType.ts +export default interface TestDefaultInterface {} +// @Filename: /reExport/toReExport.ts +export class TestClassReExport {} +export interface TestInterfaceReExport {} +// @Filename: /reExport/index.ts +export { TestClassReExport, TestInterfaceReExport } from './toReExport'; +// @Filename: /exportList.ts +class TestClassExportList {}; +interface TestInterfaceExportList {}; +export { TestClassExportList, TestInterfaceExportList }; +// @Filename: /baseline.ts +export class TestClassBaseline {} +export interface TestInterfaceBaseline {} +// @Filename: /a.js +import /**/` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &[]string{}, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Exact: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "TestClassBaseline", + InsertText: PtrTo("import { TestClassBaseline } from \"./baseline\";"), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./baseline", + }, + })), + }, + &lsproto.CompletionItem{ + Label: "TestClassExportList", + InsertText: PtrTo("import { TestClassExportList } from \"./exportList\";"), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./exportList", + }, + })), + }, + &lsproto.CompletionItem{ + Label: "TestClassReExport", + InsertText: PtrTo("import { TestClassReExport } from \"./reExport\";"), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./reExport", + }, + })), + }, + &lsproto.CompletionItem{ + Label: "TestDefaultClass", + InsertText: PtrTo("import TestDefaultClass from \"./default\";"), + Data: PtrTo(any(&ls.CompletionItemData{ + AutoImport: &ls.AutoImportData{ + ModuleSpecifier: "./default", + }, + })), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/jsxTagNameCompletionClosed_test.go b/internal/fourslash/tests/gen/jsxTagNameCompletionClosed_test.go new file mode 100644 index 0000000000..9358ac1196 --- /dev/null +++ b/internal/fourslash/tests/gen/jsxTagNameCompletionClosed_test.go @@ -0,0 +1,145 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsxTagNameCompletionClosed(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `//@Filename: file.tsx +interface NestedInterface { + Foo: NestedInterface; + (props: {}): any; +} + +declare const Foo: NestedInterface; + +function fn1() { + return + + +} +function fn2() { + return + + +} +function fn3() { + return + + +} +function fn4() { + return + + +} +function fn5() { + return + + +} +function fn6() { + return + + +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + Detail: PtrTo("const Foo: NestedInterface"), + }, + }, + }, + }) + f.VerifyCompletions(t, "2", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + Detail: PtrTo("const Foo: NestedInterface"), + }, + }, + }, + }) + f.VerifyCompletions(t, "3", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + Detail: PtrTo("(property) NestedInterface.Foo: NestedInterface"), + }, + }, + }, + }) + f.VerifyCompletions(t, "4", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + Detail: PtrTo("(property) NestedInterface.Foo: NestedInterface"), + }, + }, + }, + }) + f.VerifyCompletions(t, "5", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + Detail: PtrTo("(property) NestedInterface.Foo: NestedInterface"), + }, + }, + }, + }) + f.VerifyCompletions(t, "6", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + Detail: PtrTo("(property) NestedInterface.Foo: NestedInterface"), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/jsxTagNameCompletionUnclosed_test.go b/internal/fourslash/tests/gen/jsxTagNameCompletionUnclosed_test.go new file mode 100644 index 0000000000..78ab4a048d --- /dev/null +++ b/internal/fourslash/tests/gen/jsxTagNameCompletionUnclosed_test.go @@ -0,0 +1,145 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsxTagNameCompletionUnclosed(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `//@Filename: file.tsx +interface NestedInterface { + Foo: NestedInterface; + (props: {}): any; +} + +declare const Foo: NestedInterface; + +function fn1() { + return + +} +function fn2() { + return + +} +function fn3() { + return + +} +function fn4() { + return + +} +function fn5() { + return + +} +function fn6() { + return + +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + Detail: PtrTo("const Foo: NestedInterface"), + }, + }, + }, + }) + f.VerifyCompletions(t, "2", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + Detail: PtrTo("const Foo: NestedInterface"), + }, + }, + }, + }) + f.VerifyCompletions(t, "3", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + Detail: PtrTo("(property) NestedInterface.Foo: NestedInterface"), + }, + }, + }, + }) + f.VerifyCompletions(t, "4", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + Detail: PtrTo("(property) NestedInterface.Foo: NestedInterface"), + }, + }, + }, + }) + f.VerifyCompletions(t, "5", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + Detail: PtrTo("(property) NestedInterface.Foo: NestedInterface"), + }, + }, + }, + }) + f.VerifyCompletions(t, "6", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "Foo", + Detail: PtrTo("(property) NestedInterface.Foo: NestedInterface"), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/jsxTagNameCompletionUnderElementClosed_test.go b/internal/fourslash/tests/gen/jsxTagNameCompletionUnderElementClosed_test.go new file mode 100644 index 0000000000..8e509858f3 --- /dev/null +++ b/internal/fourslash/tests/gen/jsxTagNameCompletionUnderElementClosed_test.go @@ -0,0 +1,84 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsxTagNameCompletionUnderElementClosed(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `//@Filename: file.tsx +declare namespace JSX { + interface IntrinsicElements { + button: any; + div: any; + } +} +function fn() { + return <> + + ; +} +function fn2() { + return <> + preceding junk + ; +} +function fn3() { + return <> + + ; +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "button", + Detail: PtrTo("(property) JSX.IntrinsicElements.button: any"), + }, + }, + }, + }) + f.VerifyCompletions(t, "2", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "button", + Detail: PtrTo("(property) JSX.IntrinsicElements.button: any"), + }, + }, + }, + }) + f.VerifyCompletions(t, "3", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "button", + Detail: PtrTo("(property) JSX.IntrinsicElements.button: any"), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/jsxTagNameCompletionUnderElementUnclosed_test.go b/internal/fourslash/tests/gen/jsxTagNameCompletionUnderElementUnclosed_test.go new file mode 100644 index 0000000000..568c195177 --- /dev/null +++ b/internal/fourslash/tests/gen/jsxTagNameCompletionUnderElementUnclosed_test.go @@ -0,0 +1,84 @@ +package fourslash_test + +import ( + "testing" + + "github.com/microsoft/typescript-go/internal/fourslash" + . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" + "github.com/microsoft/typescript-go/internal/lsp/lsproto" + "github.com/microsoft/typescript-go/internal/testutil" +) + +func TestJsxTagNameCompletionUnderElementUnclosed(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `//@Filename: file.tsx +declare namespace JSX { + interface IntrinsicElements { + button: any; + div: any; + } +} +function fn() { + return <> + ; +} +function fn2() { + return <> + preceding junk ; +} +function fn3() { + return <> + ; +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "button", + Detail: PtrTo("(property) JSX.IntrinsicElements.button: any"), + }, + }, + }, + }) + f.VerifyCompletions(t, "2", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "button", + Detail: PtrTo("(property) JSX.IntrinsicElements.button: any"), + }, + }, + }, + }) + f.VerifyCompletions(t, "3", &fourslash.CompletionsExpectedList{ + IsIncomplete: false, + ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ + CommitCharacters: &DefaultCommitCharacters, + EditRange: Ignored, + }, + Items: &fourslash.CompletionsExpectedItems{ + Includes: []fourslash.CompletionsExpectedItem{ + &lsproto.CompletionItem{ + Label: "button", + Detail: PtrTo("(property) JSX.IntrinsicElements.button: any"), + }, + }, + }, + }) +} diff --git a/internal/fourslash/tests/gen/quickInfoOnNarrowedType_test.go b/internal/fourslash/tests/gen/quickInfoOnNarrowedType_test.go index f917e01054..203d4dc986 100644 --- a/internal/fourslash/tests/gen/quickInfoOnNarrowedType_test.go +++ b/internal/fourslash/tests/gen/quickInfoOnNarrowedType_test.go @@ -11,7 +11,7 @@ import ( func TestQuickInfoOnNarrowedType(t *testing.T) { t.Parallel() - t.Skip() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `// @strictNullChecks: true function foo(strOrNum: string | number) { diff --git a/internal/ls/autoimportfixes.go b/internal/ls/autoimportfixes.go index 4aa8104bb1..0fb1864455 100644 --- a/internal/ls/autoimportfixes.go +++ b/internal/ls/autoimportfixes.go @@ -1,10 +1,13 @@ package ls import ( + "slices" + "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/astnav" "github.com/microsoft/typescript-go/internal/core" "github.com/microsoft/typescript-go/internal/debug" + "github.com/microsoft/typescript-go/internal/stringutil" ) type Import struct { @@ -81,8 +84,7 @@ func (ct *changeTracker) doAddExistingFix( } if len(namedImports) > 0 { - // !!! OrganizeImports not yet implemented - // specifierComparer, isSorted := OrganizeImports.getNamedImportSpecifierComparerWithDetection(importClause.Parent, preferences, sourceFile); + specifierComparer, isSorted := getNamedImportSpecifierComparerWithDetection(importClause.Parent, preferences, sourceFile) newSpecifiers := core.Map(namedImports, func(namedImport *Import) *ast.Node { var identifier *ast.Node if namedImport.propertyName != "" { @@ -93,7 +95,8 @@ func (ct *changeTracker) doAddExistingFix( identifier, ct.NodeFactory.NewIdentifier(namedImport.name), ) - }) // !!! sort with specifierComparer + }) + slices.SortFunc(newSpecifiers, specifierComparer) // !!! remove imports not implemented // if (removeExistingImportSpecifiers) { @@ -108,30 +111,41 @@ func (ct *changeTracker) doAddExistingFix( // append(core.Filter(existingSpecifiers, func (s *ast.ImportSpecifier) bool {return !removeExistingImportSpecifiers.Has(s)}), newSpecifiers...), // !!! sort with specifierComparer // ), // ); - // } else if (len(existingSpecifiers) > 0 && isSorted != false) { - // !!! OrganizeImports not implemented - // The sorting preference computed earlier may or may not have validated that these particular - // import specifiers are sorted. If they aren't, `getImportSpecifierInsertionIndex` will return - // nonsense. So if there are existing specifiers, even if we know the sorting preference, we - // need to ensure that the existing specifiers are sorted according to the preference in order - // to do a sorted insertion. - // changed to check if existing specifiers are sorted - // if we're promoting the clause from type-only, we need to transform the existing imports before attempting to insert the new named imports - // transformedExistingSpecifiers := existingSpecifiers - // if promoteFromTypeOnly && existingSpecifiers { - // transformedExistingSpecifiers = ct.NodeFactory.updateNamedImports( - // importClause.NamedBindings.AsNamedImports(), - // core.SameMap(existingSpecifiers, func(e *ast.ImportSpecifier) *ast.ImportSpecifier { - // return ct.NodeFactory.updateImportSpecifier(e, /*isTypeOnly*/ true, e.propertyName, e.name) - // }), - // ).elements - // } - // for _, spec := range newSpecifiers { - // insertionIndex := OrganizeImports.getImportSpecifierInsertionIndex(transformedExistingSpecifiers, spec, specifierComparer); - // ct.insertImportSpecifierAtIndex(sourceFile, spec, importClause.namedBindings as NamedImports, insertionIndex); - // } - // } else - if len(existingSpecifiers) > 0 { + // + if len(existingSpecifiers) > 0 && isSorted != core.TSFalse { + // The sorting preference computed earlier may or may not have validated that these particular + // import specifiers are sorted. If they aren't, `getImportSpecifierInsertionIndex` will return + // nonsense. So if there are existing specifiers, even if we know the sorting preference, we + // need to ensure that the existing specifiers are sorted according to the preference in order + // to do a sorted insertion. + // if we're promoting the clause from type-only, we need to transform the existing imports before attempting to insert the new named imports + // transformedExistingSpecifiers := existingSpecifiers + // if promoteFromTypeOnly && existingSpecifiers { + // transformedExistingSpecifiers = ct.NodeFactory.updateNamedImports( + // importClause.NamedBindings.AsNamedImports(), + // core.SameMap(existingSpecifiers, func(e *ast.ImportSpecifier) *ast.ImportSpecifier { + // return ct.NodeFactory.updateImportSpecifier(e, /*isTypeOnly*/ true, e.propertyName, e.name) + // }), + // ).elements + // } + for _, spec := range newSpecifiers { + insertionIndex := getImportSpecifierInsertionIndex(existingSpecifiers, spec, specifierComparer) + ct.insertImportSpecifierAtIndex(sourceFile, spec, importClause.NamedBindings, insertionIndex) + } + } else if len(existingSpecifiers) > 0 && isSorted.IsTrue() { + // Existing specifiers are sorted, so insert each new specifier at the correct position + for _, spec := range newSpecifiers { + insertionIndex := getImportSpecifierInsertionIndex(existingSpecifiers, spec, specifierComparer) + if insertionIndex >= len(existingSpecifiers) { + // Insert at the end + ct.insertNodeInListAfter(sourceFile, existingSpecifiers[len(existingSpecifiers)-1], spec.AsNode(), existingSpecifiers) + } else { + // Insert before the element at insertionIndex + ct.insertNodeInListAfter(sourceFile, existingSpecifiers[insertionIndex], spec.AsNode(), existingSpecifiers) + } + } + } else if len(existingSpecifiers) > 0 { + // Existing specifiers may not be sorted, append to the end for _, spec := range newSpecifiers { ct.insertNodeInListAfter(sourceFile, existingSpecifiers[len(existingSpecifiers)-1], spec.AsNode(), existingSpecifiers) } @@ -202,10 +216,11 @@ func (ct *changeTracker) insertImports(sourceFile *ast.SourceFile, imports []*as } else { existingImportStatements = core.Filter(sourceFile.Statements.Nodes, ast.IsAnyImportSyntax) } - // !!! OrganizeImports - // { comparer, isSorted } := OrganizeImports.getOrganizeImportsStringComparerWithDetection(existingImportStatements, preferences); - // sortedNewImports := isArray(imports) ? toSorted(imports, (a, b) => OrganizeImports.compareImportsOrRequireStatements(a, b, comparer)) : [imports]; - sortedNewImports := imports + comparer, isSorted := getOrganizeImportsStringComparerWithDetection(existingImportStatements, preferences) + sortedNewImports := slices.Clone(imports) + slices.SortFunc(sortedNewImports, func(a, b *ast.Statement) int { + return compareImportsOrRequireStatements(a, b, comparer) + }) // !!! FutureSourceFile // if !isFullSourceFile(sourceFile) { // for _, newImport := range sortedNewImports { @@ -216,22 +231,21 @@ func (ct *changeTracker) insertImports(sourceFile *ast.SourceFile, imports []*as // return; // } - // if len(existingImportStatements) > 0 && isSorted { - // for _, newImport := range sortedNewImports { - // insertionIndex := OrganizeImports.getImportDeclarationInsertionIndex(existingImportStatements, newImport, comparer) - // if insertionIndex == 0 { - // // If the first import is top-of-file, insert after the leading comment which is likely the header. - // options := existingImportStatements[0] == sourceFile.statements[0] ? { leadingTriviaOption: textchanges.LeadingTriviaOption.Exclude } : {}; - // ct.insertNodeBefore(sourceFile, existingImportStatements[0], newImport, /*blankLineBetween*/ false, options); - // } else { - // prevImport := existingImportStatements[insertionIndex - 1] - // ct.insertNodeAfter(sourceFile, prevImport, newImport); - // } - // } - // return - // } - - if len(existingImportStatements) > 0 { + if len(existingImportStatements) > 0 && isSorted { + // Existing imports are sorted, insert each new import at the correct position + for _, newImport := range sortedNewImports { + insertionIndex := getImportDeclarationInsertIndex(existingImportStatements, newImport, func(a, b *ast.Statement) stringutil.Comparison { + return compareImportsOrRequireStatements(a, b, comparer) + }) + if insertionIndex == 0 { + // If the first import is top-of-file, insert after the leading comment which is likely the header + ct.insertNodeAt(sourceFile, core.TextPos(astnav.GetStartOfNode(existingImportStatements[0], sourceFile, false)), newImport.AsNode(), changeNodeOptions{}) + } else { + prevImport := existingImportStatements[insertionIndex-1] + ct.insertNodeAfter(sourceFile, prevImport.AsNode(), newImport.AsNode()) + } + } + } else if len(existingImportStatements) > 0 { ct.insertNodesAfter(sourceFile, existingImportStatements[len(existingImportStatements)-1], sortedNewImports) } else { ct.insertAtTopOfFile(sourceFile, sortedNewImports, blankLineBetween) diff --git a/internal/ls/autoimports.go b/internal/ls/autoimports.go index cf89e08fab..2a20436d0c 100644 --- a/internal/ls/autoimports.go +++ b/internal/ls/autoimports.go @@ -17,6 +17,7 @@ import ( "github.com/microsoft/typescript-go/internal/lsp/lsproto" "github.com/microsoft/typescript-go/internal/module" "github.com/microsoft/typescript-go/internal/modulespecifiers" + "github.com/microsoft/typescript-go/internal/packagejson" "github.com/microsoft/typescript-go/internal/stringutil" "github.com/microsoft/typescript-go/internal/tspath" ) @@ -69,7 +70,7 @@ type CachedSymbolExportInfo struct { } type exportInfoMap struct { - exportInfo collections.MultiMap[ExportInfoMapKey, CachedSymbolExportInfo] + exportInfo collections.OrderedMap[ExportInfoMapKey, []*CachedSymbolExportInfo] symbols map[int]symbolExportEntry exportInfoId int usableByFileName tspath.Path @@ -83,7 +84,7 @@ type exportInfoMap struct { func (e *exportInfoMap) clear() { e.symbols = map[int]symbolExportEntry{} - e.exportInfo = collections.MultiMap[ExportInfoMapKey, CachedSymbolExportInfo]{} + e.exportInfo = collections.OrderedMap[ExportInfoMapKey, []*CachedSymbolExportInfo]{} e.usableByFileName = "" } @@ -91,7 +92,7 @@ func (e *exportInfoMap) get(importingFile tspath.Path, ch *checker.Checker, key if e.usableByFileName != importingFile { return nil } - return core.Map(e.exportInfo.Get(key), func(info CachedSymbolExportInfo) *SymbolExportInfo { return e.rehydrateCachedInfo(ch, info) }) + return core.Map(e.exportInfo.GetOrZero(key), func(info *CachedSymbolExportInfo) *SymbolExportInfo { return e.rehydrateCachedInfo(ch, info) }) } func (e *exportInfoMap) add( @@ -164,7 +165,8 @@ func (e *exportInfoMap) add( } moduleName := stringutil.StripQuotes(moduleSymbol.Name) - id := e.exportInfoId + 1 + e.exportInfoId++ + id := e.exportInfoId target := ch.SkipAlias(symbol) if flagMatch != nil && !flagMatch(target.Flags) { @@ -193,7 +195,9 @@ func (e *exportInfoMap) add( if moduleFile != nil { moduleFileName = moduleFile.FileName() } - e.exportInfo.Add(newExportInfoMapKey(symbolName, symbol, moduleKey, ch), CachedSymbolExportInfo{ + key := newExportInfoMapKey(symbolName, symbol, moduleKey, ch) + infos := e.exportInfo.GetOrZero(key) + infos = append(infos, &CachedSymbolExportInfo{ id: id, symbolTableKey: symbolTableKey, symbolName: symbolName, @@ -209,6 +213,7 @@ func (e *exportInfoMap) add( targetFlags: target.Flags, isFromPackageJson: isFromPackageJson, }) + e.exportInfo.Set(key, infos) } func (e *exportInfoMap) search( @@ -221,13 +226,13 @@ func (e *exportInfoMap) search( if importingFile != e.usableByFileName { return nil } - for key, info := range e.exportInfo.M { + for key, info := range e.exportInfo.Entries() { symbolName, ambientModuleName := key.SymbolName, key.AmbientModuleName if preferCapitalized && info[0].capitalizedSymbolName != "" { symbolName = info[0].capitalizedSymbolName } if matches(symbolName, info[0].targetFlags) { - rehydrated := core.Map(info, func(info CachedSymbolExportInfo) *SymbolExportInfo { + rehydrated := core.Map(info, func(info *CachedSymbolExportInfo) *SymbolExportInfo { return e.rehydrateCachedInfo(ch, info) }) filtered := core.FilterIndex(rehydrated, func(r *SymbolExportInfo, i int, _ []*SymbolExportInfo) bool { @@ -254,7 +259,7 @@ func (e *exportInfoMap) isNotShadowedByDeeperNodeModulesPackage(info *SymbolExpo return !ok || strings.HasPrefix(info.moduleFileName, packageDeepestNodeModulesPath) } -func (e *exportInfoMap) rehydrateCachedInfo(ch *checker.Checker, info CachedSymbolExportInfo) *SymbolExportInfo { +func (e *exportInfoMap) rehydrateCachedInfo(ch *checker.Checker, info *CachedSymbolExportInfo) *SymbolExportInfo { if info.symbol != nil && info.moduleSymbol != nil { return &SymbolExportInfo{ symbol: info.symbol, @@ -340,32 +345,6 @@ type packageJsonFilterResult struct { importable bool packageName string } -type projectPackageJsonInfo struct { - fileName string - parseable bool - dependencies map[string]string - devDependencies map[string]string - peerDependencies map[string]string - optionalDependencies map[string]string -} - -func (info *projectPackageJsonInfo) has(dependencyName string) bool { - if _, ok := info.dependencies[dependencyName]; ok { - return true - } - if _, ok := info.devDependencies[dependencyName]; ok { - return true - } - - if _, ok := info.peerDependencies[dependencyName]; ok { - return true - } - if _, ok := info.optionalDependencies[dependencyName]; ok { - return true - } - - return false -} func (l *LanguageService) getImportCompletionAction( ctx context.Context, @@ -400,7 +379,7 @@ func NewExportInfoMap(globalsTypingCacheLocation string) *exportInfoMap { return &exportInfoMap{ packages: map[string]string{}, symbols: map[int]symbolExportEntry{}, - exportInfo: collections.MultiMap[ExportInfoMapKey, CachedSymbolExportInfo]{}, + exportInfo: collections.OrderedMap[ExportInfoMapKey, []*CachedSymbolExportInfo]{}, globalTypingsCacheLocation: globalsTypingCacheLocation, } } @@ -653,10 +632,23 @@ func (l *LanguageService) getImportFixes( } func (l *LanguageService) createPackageJsonImportFilter(fromFile *ast.SourceFile, preferences UserPreferences) *packageJsonImportFilter { - packageJsons := []*projectPackageJsonInfo{} - // packageJsons := ( - // (host.getPackageJsonsVisibleToFile && host.getPackageJsonsVisibleToFile(fromFile.fileName)) || getPackageJsonsVisibleToFile(fromFile.fileName, host) - // ).filter(p => p.parseable); + // !!! The program package.json cache may not have every relevant package.json. + // This should eventually be integrated with the session. + var packageJsons []*packagejson.PackageJson + dir := tspath.GetDirectoryPath(fromFile.FileName()) + for { + packageJsonDir := l.GetProgram().GetNearestAncestorDirectoryWithPackageJson(dir) + if packageJsonDir == "" { + break + } + if packageJson := l.GetProgram().GetPackageJsonInfo(tspath.CombinePaths(packageJsonDir, "package.json")).GetContents(); packageJson != nil && packageJson.Parseable { + packageJsons = append(packageJsons, packageJson) + } + dir = tspath.GetDirectoryPath(packageJsonDir) + if dir == packageJsonDir { + break + } + } var usesNodeCoreModules *bool ambientModuleCache := map[*ast.Symbol]bool{} @@ -674,7 +666,7 @@ func (l *LanguageService) createPackageJsonImportFilter(fromFile *ast.SourceFile moduleSpecifierIsCoveredByPackageJson := func(specifier string) bool { packageName := getNodeModuleRootSpecifier(specifier) for _, packageJson := range packageJsons { - if packageJson.has(packageName) || packageJson.has(module.GetTypesPackageName(packageName)) { + if packageJson.HasDependency(packageName) || packageJson.HasDependency(module.GetTypesPackageName(packageName)) { return true } } @@ -721,7 +713,7 @@ func (l *LanguageService) createPackageJsonImportFilter(fromFile *ast.SourceFile } allowsImportingAmbientModule := func(moduleSymbol *ast.Symbol, moduleSpecifierResolutionHost modulespecifiers.ModuleSpecifierGenerationHost) bool { - if len(packageJsons) > 0 || moduleSymbol.ValueDeclaration == nil { + if len(packageJsons) == 0 || moduleSymbol.ValueDeclaration == nil { return true } @@ -1442,8 +1434,7 @@ func (l *LanguageService) codeActionForFixWorker( } if fix.useRequire { - // !!! require - // declarations = getNewRequires(fixAddNew.moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport, l.GetProgram().Options(), preferences) + declarations = changeTracker.getNewRequires(fix.moduleSpecifier, defaultImport, namedImports, namespaceLikeImport, l.GetProgram().Options(), preferences) } else { declarations = changeTracker.getNewImports(fix.moduleSpecifier, defaultImport, namedImports, namespaceLikeImport, l.GetProgram().Options(), preferences) } @@ -1474,6 +1465,88 @@ func (l *LanguageService) codeActionForFixWorker( return nil } +func (c *changeTracker) getNewRequires( + moduleSpecifier string, + defaultImport *Import, + namedImports []*Import, + namespaceLikeImport *Import, + compilerOptions *core.CompilerOptions, + preferences *UserPreferences, +) []*ast.Statement { + quotedModuleSpecifier := c.NodeFactory.NewStringLiteral(moduleSpecifier) + var statements []*ast.Statement + + // const { default: foo, bar, etc } = require('./mod'); + if defaultImport != nil || len(namedImports) > 0 { + bindingElements := []*ast.Node{} + for _, namedImport := range namedImports { + var propertyName *ast.Node + if namedImport.propertyName != "" { + propertyName = c.NodeFactory.NewIdentifier(namedImport.propertyName) + } + bindingElements = append(bindingElements, c.NodeFactory.NewBindingElement( + /*dotDotDotToken*/ nil, + propertyName, + c.NodeFactory.NewIdentifier(namedImport.name), + /*initializer*/ nil, + )) + } + if defaultImport != nil { + bindingElements = append([]*ast.Node{ + c.NodeFactory.NewBindingElement( + /*dotDotDotToken*/ nil, + c.NodeFactory.NewIdentifier("default"), + c.NodeFactory.NewIdentifier(defaultImport.name), + /*initializer*/ nil, + ), + }, bindingElements...) + } + declaration := c.createConstEqualsRequireDeclaration( + c.NodeFactory.NewBindingPattern( + ast.KindObjectBindingPattern, + c.NodeFactory.NewNodeList(bindingElements), + ), + quotedModuleSpecifier, + ) + statements = append(statements, declaration) + } + + // const foo = require('./mod'); + if namespaceLikeImport != nil { + declaration := c.createConstEqualsRequireDeclaration( + c.NodeFactory.NewIdentifier(namespaceLikeImport.name), + quotedModuleSpecifier, + ) + statements = append(statements, declaration) + } + + debug.AssertIsDefined(statements) + return statements +} + +func (c *changeTracker) createConstEqualsRequireDeclaration(name *ast.Node, quotedModuleSpecifier *ast.Node) *ast.Statement { + return c.NodeFactory.NewVariableStatement( + /*modifiers*/ nil, + c.NodeFactory.NewVariableDeclarationList( + ast.NodeFlagsConst, + c.NodeFactory.NewNodeList([]*ast.Node{ + c.NodeFactory.NewVariableDeclaration( + name, + /*exclamationToken*/ nil, + /*type*/ nil, + c.NodeFactory.NewCallExpression( + c.NodeFactory.NewIdentifier("require"), + /*questionDotToken*/ nil, + /*typeArguments*/ nil, + c.NodeFactory.NewNodeList([]*ast.Node{quotedModuleSpecifier}), + ast.NodeFlagsNone, + ), + ), + }), + ), + ) +} + func getModuleSpecifierText(promotedDeclaration *ast.ImportDeclaration) string { if promotedDeclaration.Kind == ast.KindImportEqualsDeclaration { importEqualsDeclaration := promotedDeclaration.AsImportEqualsDeclaration() diff --git a/internal/ls/autoimportsexportinfo.go b/internal/ls/autoimportsexportinfo.go index 65de5e82ad..a68767e964 100644 --- a/internal/ls/autoimportsexportinfo.go +++ b/internal/ls/autoimportsexportinfo.go @@ -8,6 +8,7 @@ import ( "github.com/microsoft/typescript-go/internal/collections" "github.com/microsoft/typescript-go/internal/core" "github.com/microsoft/typescript-go/internal/scanner" + "github.com/microsoft/typescript-go/internal/stringutil" ) func (l *LanguageService) getExportInfos( @@ -31,7 +32,7 @@ func (l *LanguageService) getExportInfos( if moduleCount = moduleCount + 1; moduleCount%100 == 0 && ctx.Err() != nil { return } - if moduleFile == nil && moduleSymbol.Name != exportMapKey.AmbientModuleName { + if moduleFile == nil && stringutil.StripQuotes(moduleSymbol.Name) != exportMapKey.AmbientModuleName { return } seenExports := collections.Set[string]{} diff --git a/internal/ls/changetracker.go b/internal/ls/changetracker.go index 34397aa546..db7cfb3fec 100644 --- a/internal/ls/changetracker.go +++ b/internal/ls/changetracker.go @@ -165,6 +165,10 @@ func (ct *changeTracker) insertNodesAfter(sourceFile *ast.SourceFile, after *ast ct.insertNodesAt(sourceFile, endPosition, newNodes, ct.getInsertNodeAfterOptions(sourceFile, after)) } +func (ct *changeTracker) insertNodeBefore(sourceFile *ast.SourceFile, before *ast.Node, newNode *ast.Node, blankLineBetween bool) { + ct.insertNodeAt(sourceFile, core.TextPos(ct.getAdjustedStartPosition(sourceFile, before, leadingTriviaOptionNone, false)), newNode, ct.getOptionsForInsertNodeBefore(before, newNode, blankLineBetween)) +} + func (ct *changeTracker) endPosForInsertNodeAfter(sourceFile *ast.SourceFile, after *ast.Node, newNode *ast.Node) core.TextPos { if (needSemicolonBetween(after, newNode)) && (rune(sourceFile.Text()[after.End()-1]) != ';') { // check if previous statement ends with semicolon @@ -213,10 +217,10 @@ func (ct *changeTracker) insertNodeInListAfter(sourceFile *ast.SourceFile, after // ###b, // c, nextNode := containingList[index+1] - startPos := scanner.SkipTriviaEx(sourceFile.Text(), nextNode.Pos(), &scanner.SkipTriviaOptions{StopAfterLineBreak: true, StopAtComments: false}) + startPos := scanner.SkipTriviaEx(sourceFile.Text(), nextNode.Pos(), &scanner.SkipTriviaOptions{StopAfterLineBreak: false, StopAtComments: true}) // write separator and leading trivia of the next element as suffix - suffix := scanner.TokenToString(nextToken.Kind) + sourceFile.Text()[nextNode.End():startPos] + suffix := scanner.TokenToString(nextToken.Kind) + sourceFile.Text()[nextToken.End():startPos] ct.insertNodeAt(sourceFile, core.TextPos(startPos), newNode, changeNodeOptions{suffix: suffix}) } return @@ -278,6 +282,21 @@ func (ct *changeTracker) insertNodeInListAfter(sourceFile *ast.SourceFile, after ) } +// insertImportSpecifierAtIndex inserts a new import specifier at the specified index in a NamedImports list +func (ct *changeTracker) insertImportSpecifierAtIndex(sourceFile *ast.SourceFile, newSpecifier *ast.Node, namedImports *ast.Node, index int) { + namedImportsNode := namedImports.AsNamedImports() + elements := namedImportsNode.Elements.Nodes + + if index > 0 && len(elements) > index { + ct.insertNodeInListAfter(sourceFile, elements[index-1], newSpecifier, elements) + } else { + // Insert before the first element + firstElement := elements[0] + multiline := printer.GetLinesBetweenPositions(sourceFile, firstElement.Pos(), namedImports.Parent.Parent.Pos()) != 0 + ct.insertNodeBefore(sourceFile, firstElement, newSpecifier, multiline) + } +} + func (ct *changeTracker) insertAtTopOfFile(sourceFile *ast.SourceFile, insert []*ast.Statement, blankLineBetween bool) { if len(insert) == 0 { return @@ -288,7 +307,7 @@ func (ct *changeTracker) insertAtTopOfFile(sourceFile *ast.SourceFile, insert [] if pos != 0 { options.prefix = ct.newLine } - if !stringutil.IsLineBreak(rune(sourceFile.Text()[pos])) { + if len(sourceFile.Text()) == 0 || !stringutil.IsLineBreak(rune(sourceFile.Text()[pos])) { options.suffix = ct.newLine } if blankLineBetween { @@ -334,3 +353,32 @@ func (ct *changeTracker) getInsertNodeAfterOptions(sourceFile *ast.SourceFile, n return options } + +func (ct *changeTracker) getOptionsForInsertNodeBefore(before *ast.Node, inserted *ast.Node, blankLineBetween bool) changeNodeOptions { + if ast.IsStatement(before) || ast.IsClassOrTypeElement(before) { + if blankLineBetween { + return changeNodeOptions{suffix: ct.newLine + ct.newLine} + } + return changeNodeOptions{suffix: ct.newLine} + } else if before.Kind == ast.KindVariableDeclaration { + // insert `x = 1, ` into `const x = 1, y = 2; + return changeNodeOptions{suffix: ", "} + } else if before.Kind == ast.KindParameter { + if inserted.Kind == ast.KindParameter { + return changeNodeOptions{suffix: ", "} + } + return changeNodeOptions{} + } else if (before.Kind == ast.KindStringLiteral && before.Parent != nil && before.Parent.Kind == ast.KindImportDeclaration) || before.Kind == ast.KindNamedImports { + return changeNodeOptions{suffix: ", "} + } else if before.Kind == ast.KindImportSpecifier { + suffix := "," + if blankLineBetween { + suffix += ct.newLine + } else { + suffix += " " + } + return changeNodeOptions{suffix: suffix} + } + // We haven't handled this kind of node yet -- add it + panic("unimplemented node type " + before.Kind.String() + " in changeTracker.getOptionsForInsertNodeBefore") +} diff --git a/internal/ls/changetrackerimpl.go b/internal/ls/changetrackerimpl.go index e8f3d13e69..b36c1ea982 100644 --- a/internal/ls/changetrackerimpl.go +++ b/internal/ls/changetrackerimpl.go @@ -84,7 +84,7 @@ func (ct *changeTracker) computeNewText(change *trackerEdit, targetSourceFile *a if !(change.options.indentation != nil && *change.options.indentation != 0 || format.GetLineStartPositionForPosition(pos, targetSourceFile) == pos) { noIndent = strings.TrimLeftFunc(text, unicode.IsSpace) } - return change.options.prefix + noIndent // !!! +((!options.suffix || endsWith(noIndent, options.suffix)) ? "" : options.suffix); + return change.options.prefix + noIndent + core.IfElse(strings.HasSuffix(noIndent, change.options.suffix), "", change.options.suffix) } /** Note: this may mutate `nodeIn`. */ @@ -121,7 +121,6 @@ func getFormatCodeSettingsForWriting(options *format.FormatCodeSettings, sourceF return options } -/** Note: output node may be mutated input node. */ func (ct *changeTracker) getNonformattedText(node *ast.Node, sourceFile *ast.SourceFile) (string, *ast.Node) { nodeIn := node eofToken := ct.Factory.NewToken(ast.KindEndOfFile) @@ -146,6 +145,7 @@ func (ct *changeTracker) getNonformattedText(node *ast.Node, sourceFile *ast.Sou ).Write(nodeIn, sourceFile, writer, nil) text := writer.String() + text = strings.TrimSuffix(text, ct.newLine) // Newline artifact from printing a SourceFile instead of a node nodeOut := writer.AssignPositionsToNode(nodeIn, ct.NodeFactory) var sourceFileLike *ast.Node diff --git a/internal/ls/completions.go b/internal/ls/completions.go index 95934780dc..65db54b937 100644 --- a/internal/ls/completions.go +++ b/internal/ls/completions.go @@ -63,7 +63,7 @@ func ensureItemData(fileName string, pos int, list *lsproto.CompletionList) *lsp } for _, item := range list.Items { if item.Data == nil { - var data any = &itemData{ + var data any = &CompletionItemData{ FileName: fileName, Position: pos, Name: item.Label, @@ -87,7 +87,7 @@ type completionDataData struct { location *ast.Node keywordFilters KeywordCompletionFilters literals []literalValue - symbolToOriginInfoMap map[ast.SymbolId]*symbolOriginInfo + symbolToOriginInfoMap map[int]*symbolOriginInfo symbolToSortTextMap map[ast.SymbolId]sortText recommendedCompletion *ast.Symbol previousToken *ast.Node @@ -246,7 +246,7 @@ func (origin *symbolOriginInfo) moduleSymbol() *ast.Symbol { } } -func (origin *symbolOriginInfo) toCompletionEntryData() *completionEntryData { +func (origin *symbolOriginInfo) toCompletionEntryData() *AutoImportData { debug.Assert(origin.kind&symbolOriginInfoKindExport != 0, fmt.Sprintf("completionEntryData is not generated for symbolOriginInfo of type %T", origin.data)) var ambientModuleName *string if origin.fileName == "" { @@ -258,12 +258,12 @@ func (origin *symbolOriginInfo) toCompletionEntryData() *completionEntryData { } data := origin.data.(*symbolOriginInfoExport) - return &completionEntryData{ + return &AutoImportData{ ExportName: data.exportName, ExportMapKey: data.exportMapKey, ModuleSpecifier: data.moduleSpecifier, AmbientModuleName: ambientModuleName, - FileName: strPtrTo(origin.fileName), + FileName: origin.fileName, IsPackageJsonImport: isPackageJsonImport, } } @@ -711,7 +711,8 @@ func (l *LanguageService) getCompletionData( hasUnresolvedAutoImports := false // This also gets mutated in nested-functions after the return var symbols []*ast.Symbol - symbolToOriginInfoMap := map[ast.SymbolId]*symbolOriginInfo{} + // Keys are indexes of `symbols`. + symbolToOriginInfoMap := map[int]*symbolOriginInfo{} symbolToSortTextMap := map[ast.SymbolId]sortText{} var seenPropertySymbols collections.Set[ast.SymbolId] importSpecifierResolver := &importSpecifierResolverForCompletions{SourceFile: file, UserPreferences: preferences, l: l} @@ -725,9 +726,9 @@ func (l *LanguageService) getCompletionData( addSymbolOriginInfo := func(symbol *ast.Symbol, insertQuestionDot bool, insertAwait bool) { symbolId := ast.GetSymbolId(symbol) if insertAwait && seenPropertySymbols.AddIfAbsent(symbolId) { - symbolToOriginInfoMap[symbolId] = &symbolOriginInfo{kind: getNullableSymbolOriginInfoKind(symbolOriginInfoKindPromise, insertQuestionDot)} + symbolToOriginInfoMap[len(symbols)-1] = &symbolOriginInfo{kind: getNullableSymbolOriginInfoKind(symbolOriginInfoKindPromise, insertQuestionDot)} } else if insertQuestionDot { - symbolToOriginInfoMap[symbolId] = &symbolOriginInfo{kind: symbolOriginInfoKindNullable} + symbolToOriginInfoMap[len(symbols)-1] = &symbolOriginInfo{kind: symbolOriginInfoKindNullable} } } @@ -772,7 +773,7 @@ func (l *LanguageService) getCompletionData( if moduleSymbol == nil || !checker.IsExternalModuleSymbol(moduleSymbol) || typeChecker.TryGetMemberInModuleExportsAndProperties(firstAccessibleSymbol.Name, moduleSymbol) != firstAccessibleSymbol { - symbolToOriginInfoMap[firstAccessibleSymbolId] = &symbolOriginInfo{kind: getNullableSymbolOriginInfoKind(symbolOriginInfoKindSymbolMemberNoExport, insertQuestionDot)} + symbolToOriginInfoMap[len(symbols)-1] = &symbolOriginInfo{kind: getNullableSymbolOriginInfoKind(symbolOriginInfoKindSymbolMemberNoExport, insertQuestionDot)} } else { var fileName string if tspath.IsExternalModuleNameRelative(stringutil.StripQuotes(moduleSymbol.Name)) { @@ -793,7 +794,7 @@ func (l *LanguageService) getCompletionData( ) if result != nil { - symbolToOriginInfoMap[ast.GetSymbolId(symbol)] = &symbolOriginInfo{ + symbolToOriginInfoMap[len(symbols)-1] = &symbolOriginInfo{ kind: getNullableSymbolOriginInfoKind(symbolOriginInfoKindSymbolMemberExport, insertQuestionDot), isDefaultExport: false, fileName: fileName, @@ -1262,7 +1263,7 @@ func (l *LanguageService) getCompletionData( moduleSpecifier: moduleSpecifier, }, } - symbolToOriginInfoMap[symbolId] = originInfo + symbolToOriginInfoMap[len(symbols)] = originInfo symbolToSortTextMap[symbolId] = core.IfElse(importStatementCompletion != nil, SortTextLocationPriority, SortTextAutoImportSuggestions) symbols = append(symbols, symbol) return nil @@ -1530,17 +1531,16 @@ func (l *LanguageService) getCompletionData( symbols = append(symbols, filterClassMembersList(baseSymbols, decl.Members(), classElementModifierFlags, file, position)...) - for _, symbol := range symbols { + for index, symbol := range symbols { declaration := symbol.ValueDeclaration if declaration != nil && ast.IsClassElement(declaration) && declaration.Name() != nil && ast.IsComputedPropertyName(declaration.Name()) { - symbolId := ast.GetSymbolId(symbol) origin := &symbolOriginInfo{ kind: symbolOriginInfoKindComputedPropertyName, data: &symbolOriginInfoComputedPropertyName{symbolName: typeChecker.SymbolToString(symbol)}, } - symbolToOriginInfoMap[symbolId] = origin + symbolToOriginInfoMap[index] = origin } } } @@ -1647,7 +1647,7 @@ func (l *LanguageService) getCompletionData( symbols = append(symbols, typeChecker.GetSymbolsInScope(scopeNode, symbolMeanings)...) core.CheckEachDefined(symbols, "getSymbolsInScope() should all be defined") - for _, symbol := range symbols { + for index, symbol := range symbols { symbolId := ast.GetSymbolId(symbol) if !typeChecker.IsArgumentsSymbol(symbol) && !core.Some(symbol.Declarations, func(decl *ast.Declaration) bool { @@ -1662,7 +1662,7 @@ func (l *LanguageService) getCompletionData( kind: symbolOriginInfoKindTypeOnlyAlias, data: &symbolOriginInfoTypeOnlyAlias{declaration: typeOnlyAliasDeclaration}, } - symbolToOriginInfoMap[symbolId] = origin + symbolToOriginInfoMap[index] = origin } } } @@ -1677,7 +1677,7 @@ func (l *LanguageService) getCompletionData( for _, symbol := range getPropertiesForCompletion(thisType, typeChecker) { symbolId := ast.GetSymbolId(symbol) symbols = append(symbols, symbol) - symbolToOriginInfoMap[symbolId] = &symbolOriginInfo{kind: symbolOriginInfoKindThisType} + symbolToOriginInfoMap[len(symbols)-1] = &symbolOriginInfo{kind: symbolOriginInfoKindThisType} symbolToSortTextMap[symbolId] = SortTextSuggestedClassMembers } } @@ -1957,9 +1957,8 @@ func (l *LanguageService) getCompletionEntriesFromSymbols( // true otherwise. Based on the order we add things we will always see locals first, then globals, then module exports. // So adding a completion for a local will prevent us from adding completions for external module exports sharing the same name. uniques := make(uniqueNamesMap) - for _, symbol := range data.symbols { - symbolId := ast.GetSymbolId(symbol) - origin := data.symbolToOriginInfoMap[symbolId] + for index, symbol := range data.symbols { + origin := data.symbolToOriginInfoMap[index] name, needsConvertPropertyAccess := getCompletionEntryDisplayNameForSymbol( symbol, origin, @@ -2294,7 +2293,7 @@ func (l *LanguageService) createCompletionItem( } } - var autoImportData *completionEntryData + var autoImportData *AutoImportData if originIsExport(origin) { autoImportData = origin.toCompletionEntryData() hasAction = data.importStatementCompletion == nil @@ -3289,10 +3288,7 @@ func getCompletionsSymbolKind(kind ScriptElementKind) lsproto.CompletionItemKind // Editors will use the `sortText` and then fall back to `name` for sorting, but leave ties in response order. // So, it's important that we sort those ties in the order we want them displayed if it matters. We don't // strictly need to sort by name or SortText here since clients are going to do it anyway, but we have to -// do the work of comparing them so we can sort those ties appropriately; plus, it makes the order returned -// by the language service consistent with what TS Server does and what editors typically do. This also makes -// completions tests make more sense. We used to sort only alphabetically and only in the server layer, but -// this made tests really weird, since most fourslash tests don't use the server. +// do the work of comparing them so we can sort those ties appropriately. func compareCompletionEntries(entryInSlice *lsproto.CompletionItem, entryToInsert *lsproto.CompletionItem) int { compareStrings := stringutil.CompareStringsCaseInsensitiveThenSensitive result := compareStrings(*entryInSlice.SortText, *entryToInsert.SortText) @@ -3300,14 +3296,22 @@ func compareCompletionEntries(entryInSlice *lsproto.CompletionItem, entryToInser result = compareStrings(entryInSlice.Label, entryToInsert.Label) } if result == stringutil.ComparisonEqual && entryInSlice.Data != nil && entryToInsert.Data != nil { - sliceEntryData, ok1 := (*entryInSlice.Data).(*completionEntryData) - insertEntryData, ok2 := (*entryToInsert.Data).(*completionEntryData) - if ok1 && ok2 && sliceEntryData.ModuleSpecifier != "" && insertEntryData.ModuleSpecifier != "" { + sliceEntryData, ok1 := (*entryInSlice.Data).(*CompletionItemData) + insertEntryData, ok2 := (*entryToInsert.Data).(*CompletionItemData) + if ok1 && ok2 && + sliceEntryData.AutoImport != nil && sliceEntryData.AutoImport.ModuleSpecifier != "" && + insertEntryData.AutoImport != nil && insertEntryData.AutoImport.ModuleSpecifier != "" { // Sort same-named auto-imports by module specifier result = compareNumberOfDirectorySeparators( - sliceEntryData.ModuleSpecifier, - insertEntryData.ModuleSpecifier, + sliceEntryData.AutoImport.ModuleSpecifier, + insertEntryData.AutoImport.ModuleSpecifier, ) + if result == stringutil.ComparisonEqual { + result = compareStrings( + sliceEntryData.AutoImport.ModuleSpecifier, + insertEntryData.AutoImport.ModuleSpecifier, + ) + } } } if result == stringutil.ComparisonEqual { @@ -4514,10 +4518,10 @@ func (l *LanguageService) createLSPCompletionItem( hasAction bool, preselect bool, source string, - autoImportEntryData *completionEntryData, + autoImportEntryData *AutoImportData, ) *lsproto.CompletionItem { kind := getCompletionsSymbolKind(elementKind) - var data any = &itemData{ + var data any = &CompletionItemData{ FileName: file.FileName(), Position: position, Source: source, @@ -4949,15 +4953,15 @@ func getArgumentInfoForCompletions(node *ast.Node, position int, file *ast.Sourc } } -type itemData struct { - FileName string `json:"fileName"` - Position int `json:"position"` - Source string `json:"source,omitempty"` - Name string `json:"name,omitempty"` - AutoImport *completionEntryData `json:"autoImport,omitempty"` +type CompletionItemData struct { + FileName string `json:"fileName"` + Position int `json:"position"` + Source string `json:"source,omitempty"` + Name string `json:"name,omitempty"` + AutoImport *AutoImportData `json:"autoImport,omitempty"` } -type completionEntryData struct { +type AutoImportData struct { /** * The name of the property or export in the module's symbol table. Differs from the completion name * in the case of InternalSymbolName.ExportEquals and InternalSymbolName.Default. @@ -4967,7 +4971,7 @@ type completionEntryData struct { ModuleSpecifier string `json:"moduleSpecifier"` /** The file name declaring the export's module symbol, if it was an external module */ - FileName *string `json:"fileName"` + FileName string `json:"fileName"` /** The module name (with quotes stripped) of the export's module symbol, if it was an ambient module */ AmbientModuleName *string `json:"ambientModuleName"` @@ -4975,7 +4979,7 @@ type completionEntryData struct { IsPackageJsonImport core.Tristate `json:"isPackageJsonImport"` } -func (d *completionEntryData) toSymbolOriginExport(symbolName string, moduleSymbol *ast.Symbol, isDefaultExport bool) *symbolOriginInfoExport { +func (d *AutoImportData) toSymbolOriginExport(symbolName string, moduleSymbol *ast.Symbol, isDefaultExport bool) *symbolOriginInfoExport { return &symbolOriginInfoExport{ symbolName: symbolName, moduleSymbol: moduleSymbol, @@ -5012,7 +5016,7 @@ const ( func (l *LanguageService) ResolveCompletionItem( ctx context.Context, item *lsproto.CompletionItem, - data *itemData, + data *CompletionItemData, clientOptions *lsproto.CompletionClientCapabilities, preferences *UserPreferences, ) (*lsproto.CompletionItem, error) { @@ -5028,12 +5032,12 @@ func (l *LanguageService) ResolveCompletionItem( return l.getCompletionItemDetails(ctx, program, data.Position, file, item, data, clientOptions, preferences), nil } -func GetCompletionItemData(item *lsproto.CompletionItem) (*itemData, error) { +func GetCompletionItemData(item *lsproto.CompletionItem) (*CompletionItemData, error) { bytes, err := json.Marshal(item.Data) if err != nil { return nil, fmt.Errorf("failed to marshal completion item data: %w", err) } - var itemData itemData + var itemData CompletionItemData if err := json.Unmarshal(bytes, &itemData); err != nil { return nil, fmt.Errorf("failed to unmarshal completion item data: %w", err) } @@ -5046,7 +5050,7 @@ func (l *LanguageService) getCompletionItemDetails( position int, file *ast.SourceFile, item *lsproto.CompletionItem, - itemData *itemData, + itemData *CompletionItemData, clientOptions *lsproto.CompletionClientCapabilities, preferences *UserPreferences, ) *lsproto.CompletionItem { @@ -5145,7 +5149,7 @@ func (l *LanguageService) getSymbolCompletionFromItemData( ch *checker.Checker, file *ast.SourceFile, position int, - itemData *itemData, + itemData *CompletionItemData, clientOptions *lsproto.CompletionClientCapabilities, preferences *UserPreferences, ) detailsData { @@ -5194,9 +5198,8 @@ func (l *LanguageService) getSymbolCompletionFromItemData( // We don't need to perform character checks here because we're only comparing the // name against 'entryName' (which is known to be good), not building a new // completion entry. - for _, symbol := range data.symbols { - symbolId := ast.GetSymbolId(symbol) - origin := data.symbolToOriginInfoMap[symbolId] + for index, symbol := range data.symbols { + origin := data.symbolToOriginInfoMap[index] displayName, _ := getCompletionEntryDisplayNameForSymbol(symbol, origin, data.completionKind, data.isJsxIdentifierExpected) if displayName == itemData.Name && (itemData.Source == string(completionSourceClassMemberSnippet) && symbol.Flags&ast.SymbolFlagsClassMember != 0 || @@ -5219,15 +5222,15 @@ func (l *LanguageService) getSymbolCompletionFromItemData( return detailsData{} } -func (l *LanguageService) getAutoImportSymbolFromCompletionEntryData(ch *checker.Checker, name string, autoImportData *completionEntryData) *symbolDetails { +func (l *LanguageService) getAutoImportSymbolFromCompletionEntryData(ch *checker.Checker, name string, autoImportData *AutoImportData) *symbolDetails { containingProgram := l.GetProgram() // !!! isPackageJson ? packageJsonAutoimportProvider : program var moduleSymbol *ast.Symbol if autoImportData.AmbientModuleName != nil { moduleSymbol = ch.TryFindAmbientModule(*autoImportData.AmbientModuleName) - } else if autoImportData.FileName != nil { - moduleSymbolSourceFile := containingProgram.GetSourceFile(*autoImportData.FileName) + } else if autoImportData.FileName != "" { + moduleSymbolSourceFile := containingProgram.GetSourceFile(autoImportData.FileName) if moduleSymbolSourceFile == nil { - panic("module sourceFile not found: " + *autoImportData.FileName) + panic("module sourceFile not found: " + autoImportData.FileName) } moduleSymbol = ch.GetMergedSymbol(moduleSymbolSourceFile.Symbol) } @@ -5253,7 +5256,7 @@ func (l *LanguageService) getAutoImportSymbolFromCompletionEntryData(ch *checker } origin := &symbolOriginInfo{ kind: symbolOriginInfoKindExport, - fileName: *autoImportData.FileName, + fileName: autoImportData.FileName, isFromPackageJson: autoImportData.IsPackageJsonImport.IsTrue(), isDefaultExport: isDefaultExport, data: autoImportData.toSymbolOriginExport(name, moduleSymbol, isDefaultExport), @@ -5318,7 +5321,7 @@ func createCompletionDetailsForSymbol( } // !!! snippets -func (l *LanguageService) getCompletionItemActions(ctx context.Context, ch *checker.Checker, file *ast.SourceFile, position int, itemData *itemData, symbolDetails *symbolDetails, preferences *UserPreferences) []codeAction { +func (l *LanguageService) getCompletionItemActions(ctx context.Context, ch *checker.Checker, file *ast.SourceFile, position int, itemData *CompletionItemData, symbolDetails *symbolDetails, preferences *UserPreferences) []codeAction { if itemData.AutoImport != nil && itemData.AutoImport.ModuleSpecifier != "" && symbolDetails.previousToken != nil { // Import statement completion: 'import c|' if symbolDetails.contextToken != nil && l.getImportStatementCompletionInfo(symbolDetails.contextToken, file).replacementSpan != nil { diff --git a/internal/ls/organizeimports.go b/internal/ls/organizeimports.go index 8cdeddab5d..b5cfaf68a6 100644 --- a/internal/ls/organizeimports.go +++ b/internal/ls/organizeimports.go @@ -2,15 +2,26 @@ package ls import ( "cmp" + "math" "strings" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/compiler" "github.com/microsoft/typescript-go/internal/core" "github.com/microsoft/typescript-go/internal/modulespecifiers" + "github.com/microsoft/typescript-go/internal/stringutil" "github.com/microsoft/typescript-go/internal/tspath" ) +var ( + caseInsensitiveOrganizeImportsComparer = []func(a, b string) int{getOrganizeImportsOrdinalStringComparer(true)} + caseSensitiveOrganizeImportsComparer = []func(a, b string) int{getOrganizeImportsOrdinalStringComparer(false)} + organizeImportsComparers = []func(a, b string) int{ + caseInsensitiveOrganizeImportsComparer[0], + caseSensitiveOrganizeImportsComparer[0], + } +) + // statement = anyImportOrRequireStatement func getImportDeclarationInsertIndex(sortedImports []*ast.Statement, newImport *ast.Statement, comparer func(a, b *ast.Statement) int) int { // !!! @@ -126,3 +137,251 @@ func isIndexFileName(fileName string) bool { } return fileName == "index" } + +func getOrganizeImportsOrdinalStringComparer(ignoreCase bool) func(a, b string) int { + if ignoreCase { + return stringutil.CompareStringsCaseInsensitiveEslintCompatible + } + return stringutil.CompareStringsCaseSensitive +} + +// getModuleSpecifierExpression returns the module specifier expression from an import/require statement +func getModuleSpecifierExpression(declaration *ast.Statement) *ast.Expression { + switch declaration.Kind { + case ast.KindImportEqualsDeclaration: + importEquals := declaration.AsImportEqualsDeclaration() + if importEquals.ModuleReference.Kind == ast.KindExternalModuleReference { + return importEquals.ModuleReference.AsExternalModuleReference().Expression + } + return nil + case ast.KindImportDeclaration: + return declaration.AsImportDeclaration().ModuleSpecifier + case ast.KindVariableStatement: + // For require statements: const x = require('...') + variableStatement := declaration.AsVariableStatement() + declarations := variableStatement.DeclarationList.AsVariableDeclarationList().Declarations.Nodes + if len(declarations) > 0 { + decl := declarations[0] + initializer := decl.Initializer() + if initializer != nil && initializer.Kind == ast.KindCallExpression { + callExpr := initializer.AsCallExpression() + if len(callExpr.Arguments.Nodes) > 0 { + return callExpr.Arguments.Nodes[0] + } + } + } + return nil + default: + return nil + } +} + +func getExternalModuleName(specifier *ast.Expression) string { + if specifier != nil && ast.IsStringLiteralLike(specifier.AsNode()) { + return specifier.Text() + } + return "" +} + +// compareModuleSpecifiersWorker compares two module specifiers +func compareModuleSpecifiersWorker(m1 *ast.Expression, m2 *ast.Expression, comparer func(a, b string) int) int { + name1 := getExternalModuleName(m1) + name2 := getExternalModuleName(m2) + if cmp := compareBooleans(name1 == "", name2 == ""); cmp != 0 { + return cmp + } + if cmp := compareBooleans(tspath.IsExternalModuleNameRelative(name1), tspath.IsExternalModuleNameRelative(name2)); cmp != 0 { + return cmp + } + return comparer(name1, name2) +} + +// compareImportKind returns comparison order based on import kind +func compareImportKind(s1 *ast.Statement, s2 *ast.Statement) int { + return cmp.Compare(getImportKindOrder(s1), getImportKindOrder(s2)) +} + +// getImportKindOrder returns the sort order for different import kinds: +// 1. Side-effect imports +// 2. Type-only imports +// 3. Namespace imports +// 4. Default imports +// 5. Named imports +// 6. ImportEqualsDeclarations +// 7. Require variable statements +func getImportKindOrder(s1 *ast.Statement) int { + switch s1.Kind { + case ast.KindImportDeclaration: + importDecl := s1.AsImportDeclaration() + if importDecl.ImportClause == nil { + return 0 // Side-effect import + } + importClause := importDecl.ImportClause.AsImportClause() + if importClause.IsTypeOnly() { + return 1 // Type-only import + } + if importClause.NamedBindings != nil && importClause.NamedBindings.Kind == ast.KindNamespaceImport { + return 2 // Namespace import + } + if importClause.Name() != nil { + return 3 // Default import + } + return 4 // Named imports + case ast.KindImportEqualsDeclaration: + return 5 + case ast.KindVariableStatement: + return 6 // Require statement + default: + return 7 + } +} + +// compareImportsOrRequireStatements compares two import or require statements for sorting +func compareImportsOrRequireStatements(s1 *ast.Statement, s2 *ast.Statement, comparer func(a, b string) int) int { + if cmp := compareModuleSpecifiersWorker(getModuleSpecifierExpression(s1), getModuleSpecifierExpression(s2), comparer); cmp != 0 { + return cmp + } + return compareImportKind(s1, s2) +} + +// compareImportOrExportSpecifiers compares two import or export specifiers +func compareImportOrExportSpecifiers(s1 *ast.Node, s2 *ast.Node, comparer func(a, b string) int, preferences *UserPreferences) int { + typeOrder := OrganizeImportsTypeOrderLast + if preferences != nil { + typeOrder = preferences.OrganizeImportsTypeOrder + } + + s1Name := s1.Name().Text() + s2Name := s2.Name().Text() + + switch typeOrder { + case OrganizeImportsTypeOrderFirst: + if cmp := compareBooleans(s2.IsTypeOnly(), s1.IsTypeOnly()); cmp != 0 { + return cmp + } + return comparer(s1Name, s2Name) + case OrganizeImportsTypeOrderInline: + return comparer(s1Name, s2Name) + default: // OrganizeImportsTypeOrderLast + if cmp := compareBooleans(s1.IsTypeOnly(), s2.IsTypeOnly()); cmp != 0 { + return cmp + } + return comparer(s1Name, s2Name) + } +} + +// getNamedImportSpecifierComparer returns a comparer function for import/export specifiers +func getNamedImportSpecifierComparer(preferences *UserPreferences, comparer func(a, b string) int) func(s1, s2 *ast.Node) int { + if comparer == nil { + ignoreCase := false + if preferences != nil && !preferences.OrganizeImportsIgnoreCase.IsUnknown() { + ignoreCase = preferences.OrganizeImportsIgnoreCase.IsTrue() + } + comparer = getOrganizeImportsOrdinalStringComparer(ignoreCase) + } + return func(s1, s2 *ast.Node) int { + return compareImportOrExportSpecifiers(s1, s2, comparer, preferences) + } +} + +// getImportSpecifierInsertionIndex finds the insertion index for a new import specifier +func getImportSpecifierInsertionIndex(sortedImports []*ast.Node, newImport *ast.Node, comparer func(s1, s2 *ast.Node) int) int { + return core.FirstResult(core.BinarySearchUniqueFunc(sortedImports, func(mid int, value *ast.Node) int { + return comparer(value, newImport) + })) +} + +// getOrganizeImportsStringComparerWithDetection detects the string comparer to use based on existing imports +func getOrganizeImportsStringComparerWithDetection(originalImportDecls []*ast.Statement, preferences *UserPreferences) (comparer func(a, b string) int, isSorted bool) { + result := detectModuleSpecifierCaseBySort([][]*ast.Statement{originalImportDecls}, getComparers(preferences)) + return result.comparer, result.isSorted +} + +func getComparers(preferences *UserPreferences) []func(a string, b string) int { + if preferences != nil { + switch preferences.OrganizeImportsIgnoreCase { + case core.TSTrue: + return caseInsensitiveOrganizeImportsComparer + case core.TSFalse: + return caseSensitiveOrganizeImportsComparer + } + } + + return organizeImportsComparers +} + +type caseSensitivityDetectionResult struct { + comparer func(a, b string) int + isSorted bool +} + +func detectModuleSpecifierCaseBySort(importDeclsByGroup [][]*ast.Statement, comparersToTest []func(a, b string) int) caseSensitivityDetectionResult { + moduleSpecifiersByGroup := make([][]string, 0, len(importDeclsByGroup)) + for _, importGroup := range importDeclsByGroup { + moduleNames := make([]string, 0, len(importGroup)) + for _, decl := range importGroup { + if expr := getModuleSpecifierExpression(decl); expr != nil { + moduleNames = append(moduleNames, getExternalModuleName(expr)) + } else { + moduleNames = append(moduleNames, "") + } + } + moduleSpecifiersByGroup = append(moduleSpecifiersByGroup, moduleNames) + } + return detectCaseSensitivityBySort(moduleSpecifiersByGroup, comparersToTest) +} + +func detectCaseSensitivityBySort(originalGroups [][]string, comparersToTest []func(a, b string) int) caseSensitivityDetectionResult { + var bestComparer func(a, b string) int + bestDiff := math.MaxInt + + for _, curComparer := range comparersToTest { + diffOfCurrentComparer := 0 + + for _, listToSort := range originalGroups { + if len(listToSort) <= 1 { + continue + } + diff := measureSortedness(listToSort, curComparer) + diffOfCurrentComparer += diff + } + + if diffOfCurrentComparer < bestDiff { + bestDiff = diffOfCurrentComparer + bestComparer = curComparer + } + } + + if bestComparer == nil && len(comparersToTest) > 0 { + bestComparer = comparersToTest[0] + } + + return caseSensitivityDetectionResult{ + comparer: bestComparer, + isSorted: bestDiff == 0, + } +} + +func measureSortedness[T any](arr []T, comparer func(a, b T) int) int { + i := 0 + for j := range len(arr) - 1 { + if comparer(arr[j], arr[j+1]) > 0 { + i++ + } + } + return i +} + +// getNamedImportSpecifierComparerWithDetection detects the appropriate comparer for named imports +func getNamedImportSpecifierComparerWithDetection(importDecl *ast.Node, preferences *UserPreferences, sourceFile *ast.SourceFile) (specifierComparer func(s1, s2 *ast.Node) int, isSorted core.Tristate) { + specifierComparer = getNamedImportSpecifierComparer(preferences, getComparers(preferences)[0]) + // Try to detect from the current import declaration + if (preferences == nil || preferences.OrganizeImportsIgnoreCase.IsUnknown() || preferences.OrganizeImportsTypeOrder == OrganizeImportsTypeOrderLast) && + importDecl.Kind == ast.KindImportDeclaration { + // For now, just return the default comparer + // Full detection logic would require porting detectNamedImportOrganizationBySort + return specifierComparer, core.TSUnknown + } + + return specifierComparer, core.TSUnknown +} diff --git a/internal/module/resolver.go b/internal/module/resolver.go index e88a468cc0..7f83beb76d 100644 --- a/internal/module/resolver.go +++ b/internal/module/resolver.go @@ -1675,7 +1675,7 @@ func (r *resolutionState) getPackageJsonInfo(packageDirectory string, onlyRecord if directoryExists && r.resolver.host.FS().FileExists(packageJsonPath) { // Ignore error contents, _ := r.resolver.host.FS().ReadFile(packageJsonPath) - packageJsonContent, _ := packagejson.Parse([]byte(contents)) + packageJsonContent, err := packagejson.Parse([]byte(contents)) if r.tracer != nil { r.tracer.write(diagnostics.Found_package_json_at_0.Format(packageJsonPath)) } @@ -1683,7 +1683,8 @@ func (r *resolutionState) getPackageJsonInfo(packageDirectory string, onlyRecord PackageDirectory: packageDirectory, DirectoryExists: true, Contents: &packagejson.PackageJson{ - Fields: packageJsonContent, + Fields: packageJsonContent, + Parseable: err == nil, }, } result = r.resolver.packageJsonInfoCache.Set(packageJsonPath, result) diff --git a/internal/modulespecifiers/specifiers.go b/internal/modulespecifiers/specifiers.go index 1f8e26b040..fd040fc14e 100644 --- a/internal/modulespecifiers/specifiers.go +++ b/internal/modulespecifiers/specifiers.go @@ -793,6 +793,8 @@ func tryDirectoryWithPackageJson( fileName := moduleFileToTry[parts.PackageRootIndex+1:] if fileName == "index.d.ts" || fileName == "index.js" || fileName == "index.ts" || fileName == "index.tsx" { return pkgJsonDirAttemptResult{moduleFileToTry: moduleFileToTry, packageRootPath: packageRootPath} + } else { + return pkgJsonDirAttemptResult{moduleFileToTry: moduleFileToTry} } } @@ -801,11 +803,7 @@ func tryDirectoryWithPackageJson( importMode = host.GetDefaultResolutionModeForFile(importingSourceFile) } - var packageJsonContent *packagejson.PackageJson - if packageJson != nil { - packageJsonContent = packageJson.GetContents() - } - + packageJsonContent := packageJson.GetContents() if options.GetResolvePackageJsonImports() { // The package name that we found in node_modules could be different from the package // name in the package.json content via url/filepath dependency specifiers. We need to diff --git a/internal/packagejson/cache.go b/internal/packagejson/cache.go index 7b72a4e3e9..ecff10e365 100644 --- a/internal/packagejson/cache.go +++ b/internal/packagejson/cache.go @@ -14,6 +14,7 @@ var typeScriptVersion = semver.MustParse(core.Version()) type PackageJson struct { Fields + Parseable bool versionPaths VersionPaths versionTraces []string once sync.Once diff --git a/internal/packagejson/packagejson.go b/internal/packagejson/packagejson.go index 5db60cebab..7ada92993e 100644 --- a/internal/packagejson/packagejson.go +++ b/internal/packagejson/packagejson.go @@ -28,6 +28,33 @@ type DependencyFields struct { OptionalDependencies Expected[map[string]string] `json:"optionalDependencies"` } +// HasDependency returns true if the package.json has a dependency with the given name +// under any of the dependency fields (dependencies, devDependencies, peerDependencies, +// optionalDependencies). +func (df *DependencyFields) HasDependency(name string) bool { + if deps, ok := df.Dependencies.GetValue(); ok { + if _, ok := deps[name]; ok { + return true + } + } + if devDeps, ok := df.DevDependencies.GetValue(); ok { + if _, ok := devDeps[name]; ok { + return true + } + } + if peerDeps, ok := df.PeerDependencies.GetValue(); ok { + if _, ok := peerDeps[name]; ok { + return true + } + } + if optDeps, ok := df.OptionalDependencies.GetValue(); ok { + if _, ok := optDeps[name]; ok { + return true + } + } + return false +} + type Fields struct { HeaderFields PathFields diff --git a/internal/stringutil/compare.go b/internal/stringutil/compare.go index 832e1dbcf1..0fb1cd3975 100644 --- a/internal/stringutil/compare.go +++ b/internal/stringutil/compare.go @@ -98,3 +98,23 @@ func CompareStringsCaseInsensitiveThenSensitive(a, b string) Comparison { } return CompareStringsCaseSensitive(a, b) } + +// CompareStringsCaseInsensitiveEslintCompatible performs a case-insensitive comparison +// using toLowerCase() instead of toUpperCase() for ESLint compatibility. +// +// `CompareStringsCaseInsensitive` transforms letters to uppercase for unicode reasons, +// while eslint's `sort-imports` rule transforms letters to lowercase. Which one you choose +// affects the relative order of letters and ASCII characters 91-96, of which `_` is a +// valid character in an identifier. So if we used `CompareStringsCaseInsensitive` for +// import sorting, TypeScript and eslint would disagree about the correct case-insensitive +// sort order for `__String` and `Foo`. Since eslint's whole job is to create consistency +// by enforcing nitpicky details like this, it makes way more sense for us to just adopt +// their convention so users can have auto-imports without making eslint angry. +func CompareStringsCaseInsensitiveEslintCompatible(a, b string) Comparison { + if a == b { + return ComparisonEqual + } + a = strings.ToLower(a) + b = strings.ToLower(b) + return strings.Compare(a, b) +} diff --git a/testdata/baselines/reference/fourslash/autoImports/autoImportCompletion2.baseline.md b/testdata/baselines/reference/fourslash/autoImports/autoImportCompletion2.baseline.md index 1fff3fc8ff..a679c95fee 100644 --- a/testdata/baselines/reference/fourslash/autoImports/autoImportCompletion2.baseline.md +++ b/testdata/baselines/reference/fourslash/autoImports/autoImportCompletion2.baseline.md @@ -6,7 +6,7 @@ someVar; a/**/ ``````ts -import {someVar,anotherVar} from "./a.ts"; +import {anotherVar, someVar} from "./a.ts"; someVar; a diff --git a/testdata/baselines/reference/fourslash/autoImports/autoImportCompletion3.baseline.md b/testdata/baselines/reference/fourslash/autoImports/autoImportCompletion3.baseline.md index e565df0c68..b70487e0b7 100644 --- a/testdata/baselines/reference/fourslash/autoImports/autoImportCompletion3.baseline.md +++ b/testdata/baselines/reference/fourslash/autoImports/autoImportCompletion3.baseline.md @@ -6,7 +6,7 @@ someVar; b/**/ ``````ts -import { aa, someVar,bb } from "./a.ts"; +import { aa, bb, someVar } from "./a.ts"; someVar; b diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitIsolatedDeclarationErrorNotEmittedForNonEmittedFile.js b/testdata/baselines/reference/submodule/compiler/declarationEmitIsolatedDeclarationErrorNotEmittedForNonEmittedFile.js index 3079c4ba18..45192f5a18 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitIsolatedDeclarationErrorNotEmittedForNonEmittedFile.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitIsolatedDeclarationErrorNotEmittedForNonEmittedFile.js @@ -68,87 +68,14 @@ exports.publicProcedure = trpc.procedure; //// [index.d.ts] -export declare const middleware: >(fn: import("@trpc/server").MiddlewareFunction<{ - _config: import("@trpc/server").RootConfig<{ - errorShape: import("@trpc/server").ErrorFormatterShape; +export declare const middleware: >(fn: import("@trpc/server/middleware").MiddlewareFunction<{ + _config: import("@trpc/server/internals/config").RootConfig<{ + errorShape: import("@trpc/server/internals/utils").ErrorFormatterShape; }>; -}, TNewParams>) => import("@trpc/server").MiddlewareBuilder<{ - _config: import("@trpc/server").RootConfig<{ - errorShape: import("@trpc/server").ErrorFormatterShape; +}, TNewParams>) => import("@trpc/server/middleware").MiddlewareBuilder<{ + _config: import("@trpc/server/internals/config").RootConfig<{ + errorShape: import("@trpc/server/internals/utils").ErrorFormatterShape; }>; }, TNewParams>; export declare const router: {}; export declare const publicProcedure: {}; - - -//// [DtsFileErrors] - - -index.d.ts(1,102): error TS2694: Namespace '"node_modules/@trpc/server/index"' has no exported member 'MiddlewareFunction'. -index.d.ts(5,43): error TS2694: Namespace '"node_modules/@trpc/server/index"' has no exported member 'MiddlewareBuilder'. - - -==== node_modules/@trpc/server/internals/config.d.ts (0 errors) ==== - export interface RootConfig { - prop: T; - } -==== node_modules/@trpc/server/internals/utils.d.ts (0 errors) ==== - export interface ErrorFormatterShape { - prop: T; - } - export type PickFirstDefined = undefined extends TType - ? undefined extends TPick - ? never - : TPick - : TType; - export interface ErrorFormatter { - prop: [T, U]; - } - export interface DefaultErrorShape { - prop: T; - } -==== node_modules/@trpc/server/middleware.d.ts (0 errors) ==== - export interface MiddlewareFunction { - prop: [T, U]; - } - export interface MiddlewareBuilder { - prop: [T, U]; - } -==== node_modules/@trpc/server/index.d.ts (0 errors) ==== - import { RootConfig } from './internals/config'; - import { ErrorFormatterShape, PickFirstDefined, ErrorFormatter, DefaultErrorShape } from './internals/utils'; - declare class TRPCBuilder { - create>(): { - procedure: {}; - middleware: >(fn: import("./middleware").MiddlewareFunction<{ - _config: RootConfig<{ - errorShape: ErrorFormatterShape>>; - }>; - }, TNewParams>) => import("./middleware").MiddlewareBuilder<{ - _config: RootConfig<{ - errorShape: ErrorFormatterShape>>; - }>; - }, TNewParams>; - router: {}; - }; - } - - export declare const initTRPC: TRPCBuilder; - export {}; -==== index.d.ts (2 errors) ==== - export declare const middleware: >(fn: import("@trpc/server").MiddlewareFunction<{ - ~~~~~~~~~~~~~~~~~~ -!!! error TS2694: Namespace '"node_modules/@trpc/server/index"' has no exported member 'MiddlewareFunction'. - _config: import("@trpc/server").RootConfig<{ - errorShape: import("@trpc/server").ErrorFormatterShape; - }>; - }, TNewParams>) => import("@trpc/server").MiddlewareBuilder<{ - ~~~~~~~~~~~~~~~~~ -!!! error TS2694: Namespace '"node_modules/@trpc/server/index"' has no exported member 'MiddlewareBuilder'. - _config: import("@trpc/server").RootConfig<{ - errorShape: import("@trpc/server").ErrorFormatterShape; - }>; - }, TNewParams>; - export declare const router: {}; - export declare const publicProcedure: {}; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitIsolatedDeclarationErrorNotEmittedForNonEmittedFile.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitIsolatedDeclarationErrorNotEmittedForNonEmittedFile.js.diff index acd616e574..d4735170cf 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitIsolatedDeclarationErrorNotEmittedForNonEmittedFile.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitIsolatedDeclarationErrorNotEmittedForNonEmittedFile.js.diff @@ -13,87 +13,14 @@ + + +//// [index.d.ts] -+export declare const middleware: >(fn: import("@trpc/server").MiddlewareFunction<{ -+ _config: import("@trpc/server").RootConfig<{ -+ errorShape: import("@trpc/server").ErrorFormatterShape; ++export declare const middleware: >(fn: import("@trpc/server/middleware").MiddlewareFunction<{ ++ _config: import("@trpc/server/internals/config").RootConfig<{ ++ errorShape: import("@trpc/server/internals/utils").ErrorFormatterShape; + }>; -+}, TNewParams>) => import("@trpc/server").MiddlewareBuilder<{ -+ _config: import("@trpc/server").RootConfig<{ -+ errorShape: import("@trpc/server").ErrorFormatterShape; ++}, TNewParams>) => import("@trpc/server/middleware").MiddlewareBuilder<{ ++ _config: import("@trpc/server/internals/config").RootConfig<{ ++ errorShape: import("@trpc/server/internals/utils").ErrorFormatterShape; + }>; +}, TNewParams>; +export declare const router: {}; -+export declare const publicProcedure: {}; -+ -+ -+//// [DtsFileErrors] -+ -+ -+index.d.ts(1,102): error TS2694: Namespace '"node_modules/@trpc/server/index"' has no exported member 'MiddlewareFunction'. -+index.d.ts(5,43): error TS2694: Namespace '"node_modules/@trpc/server/index"' has no exported member 'MiddlewareBuilder'. -+ -+ -+==== node_modules/@trpc/server/internals/config.d.ts (0 errors) ==== -+ export interface RootConfig { -+ prop: T; -+ } -+==== node_modules/@trpc/server/internals/utils.d.ts (0 errors) ==== -+ export interface ErrorFormatterShape { -+ prop: T; -+ } -+ export type PickFirstDefined = undefined extends TType -+ ? undefined extends TPick -+ ? never -+ : TPick -+ : TType; -+ export interface ErrorFormatter { -+ prop: [T, U]; -+ } -+ export interface DefaultErrorShape { -+ prop: T; -+ } -+==== node_modules/@trpc/server/middleware.d.ts (0 errors) ==== -+ export interface MiddlewareFunction { -+ prop: [T, U]; -+ } -+ export interface MiddlewareBuilder { -+ prop: [T, U]; -+ } -+==== node_modules/@trpc/server/index.d.ts (0 errors) ==== -+ import { RootConfig } from './internals/config'; -+ import { ErrorFormatterShape, PickFirstDefined, ErrorFormatter, DefaultErrorShape } from './internals/utils'; -+ declare class TRPCBuilder { -+ create>(): { -+ procedure: {}; -+ middleware: >(fn: import("./middleware").MiddlewareFunction<{ -+ _config: RootConfig<{ -+ errorShape: ErrorFormatterShape>>; -+ }>; -+ }, TNewParams>) => import("./middleware").MiddlewareBuilder<{ -+ _config: RootConfig<{ -+ errorShape: ErrorFormatterShape>>; -+ }>; -+ }, TNewParams>; -+ router: {}; -+ }; -+ } -+ -+ export declare const initTRPC: TRPCBuilder; -+ export {}; -+==== index.d.ts (2 errors) ==== -+ export declare const middleware: >(fn: import("@trpc/server").MiddlewareFunction<{ -+ ~~~~~~~~~~~~~~~~~~ -+!!! error TS2694: Namespace '"node_modules/@trpc/server/index"' has no exported member 'MiddlewareFunction'. -+ _config: import("@trpc/server").RootConfig<{ -+ errorShape: import("@trpc/server").ErrorFormatterShape; -+ }>; -+ }, TNewParams>) => import("@trpc/server").MiddlewareBuilder<{ -+ ~~~~~~~~~~~~~~~~~ -+!!! error TS2694: Namespace '"node_modules/@trpc/server/index"' has no exported member 'MiddlewareBuilder'. -+ _config: import("@trpc/server").RootConfig<{ -+ errorShape: import("@trpc/server").ErrorFormatterShape; -+ }>; -+ }, TNewParams>; -+ export declare const router: {}; -+ export declare const publicProcedure: {}; -+ \ No newline at end of file ++export declare const publicProcedure: {}; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationsIndirectGeneratedAliasReference.js b/testdata/baselines/reference/submodule/compiler/declarationsIndirectGeneratedAliasReference.js index 916a7548c9..37a14c819a 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationsIndirectGeneratedAliasReference.js +++ b/testdata/baselines/reference/submodule/compiler/declarationsIndirectGeneratedAliasReference.js @@ -29,30 +29,4 @@ exports.MyComp = Ctor.extends({ foo: "bar" }); //// [index.d.ts] import * as ns from "mod"; -export declare const MyComp: import("mod").ExtendedCtor; - - -//// [DtsFileErrors] - - -index.d.ts(2,44): error TS2694: Namespace '"node_modules/mod/index"' has no exported member 'ExtendedCtor'. - - -==== node_modules/mod/ctor.d.ts (0 errors) ==== - export interface Ctor { - x: number; - } - export type ExtendedCtor = {x: number, ext: T}; - export interface CtorConstructor { - extends(x: T): ExtendedCtor; - } - export const Ctor: CtorConstructor; -==== node_modules/mod/index.d.ts (0 errors) ==== - import { Ctor } from "./ctor"; - export default Ctor; -==== index.d.ts (1 errors) ==== - import * as ns from "mod"; - export declare const MyComp: import("mod").ExtendedCtor; - ~~~~~~~~~~~~ -!!! error TS2694: Namespace '"node_modules/mod/index"' has no exported member 'ExtendedCtor'. - \ No newline at end of file +export declare const MyComp: import("mod/ctor").ExtendedCtor; diff --git a/testdata/baselines/reference/submodule/compiler/declarationsIndirectGeneratedAliasReference.js.diff b/testdata/baselines/reference/submodule/compiler/declarationsIndirectGeneratedAliasReference.js.diff index c460ba5131..0d1946d9ee 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationsIndirectGeneratedAliasReference.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationsIndirectGeneratedAliasReference.js.diff @@ -8,35 +8,3 @@ +const ns = require("mod"); const Ctor = ns.default; exports.MyComp = Ctor.extends({ foo: "bar" }); - - - //// [index.d.ts] - import * as ns from "mod"; --export declare const MyComp: import("mod/ctor").ExtendedCtor; -+export declare const MyComp: import("mod").ExtendedCtor; -+ -+ -+//// [DtsFileErrors] -+ -+ -+index.d.ts(2,44): error TS2694: Namespace '"node_modules/mod/index"' has no exported member 'ExtendedCtor'. -+ -+ -+==== node_modules/mod/ctor.d.ts (0 errors) ==== -+ export interface Ctor { -+ x: number; -+ } -+ export type ExtendedCtor = {x: number, ext: T}; -+ export interface CtorConstructor { -+ extends(x: T): ExtendedCtor; -+ } -+ export const Ctor: CtorConstructor; -+==== node_modules/mod/index.d.ts (0 errors) ==== -+ import { Ctor } from "./ctor"; -+ export default Ctor; -+==== index.d.ts (1 errors) ==== -+ import * as ns from "mod"; -+ export declare const MyComp: import("mod").ExtendedCtor; -+ ~~~~~~~~~~~~ -+!!! error TS2694: Namespace '"node_modules/mod/index"' has no exported member 'ExtendedCtor'. -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeModuleReexportFromDottedPath.js b/testdata/baselines/reference/submodule/compiler/nodeModuleReexportFromDottedPath.js index 8e6036fddd..4959a62228 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeModuleReexportFromDottedPath.js +++ b/testdata/baselines/reference/submodule/compiler/nodeModuleReexportFromDottedPath.js @@ -29,32 +29,5 @@ exports.default = new EnhancedPrisma(); //// [index.d.ts] import { PrismaClient } from "@prisma/client"; -declare const _default: PrismaClient; +declare const _default: PrismaClient; export default _default; - - -//// [DtsFileErrors] - - -/index.d.ts(2,45): error TS2307: Cannot find module '.prisma' or its corresponding type declarations. - - -==== /node_modules/.prisma/client/index.d.ts (0 errors) ==== - export interface PrismaClientOptions { - rejectOnNotFound?: any; - } - - export class PrismaClient { - private fetcher; - } - -==== /node_modules/@prisma/client/index.d.ts (0 errors) ==== - export * from ".prisma/client"; - -==== /index.d.ts (1 errors) ==== - import { PrismaClient } from "@prisma/client"; - declare const _default: PrismaClient; - ~~~~~~~~~ -!!! error TS2307: Cannot find module '.prisma' or its corresponding type declarations. - export default _default; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeModuleReexportFromDottedPath.js.diff b/testdata/baselines/reference/submodule/compiler/nodeModuleReexportFromDottedPath.js.diff index ce61505671..24451f8b04 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeModuleReexportFromDottedPath.js.diff +++ b/testdata/baselines/reference/submodule/compiler/nodeModuleReexportFromDottedPath.js.diff @@ -8,37 +8,3 @@ +const client_1 = require("@prisma/client"); const EnhancedPrisma = enhancePrisma(client_1.PrismaClient); exports.default = new EnhancedPrisma(); - - - //// [index.d.ts] - import { PrismaClient } from "@prisma/client"; --declare const _default: PrismaClient; -+declare const _default: PrismaClient; - export default _default; -+ -+ -+//// [DtsFileErrors] -+ -+ -+/index.d.ts(2,45): error TS2307: Cannot find module '.prisma' or its corresponding type declarations. -+ -+ -+==== /node_modules/.prisma/client/index.d.ts (0 errors) ==== -+ export interface PrismaClientOptions { -+ rejectOnNotFound?: any; -+ } -+ -+ export class PrismaClient { -+ private fetcher; -+ } -+ -+==== /node_modules/@prisma/client/index.d.ts (0 errors) ==== -+ export * from ".prisma/client"; -+ -+==== /index.d.ts (1 errors) ==== -+ import { PrismaClient } from "@prisma/client"; -+ declare const _default: PrismaClient; -+ ~~~~~~~~~ -+!!! error TS2307: Cannot find module '.prisma' or its corresponding type declarations. -+ export default _default; -+ \ No newline at end of file From fc800a76b9ae1b92ef0f91b6475e42d2b73577da Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Oct 2025 11:57:58 -0700 Subject: [PATCH 47/69] Fix JSX indentation in JavaScript output (#1792) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com> --- internal/printer/printer.go | 7 +- internal/transformers/jsxtransforms/jsx.go | 23 +++++-- .../compiler/jsxNestedIndentation.js | 20 ++++++ .../compiler/jsxNestedIndentation.symbols | 31 +++++++++ .../compiler/jsxNestedIndentation.types | 34 ++++++++++ .../compiler/jsxUnicodeEscapeSequence.js | 4 +- .../compiler/errorSpanForUnclosedJsxTag.js | 4 +- .../errorSpanForUnclosedJsxTag.js.diff | 10 --- .../compiler/excessiveStackDepthFlatArray.js | 6 +- .../excessiveStackDepthFlatArray.js.diff | 13 ---- .../jsxAttributeWithoutExpressionReact.js | 3 +- ...jsxAttributeWithoutExpressionReact.js.diff | 9 --- .../submodule/compiler/jsxChildWrongType.js | 4 +- .../compiler/jsxChildWrongType.js.diff | 5 +- .../compiler/jsxChildrenArrayWrongType.js | 4 +- .../jsxChildrenArrayWrongType.js.diff | 5 +- .../jsxChildrenIndividualErrorElaborations.js | 12 +++- ...hildrenIndividualErrorElaborations.js.diff | 32 +-------- .../compiler/jsxChildrenWrongType.js | 4 +- .../compiler/jsxChildrenWrongType.js.diff | 5 +- ...yExpressionNotCountedAsChild(jsx=react).js | 3 +- ...essionNotCountedAsChild(jsx=react).js.diff | 5 +- .../jsxFactoryAndJsxFragmentFactory.js | 6 +- .../jsxFactoryAndJsxFragmentFactory.js.diff | 12 ---- ...AndJsxFragmentFactoryErrorNotIdentifier.js | 6 +- ...xFragmentFactoryErrorNotIdentifier.js.diff | 12 ---- .../jsxFactoryAndJsxFragmentFactoryNull.js | 6 +- ...sxFactoryAndJsxFragmentFactoryNull.js.diff | 12 ---- .../jsxFactoryButNoJsxFragmentFactory.js | 6 +- .../jsxFactoryButNoJsxFragmentFactory.js.diff | 12 ---- .../jsxFragmentFactoryNoUnusedLocals.js | 4 +- .../jsxFragmentFactoryNoUnusedLocals.js.diff | 6 +- .../compiler/jsxRuntimePragma(jsx=react).js | 6 +- .../jsxRuntimePragma(jsx=react).js.diff | 16 ++--- .../jsxRuntimePragma(jsx=react-jsx).js | 6 +- .../jsxRuntimePragma(jsx=react-jsx).js.diff | 16 ++--- .../jsxRuntimePragma(jsx=react-jsxdev).js | 6 +- ...jsxRuntimePragma(jsx=react-jsxdev).js.diff | 16 ++--- .../compiler/tsxFragmentChildrenCheck.js | 5 +- .../compiler/tsxFragmentChildrenCheck.js.diff | 11 +-- .../checkJsxChildrenCanBeTupleType.js | 9 ++- .../checkJsxChildrenCanBeTupleType.js.diff | 10 +-- .../correctlyMarkAliasAsReferences1.js | 3 +- .../correctlyMarkAliasAsReferences1.js.diff | 9 --- .../correctlyMarkAliasAsReferences2.js | 3 +- .../correctlyMarkAliasAsReferences2.js.diff | 9 --- .../correctlyMarkAliasAsReferences3.js | 3 +- .../correctlyMarkAliasAsReferences3.js.diff | 9 --- .../conformance/inlineJsxAndJsxFragPragma.js | 6 +- .../inlineJsxAndJsxFragPragma.js.diff | 16 ++--- ...ndJsxFragPragmaOverridesCompilerOptions.js | 12 ++-- ...FragPragmaOverridesCompilerOptions.js.diff | 30 +++----- .../inlineJsxFactoryDeclarationsLocalTypes.js | 44 ++++++++++-- ...neJsxFactoryDeclarationsLocalTypes.js.diff | 68 ++++--------------- .../inlineJsxFactoryWithFragmentIsError.js | 6 +- ...nlineJsxFactoryWithFragmentIsError.js.diff | 10 ++- .../jsxAttributeInitializer(jsx=react).js | 7 +- ...jsxAttributeInitializer(jsx=react).js.diff | 13 ---- ...CjsTransformCustomImport(jsx=react-jsx).js | 6 +- ...ansformCustomImport(jsx=react-jsx).js.diff | 6 +- ...TransformCustomImport(jsx=react-jsxdev).js | 6 +- ...formCustomImport(jsx=react-jsxdev).js.diff | 6 +- ...nsformCustomImportPragma(jsx=react-jsx).js | 12 +++- ...mCustomImportPragma(jsx=react-jsx).js.diff | 12 +++- ...ormCustomImportPragma(jsx=react-jsxdev).js | 12 +++- ...stomImportPragma(jsx=react-jsxdev).js.diff | 12 +++- ...rmNestedSelfClosingChild(jsx=react-jsx).js | 4 +- ...tedSelfClosingChild(jsx=react-jsx).js.diff | 4 +- ...estedSelfClosingChild(jsx=react-jsxdev).js | 4 +- ...SelfClosingChild(jsx=react-jsxdev).js.diff | 4 +- ...SubstitutesNamesFragment(jsx=react-jsx).js | 6 +- ...itutesNamesFragment(jsx=react-jsx).js.diff | 6 +- ...stitutesNamesFragment(jsx=react-jsxdev).js | 6 +- ...tesNamesFragment(jsx=react-jsxdev).js.diff | 6 +- .../submodule/conformance/multiline.js | 9 ++- .../submodule/conformance/multiline.js.diff | 11 +-- .../conformance/tsxFragmentReactEmit.js | 11 ++- .../conformance/tsxFragmentReactEmit.js.diff | 18 ----- .../submodule/conformance/tsxReactEmit1.js | 5 +- .../conformance/tsxReactEmit1.js.diff | 12 +--- .../submodule/conformance/tsxReactEmit3.js | 9 ++- .../conformance/tsxReactEmit3.js.diff | 15 ---- .../conformance/tsxReactEmitNesting.js | 18 ++++- .../conformance/tsxReactEmitNesting.js.diff | 24 ------- .../conformance/tsxReactEmitWhitespace.js | 5 +- .../tsxReactEmitWhitespace.js.diff | 14 ---- .../conformance/tsxReactEmitWhitespace2.js | 13 +++- .../tsxReactEmitWhitespace2.js.diff | 21 ------ .../incremental/serializing-error-chain.js | 4 +- .../cases/compiler/jsxNestedIndentation.js | 9 +++ .../cases/compiler/jsxNestedIndentation.tsx | 14 ++++ 91 files changed, 479 insertions(+), 519 deletions(-) create mode 100644 testdata/baselines/reference/compiler/jsxNestedIndentation.js create mode 100644 testdata/baselines/reference/compiler/jsxNestedIndentation.symbols create mode 100644 testdata/baselines/reference/compiler/jsxNestedIndentation.types delete mode 100644 testdata/baselines/reference/submodule/compiler/errorSpanForUnclosedJsxTag.js.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/excessiveStackDepthFlatArray.js.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/jsxAttributeWithoutExpressionReact.js.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactory.js.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryNull.js.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/jsxFactoryButNoJsxFragmentFactory.js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences1.js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences2.js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences3.js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/jsxAttributeInitializer(jsx=react).js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/tsxFragmentReactEmit.js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/tsxReactEmit3.js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/tsxReactEmitNesting.js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace.js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/tsxReactEmitWhitespace2.js.diff create mode 100644 testdata/tests/cases/compiler/jsxNestedIndentation.js create mode 100644 testdata/tests/cases/compiler/jsxNestedIndentation.tsx diff --git a/internal/printer/printer.go b/internal/printer/printer.go index 6a1c10b6d8..21ca046e61 100644 --- a/internal/printer/printer.go +++ b/internal/printer/printer.go @@ -783,10 +783,9 @@ func (p *Printer) shouldEmitBlockFunctionBodyOnSingleLine(body *ast.Block) bool } func (p *Printer) shouldEmitOnNewLine(node *ast.Node, format ListFormat) bool { - // !!! TODO: enable multiline emit - // if p.emitContext.EmitFlags(node)&EFStartOnNewLine != 0 { - // return true - // } + if p.emitContext.EmitFlags(node)&EFStartOnNewLine != 0 { + return true + } return format&LFPreferNewLine != 0 } diff --git a/internal/transformers/jsxtransforms/jsx.go b/internal/transformers/jsxtransforms/jsx.go index 3372a23339..2f6915e3ea 100644 --- a/internal/transformers/jsxtransforms/jsx.go +++ b/internal/transformers/jsxtransforms/jsx.go @@ -319,8 +319,9 @@ func (tx *JSXTransformer) convertJsxChildrenToChildrenPropObject(children []*ast } func (tx *JSXTransformer) transformJsxChildToExpression(node *ast.Node) *ast.Node { + prev := tx.inJsxChild tx.setInChild(true) - defer tx.setInChild(false) + defer tx.setInChild(prev) return tx.Visitor().Visit(node) } @@ -688,14 +689,18 @@ func (tx *JSXTransformer) visitJsxOpeningLikeElementCreateElement(element *ast.N for _, c := range children.Nodes { res := tx.transformJsxChildToExpression(c) if res != nil { - if len(children.Nodes) > 1 { - tx.EmitContext().AddEmitFlags(res, printer.EFStartOnNewLine) - } newChildren = append(newChildren, res) } } } + // Add StartOnNewLine flag only if there are multiple actual children (after filtering) + if len(newChildren) > 1 { + for _, child := range newChildren { + tx.EmitContext().AddEmitFlags(child, printer.EFStartOnNewLine) + } + } + args := make([]*ast.Expression, 0, len(newChildren)+2) args = append(args, tagName) args = append(args, objectProperties) @@ -725,14 +730,18 @@ func (tx *JSXTransformer) visitJsxOpeningFragmentCreateElement(fragment *ast.Jsx for _, c := range children.Nodes { res := tx.transformJsxChildToExpression(c) if res != nil { - if len(children.Nodes) > 1 { - tx.EmitContext().AddEmitFlags(res, printer.EFStartOnNewLine) - } newChildren = append(newChildren, res) } } } + // Add StartOnNewLine flag only if there are multiple actual children (after filtering) + if len(newChildren) > 1 { + for _, child := range newChildren { + tx.EmitContext().AddEmitFlags(child, printer.EFStartOnNewLine) + } + } + args := make([]*ast.Expression, 0, len(newChildren)+2) args = append(args, tagName) args = append(args, tx.Factory().NewKeywordExpression(ast.KindNullKeyword)) diff --git a/testdata/baselines/reference/compiler/jsxNestedIndentation.js b/testdata/baselines/reference/compiler/jsxNestedIndentation.js new file mode 100644 index 0000000000..24315ed9a2 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxNestedIndentation.js @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/jsxNestedIndentation.tsx] //// + +//// [jsxNestedIndentation.tsx] +declare var React: any; +declare function Child(props: { children?: any }): any; +function Test() { + return + + + + +} + + +//// [jsxNestedIndentation.js] +function Test() { + return React.createElement(Child, null, + React.createElement(Child, null, + React.createElement(Child, null))); +} diff --git a/testdata/baselines/reference/compiler/jsxNestedIndentation.symbols b/testdata/baselines/reference/compiler/jsxNestedIndentation.symbols new file mode 100644 index 0000000000..630e254a6c --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxNestedIndentation.symbols @@ -0,0 +1,31 @@ +//// [tests/cases/compiler/jsxNestedIndentation.tsx] //// + +=== jsxNestedIndentation.tsx === +declare var React: any; +>React : Symbol(React, Decl(jsxNestedIndentation.tsx, 0, 11)) + +declare function Child(props: { children?: any }): any; +>Child : Symbol(Child, Decl(jsxNestedIndentation.tsx, 0, 23)) +>props : Symbol(props, Decl(jsxNestedIndentation.tsx, 1, 23)) +>children : Symbol(children, Decl(jsxNestedIndentation.tsx, 1, 31)) + +function Test() { +>Test : Symbol(Test, Decl(jsxNestedIndentation.tsx, 1, 55)) + + return +>Child : Symbol(Child, Decl(jsxNestedIndentation.tsx, 0, 23)) + + +>Child : Symbol(Child, Decl(jsxNestedIndentation.tsx, 0, 23)) + + +>Child : Symbol(Child, Decl(jsxNestedIndentation.tsx, 0, 23)) +>Child : Symbol(Child, Decl(jsxNestedIndentation.tsx, 0, 23)) + + +>Child : Symbol(Child, Decl(jsxNestedIndentation.tsx, 0, 23)) + + +>Child : Symbol(Child, Decl(jsxNestedIndentation.tsx, 0, 23)) +} + diff --git a/testdata/baselines/reference/compiler/jsxNestedIndentation.types b/testdata/baselines/reference/compiler/jsxNestedIndentation.types new file mode 100644 index 0000000000..f910202c49 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxNestedIndentation.types @@ -0,0 +1,34 @@ +//// [tests/cases/compiler/jsxNestedIndentation.tsx] //// + +=== jsxNestedIndentation.tsx === +declare var React: any; +>React : any + +declare function Child(props: { children?: any }): any; +>Child : (props: { children?: any; }) => any +>props : { children?: any; } +>children : any + +function Test() { +>Test : () => any + + return +> : any +>Child : (props: { children?: any; }) => any + + +> : any +>Child : (props: { children?: any; }) => any + + +> : any +>Child : (props: { children?: any; }) => any +>Child : (props: { children?: any; }) => any + + +>Child : (props: { children?: any; }) => any + + +>Child : (props: { children?: any; }) => any +} + diff --git a/testdata/baselines/reference/compiler/jsxUnicodeEscapeSequence.js b/testdata/baselines/reference/compiler/jsxUnicodeEscapeSequence.js index a179ad9931..107acc3fb6 100644 --- a/testdata/baselines/reference/compiler/jsxUnicodeEscapeSequence.js +++ b/testdata/baselines/reference/compiler/jsxUnicodeEscapeSequence.js @@ -34,7 +34,9 @@ export const InlineUnicodeChar = () => { }; export const StandaloneUnicodeChar = () => { // This should reproduce the issue - unicode character on its own line - return (_jsxs("div", { children: [_jsx("span", { children: "\u26A0" }), "\u26A0"] })); + return (_jsxs("div", { children: [ + _jsx("span", { children: "\u26A0" }), + "\u26A0"] })); }; export const MultipleUnicodeChars = () => { // Test multiple unicode characters diff --git a/testdata/baselines/reference/submodule/compiler/errorSpanForUnclosedJsxTag.js b/testdata/baselines/reference/submodule/compiler/errorSpanForUnclosedJsxTag.js index 63ec409b0b..81595327fa 100644 --- a/testdata/baselines/reference/submodule/compiler/errorSpanForUnclosedJsxTag.js +++ b/testdata/baselines/reference/submodule/compiler/errorSpanForUnclosedJsxTag.js @@ -18,4 +18,6 @@ let Foo = { Bar() { } }; let Baz = () => { }; -let x = React.createElement(Foo.Bar, null, "Hello let y = ", React.createElement(Baz, null, "Hello")); +let x = React.createElement(Foo.Bar, null, + "Hello let y = ", + React.createElement(Baz, null, "Hello")); diff --git a/testdata/baselines/reference/submodule/compiler/errorSpanForUnclosedJsxTag.js.diff b/testdata/baselines/reference/submodule/compiler/errorSpanForUnclosedJsxTag.js.diff deleted file mode 100644 index d071260647..0000000000 --- a/testdata/baselines/reference/submodule/compiler/errorSpanForUnclosedJsxTag.js.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- old.errorSpanForUnclosedJsxTag.js -+++ new.errorSpanForUnclosedJsxTag.js -@@= skipped -17, +17 lines =@@ - Bar() { } - }; - let Baz = () => { }; --let x = React.createElement(Foo.Bar, null, -- "Hello let y = ", -- React.createElement(Baz, null, "Hello")); -+let x = React.createElement(Foo.Bar, null, "Hello let y = ", React.createElement(Baz, null, "Hello")); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/excessiveStackDepthFlatArray.js b/testdata/baselines/reference/submodule/compiler/excessiveStackDepthFlatArray.js index b6e2180083..13fd6616f4 100644 --- a/testdata/baselines/reference/submodule/compiler/excessiveStackDepthFlatArray.js +++ b/testdata/baselines/reference/submodule/compiler/excessiveStackDepthFlatArray.js @@ -48,6 +48,8 @@ configureStore({ }); const Component = () => { const categories = ['Fruit', 'Vegetables']; - return (React.createElement("ul", null, React.createElement("li", null, "All"), categories.map((category) => (React.createElement("li", { key: category }, category) // Error about 'key' only - )))); + return (React.createElement("ul", null, + React.createElement("li", null, "All"), + categories.map((category) => (React.createElement("li", { key: category }, category) // Error about 'key' only + )))); }; diff --git a/testdata/baselines/reference/submodule/compiler/excessiveStackDepthFlatArray.js.diff b/testdata/baselines/reference/submodule/compiler/excessiveStackDepthFlatArray.js.diff deleted file mode 100644 index 0fd96a87b2..0000000000 --- a/testdata/baselines/reference/submodule/compiler/excessiveStackDepthFlatArray.js.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- old.excessiveStackDepthFlatArray.js -+++ new.excessiveStackDepthFlatArray.js -@@= skipped -47, +47 lines =@@ - }); - const Component = () => { - const categories = ['Fruit', 'Vegetables']; -- return (React.createElement("ul", null, -- React.createElement("li", null, "All"), -- categories.map((category) => (React.createElement("li", { key: category }, category) // Error about 'key' only -- )))); -+ return (React.createElement("ul", null, React.createElement("li", null, "All"), categories.map((category) => (React.createElement("li", { key: category }, category) // Error about 'key' only -+ )))); - }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxAttributeWithoutExpressionReact.js b/testdata/baselines/reference/submodule/compiler/jsxAttributeWithoutExpressionReact.js index 7444e18d4a..c537ca89a1 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxAttributeWithoutExpressionReact.js +++ b/testdata/baselines/reference/submodule/compiler/jsxAttributeWithoutExpressionReact.js @@ -11,4 +11,5 @@ declare var React: any; //// [jsxAttributeWithoutExpressionReact.js] -React.createElement(View, null, React.createElement(ListView, { refreshControl: React.createElement(RefreshControl, { onRefresh: true, refreshing: true }), dataSource: this.state.ds, renderRow: true })); +React.createElement(View, null, + React.createElement(ListView, { refreshControl: React.createElement(RefreshControl, { onRefresh: true, refreshing: true }), dataSource: this.state.ds, renderRow: true })); diff --git a/testdata/baselines/reference/submodule/compiler/jsxAttributeWithoutExpressionReact.js.diff b/testdata/baselines/reference/submodule/compiler/jsxAttributeWithoutExpressionReact.js.diff deleted file mode 100644 index d422561af4..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxAttributeWithoutExpressionReact.js.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.jsxAttributeWithoutExpressionReact.js -+++ new.jsxAttributeWithoutExpressionReact.js -@@= skipped -10, +10 lines =@@ - - - //// [jsxAttributeWithoutExpressionReact.js] --React.createElement(View, null, -- React.createElement(ListView, { refreshControl: React.createElement(RefreshControl, { onRefresh: true, refreshing: true }), dataSource: this.state.ds, renderRow: true })); -+React.createElement(View, null, React.createElement(ListView, { refreshControl: React.createElement(RefreshControl, { onRefresh: true, refreshing: true }), dataSource: this.state.ds, renderRow: true })); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildWrongType.js b/testdata/baselines/reference/submodule/compiler/jsxChildWrongType.js index e98f1efae1..d434ef7198 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildWrongType.js +++ b/testdata/baselines/reference/submodule/compiler/jsxChildWrongType.js @@ -15,4 +15,6 @@ const a = ( //// [index.js] /// /// -const a = (React.createElement("main", null, (React.createElement("div", null)), React.createElement("span", null))); +const a = (React.createElement("main", null, + (React.createElement("div", null)), + React.createElement("span", null))); diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildWrongType.js.diff b/testdata/baselines/reference/submodule/compiler/jsxChildWrongType.js.diff index 60fa1c536d..df3d91292e 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildWrongType.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxChildWrongType.js.diff @@ -7,7 +7,4 @@ -"use strict"; /// /// --const a = (React.createElement("main", null, -- (React.createElement("div", null)), -- React.createElement("span", null))); -+const a = (React.createElement("main", null, (React.createElement("div", null)), React.createElement("span", null))); \ No newline at end of file + const a = (React.createElement("main", null, \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.js b/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.js index 3c3753387f..a01e4ceeae 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.js +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.js @@ -20,4 +20,6 @@ const b = ( //// [index.js] /// /// -const b = (React.createElement(Foo, null, React.createElement("div", null), "aa")); +const b = (React.createElement(Foo, null, + React.createElement("div", null), + "aa")); diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.js.diff b/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.js.diff index 0f17e08fc4..d2845cf221 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.js.diff @@ -7,7 +7,4 @@ -"use strict"; /// /// --const b = (React.createElement(Foo, null, -- React.createElement("div", null), -- "aa")); -+const b = (React.createElement(Foo, null, React.createElement("div", null), "aa")); \ No newline at end of file + const b = (React.createElement(Foo, null, \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenIndividualErrorElaborations.js b/testdata/baselines/reference/submodule/compiler/jsxChildrenIndividualErrorElaborations.js index 0570331206..9d0abff513 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenIndividualErrorElaborations.js +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenIndividualErrorElaborations.js @@ -94,7 +94,9 @@ var a = React.createElement(Blah, null, x => x); // Blah components don't accept text as child elements var a = React.createElement(Blah, null, "Hello unexpected text!"); // Blah components don't accept multiple children. -var a = React.createElement(Blah, null, x => "" + x, x => "" + x); +var a = React.createElement(Blah, null, + x => "" + x, + x => "" + x); function Blah2(props) { return React.createElement(React.Fragment, null); } @@ -103,7 +105,9 @@ var a = React.createElement(Blah2, null, x => x); // Blah2 components don't accept text as child elements var a = React.createElement(Blah2, null, "Hello unexpected text!"); // Blah2 components don't accept multiple children of the wrong type. -var a = React.createElement(Blah2, null, x => x, x => x); +var a = React.createElement(Blah2, null, + x => x, + x => x); function Blah3(props) { return React.createElement(React.Fragment, null); } @@ -112,4 +116,6 @@ var a = React.createElement(Blah3, null, x => x); // Blah3 components don't accept text as child elements var a = React.createElement(Blah3, null, "Hello unexpected text!"); // Blah3 components don't accept multiple children of the wrong type. -var a = React.createElement(Blah3, null, x => x, x => x); +var a = React.createElement(Blah3, null, + x => x, + x => x); diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenIndividualErrorElaborations.js.diff b/testdata/baselines/reference/submodule/compiler/jsxChildrenIndividualErrorElaborations.js.diff index 9240c8544f..cb4108a499 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenIndividualErrorElaborations.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenIndividualErrorElaborations.js.diff @@ -8,34 +8,4 @@ +const React = require("react"); function Blah(props) { return React.createElement(React.Fragment, null); - } -@@= skipped -9, +9 lines =@@ - // Blah components don't accept text as child elements - var a = React.createElement(Blah, null, "Hello unexpected text!"); - // Blah components don't accept multiple children. --var a = React.createElement(Blah, null, -- x => "" + x, -- x => "" + x); -+var a = React.createElement(Blah, null, x => "" + x, x => "" + x); - function Blah2(props) { - return React.createElement(React.Fragment, null); - } -@@= skipped -11, +9 lines =@@ - // Blah2 components don't accept text as child elements - var a = React.createElement(Blah2, null, "Hello unexpected text!"); - // Blah2 components don't accept multiple children of the wrong type. --var a = React.createElement(Blah2, null, -- x => x, -- x => x); -+var a = React.createElement(Blah2, null, x => x, x => x); - function Blah3(props) { - return React.createElement(React.Fragment, null); - } -@@= skipped -11, +9 lines =@@ - // Blah3 components don't accept text as child elements - var a = React.createElement(Blah3, null, "Hello unexpected text!"); - // Blah3 components don't accept multiple children of the wrong type. --var a = React.createElement(Blah3, null, -- x => x, -- x => x); -+var a = React.createElement(Blah3, null, x => x, x => x); \ No newline at end of file + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.js b/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.js index a4dc7e7d0d..4ae637d1c4 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.js +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.js @@ -19,4 +19,6 @@ const b = ( //// [other.js] /// /// -const b = (React.createElement(Foo, null, React.createElement("div", null), "aa")); +const b = (React.createElement(Foo, null, + React.createElement("div", null), + "aa")); diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.js.diff b/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.js.diff index a6b8208467..130688bec5 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.js.diff @@ -7,7 +7,4 @@ -"use strict"; /// /// --const b = (React.createElement(Foo, null, -- React.createElement("div", null), -- "aa")); -+const b = (React.createElement(Foo, null, React.createElement("div", null), "aa")); \ No newline at end of file + const b = (React.createElement(Foo, null, \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react).js b/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react).js index 9961ba8b5a..6272ca29c6 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react).js +++ b/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react).js @@ -27,4 +27,5 @@ const React = require("react"); function Wrapper(props) { return React.createElement("div", null, props.children); } -const element = (React.createElement(Wrapper, null, React.createElement("div", null, "Hello"))); +const element = (React.createElement(Wrapper, null, + React.createElement("div", null, "Hello"))); diff --git a/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react).js.diff b/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react).js.diff index e75b72d689..f92e43abf4 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react).js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxEmptyExpressionNotCountedAsChild(jsx=react).js.diff @@ -8,7 +8,4 @@ +const React = require("react"); function Wrapper(props) { return React.createElement("div", null, props.children); - } --const element = (React.createElement(Wrapper, null, -- React.createElement("div", null, "Hello"))); -+const element = (React.createElement(Wrapper, null, React.createElement("div", null, "Hello"))); \ No newline at end of file + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactory.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactory.js index faba591900..18800eb73b 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactory.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactory.js @@ -9,4 +9,8 @@ declare var Frag: any; //// [jsxFactoryAndJsxFragmentFactory.js] h(Frag, null); -h(Frag, null, h("span", null, "1"), h(Frag, null, h("span", null, "2.1"), h("span", null, "2.2"))); +h(Frag, null, + h("span", null, "1"), + h(Frag, null, + h("span", null, "2.1"), + h("span", null, "2.2"))); diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactory.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactory.js.diff deleted file mode 100644 index 7b47493d91..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactory.js.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.jsxFactoryAndJsxFragmentFactory.js -+++ new.jsxFactoryAndJsxFragmentFactory.js -@@= skipped -8, +8 lines =@@ - - //// [jsxFactoryAndJsxFragmentFactory.js] - h(Frag, null); --h(Frag, null, -- h("span", null, "1"), -- h(Frag, null, -- h("span", null, "2.1"), -- h("span", null, "2.2"))); -+h(Frag, null, h("span", null, "1"), h(Frag, null, h("span", null, "2.1"), h("span", null, "2.2"))); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js index a724406b71..b6882ec8ec 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js @@ -8,4 +8,8 @@ declare var h: any; //// [jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js] h(React.Fragment, null); -h(React.Fragment, null, h("span", null, "1"), h(React.Fragment, null, h("span", null, "2.1"), h("span", null, "2.2"))); +h(React.Fragment, null, + h("span", null, "1"), + h(React.Fragment, null, + h("span", null, "2.1"), + h("span", null, "2.2"))); diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js.diff deleted file mode 100644 index 77b56ccfe3..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js -+++ new.jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js -@@= skipped -7, +7 lines =@@ - - //// [jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js] - h(React.Fragment, null); --h(React.Fragment, null, -- h("span", null, "1"), -- h(React.Fragment, null, -- h("span", null, "2.1"), -- h("span", null, "2.2"))); -+h(React.Fragment, null, h("span", null, "1"), h(React.Fragment, null, h("span", null, "2.1"), h("span", null, "2.2"))); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryNull.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryNull.js index a9d22fd0db..83b4e2ee67 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryNull.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryNull.js @@ -8,4 +8,8 @@ declare var h: any; //// [jsxFactoryAndJsxFragmentFactoryNull.js] h(null, null); -h(null, null, h("span", null, "1"), h(null, null, h("span", null, "2.1"), h("span", null, "2.2"))); +h(null, null, + h("span", null, "1"), + h(null, null, + h("span", null, "2.1"), + h("span", null, "2.2"))); diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryNull.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryNull.js.diff deleted file mode 100644 index 4069a9e30f..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryAndJsxFragmentFactoryNull.js.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.jsxFactoryAndJsxFragmentFactoryNull.js -+++ new.jsxFactoryAndJsxFragmentFactoryNull.js -@@= skipped -7, +7 lines =@@ - - //// [jsxFactoryAndJsxFragmentFactoryNull.js] - h(null, null); --h(null, null, -- h("span", null, "1"), -- h(null, null, -- h("span", null, "2.1"), -- h("span", null, "2.2"))); -+h(null, null, h("span", null, "1"), h(null, null, h("span", null, "2.1"), h("span", null, "2.2"))); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryButNoJsxFragmentFactory.js b/testdata/baselines/reference/submodule/compiler/jsxFactoryButNoJsxFragmentFactory.js index de9f387250..a62a05ca0b 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryButNoJsxFragmentFactory.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFactoryButNoJsxFragmentFactory.js @@ -8,4 +8,8 @@ declare var h: any; //// [jsxFactoryButNoJsxFragmentFactory.js] h(React.Fragment, null); -h(React.Fragment, null, h("span", null, "1"), h(React.Fragment, null, h("span", null, "2.1"), h("span", null, "2.2"))); +h(React.Fragment, null, + h("span", null, "1"), + h(React.Fragment, null, + h("span", null, "2.1"), + h("span", null, "2.2"))); diff --git a/testdata/baselines/reference/submodule/compiler/jsxFactoryButNoJsxFragmentFactory.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFactoryButNoJsxFragmentFactory.js.diff deleted file mode 100644 index 4456fecc25..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxFactoryButNoJsxFragmentFactory.js.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.jsxFactoryButNoJsxFragmentFactory.js -+++ new.jsxFactoryButNoJsxFragmentFactory.js -@@= skipped -7, +7 lines =@@ - - //// [jsxFactoryButNoJsxFragmentFactory.js] - h(React.Fragment, null); --h(React.Fragment, null, -- h("span", null, "1"), -- h(React.Fragment, null, -- h("span", null, "2.1"), -- h("span", null, "2.2"))); -+h(React.Fragment, null, h("span", null, "1"), h(React.Fragment, null, h("span", null, "2.1"), h("span", null, "2.2"))); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryNoUnusedLocals.js b/testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryNoUnusedLocals.js index 72870d3a61..56a90bc5f3 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryNoUnusedLocals.js +++ b/testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryNoUnusedLocals.js @@ -24,5 +24,7 @@ exports.Counter = Counter; const react_1 = require("react"); function Counter({ count = 0 }) { const [cnt, setCnt] = null; - return (0, react_1.createElement)(react_1.Fragment, null, (0, react_1.createElement)("p", null, cnt), (0, react_1.createElement)("button", { onClick: () => setCnt((prev) => prev + 1), type: "button" }, "Update")); + return (0, react_1.createElement)(react_1.Fragment, null, + (0, react_1.createElement)("p", null, cnt), + (0, react_1.createElement)("button", { onClick: () => setCnt((prev) => prev + 1), type: "button" }, "Update")); } diff --git a/testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryNoUnusedLocals.js.diff b/testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryNoUnusedLocals.js.diff index c831aea953..48fafba0da 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryNoUnusedLocals.js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryNoUnusedLocals.js.diff @@ -8,8 +8,4 @@ +const react_1 = require("react"); function Counter({ count = 0 }) { const [cnt, setCnt] = null; -- return (0, react_1.createElement)(react_1.Fragment, null, -- (0, react_1.createElement)("p", null, cnt), -- (0, react_1.createElement)("button", { onClick: () => setCnt((prev) => prev + 1), type: "button" }, "Update")); -+ return (0, react_1.createElement)(react_1.Fragment, null, (0, react_1.createElement)("p", null, cnt), (0, react_1.createElement)("button", { onClick: () => setCnt((prev) => prev + 1), type: "button" }, "Update")); - } \ No newline at end of file + return (0, react_1.createElement)(react_1.Fragment, null, \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react).js b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react).js index 314be06f5a..4caa67cbbc 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react).js +++ b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react).js @@ -43,7 +43,8 @@ exports.selfClosing = exports.frag = exports.HelloWorld = void 0; const React = require("react"); const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); +exports.frag = React.createElement(React.Fragment, null, + React.createElement("div", null)); exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [two.js] "use strict"; @@ -78,7 +79,8 @@ exports.selfClosing = exports.frag = exports.HelloWorld = void 0; const React = require("react"); const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); +exports.frag = React.createElement(React.Fragment, null, + React.createElement("div", null)); exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [index.js] "use strict"; diff --git a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react).js.diff b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react).js.diff index 856c8d095f..69d7992f5e 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react).js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react).js.diff @@ -8,11 +8,8 @@ +const React = require("react"); const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; --exports.frag = React.createElement(React.Fragment, null, -- React.createElement("div", null)); -+exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); - exports.selfClosing = React.createElement("img", { src: "./image.png" }); - //// [two.js] + exports.frag = React.createElement(React.Fragment, null, +@@= skipped -10, +10 lines =@@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.selfClosing = exports.frag = exports.HelloWorld = void 0; @@ -46,7 +43,7 @@ //// [four.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -@@= skipped -36, +35 lines =@@ +@@= skipped -26, +26 lines =@@ /// /* @jsxRuntime automatic */ /* @jsxRuntime classic */ @@ -54,9 +51,4 @@ +const React = require("react"); const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; --exports.frag = React.createElement(React.Fragment, null, -- React.createElement("div", null)); -+exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); - exports.selfClosing = React.createElement("img", { src: "./image.png" }); - //// [index.js] - "use strict"; \ No newline at end of file + exports.frag = React.createElement(React.Fragment, null, \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsx).js b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsx).js index 314be06f5a..4caa67cbbc 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsx).js +++ b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsx).js @@ -43,7 +43,8 @@ exports.selfClosing = exports.frag = exports.HelloWorld = void 0; const React = require("react"); const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); +exports.frag = React.createElement(React.Fragment, null, + React.createElement("div", null)); exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [two.js] "use strict"; @@ -78,7 +79,8 @@ exports.selfClosing = exports.frag = exports.HelloWorld = void 0; const React = require("react"); const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); +exports.frag = React.createElement(React.Fragment, null, + React.createElement("div", null)); exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [index.js] "use strict"; diff --git a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsx).js.diff b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsx).js.diff index 613dd4f759..d267f42d42 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsx).js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsx).js.diff @@ -8,11 +8,8 @@ +const React = require("react"); const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; --exports.frag = React.createElement(React.Fragment, null, -- React.createElement("div", null)); -+exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); - exports.selfClosing = React.createElement("img", { src: "./image.png" }); - //// [two.js] + exports.frag = React.createElement(React.Fragment, null, +@@= skipped -10, +10 lines =@@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.selfClosing = exports.frag = exports.HelloWorld = void 0; @@ -46,7 +43,7 @@ //// [four.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -@@= skipped -36, +35 lines =@@ +@@= skipped -26, +26 lines =@@ /// /* @jsxRuntime automatic */ /* @jsxRuntime classic */ @@ -54,9 +51,4 @@ +const React = require("react"); const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; --exports.frag = React.createElement(React.Fragment, null, -- React.createElement("div", null)); -+exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); - exports.selfClosing = React.createElement("img", { src: "./image.png" }); - //// [index.js] - "use strict"; \ No newline at end of file + exports.frag = React.createElement(React.Fragment, null, \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsxdev).js b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsxdev).js index a0409f1a58..a7b5fb849c 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsxdev).js +++ b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsxdev).js @@ -43,7 +43,8 @@ exports.selfClosing = exports.frag = exports.HelloWorld = void 0; const React = require("react"); const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); +exports.frag = React.createElement(React.Fragment, null, + React.createElement("div", null)); exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [two.js] "use strict"; @@ -78,7 +79,8 @@ exports.selfClosing = exports.frag = exports.HelloWorld = void 0; const React = require("react"); const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; -exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); +exports.frag = React.createElement(React.Fragment, null, + React.createElement("div", null)); exports.selfClosing = React.createElement("img", { src: "./image.png" }); //// [index.js] "use strict"; diff --git a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsxdev).js.diff b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsxdev).js.diff index 5f21695144..20bf9be5a4 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsxdev).js.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxRuntimePragma(jsx=react-jsxdev).js.diff @@ -8,11 +8,8 @@ +const React = require("react"); const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; --exports.frag = React.createElement(React.Fragment, null, -- React.createElement("div", null)); -+exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); - exports.selfClosing = React.createElement("img", { src: "./image.png" }); - //// [two.js] + exports.frag = React.createElement(React.Fragment, null, +@@= skipped -10, +10 lines =@@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.selfClosing = exports.frag = exports.HelloWorld = void 0; @@ -48,7 +45,7 @@ //// [four.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -@@= skipped -38, +35 lines =@@ +@@= skipped -28, +26 lines =@@ /// /* @jsxRuntime automatic */ /* @jsxRuntime classic */ @@ -56,9 +53,4 @@ +const React = require("react"); const HelloWorld = () => React.createElement("h1", null, "Hello world"); exports.HelloWorld = HelloWorld; --exports.frag = React.createElement(React.Fragment, null, -- React.createElement("div", null)); -+exports.frag = React.createElement(React.Fragment, null, React.createElement("div", null)); - exports.selfClosing = React.createElement("img", { src: "./image.png" }); - //// [index.js] - "use strict"; \ No newline at end of file + exports.frag = React.createElement(React.Fragment, null, \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/tsxFragmentChildrenCheck.js b/testdata/baselines/reference/submodule/compiler/tsxFragmentChildrenCheck.js index 5eacef6509..f4c4b661aa 100644 --- a/testdata/baselines/reference/submodule/compiler/tsxFragmentChildrenCheck.js +++ b/testdata/baselines/reference/submodule/compiler/tsxFragmentChildrenCheck.js @@ -44,7 +44,10 @@ const MY_STRING = 'Ceci n\'est pas une string.'; const MY_CLASSNAME = 'jeclass'; class RenderString extends React.PureComponent { render() { - return (React.createElement(React.Fragment, null, React.createElement(my_component_1.MyComponent, null), React.createElement("span", null, MY_STRING), React.createElement("span", { className: MY_CLASSNAME }))); + return (React.createElement(React.Fragment, null, + React.createElement(my_component_1.MyComponent, null), + React.createElement("span", null, MY_STRING), + React.createElement("span", { className: MY_CLASSNAME }))); } } exports.default = RenderString; diff --git a/testdata/baselines/reference/submodule/compiler/tsxFragmentChildrenCheck.js.diff b/testdata/baselines/reference/submodule/compiler/tsxFragmentChildrenCheck.js.diff index faf9661d65..ee5d7d029c 100644 --- a/testdata/baselines/reference/submodule/compiler/tsxFragmentChildrenCheck.js.diff +++ b/testdata/baselines/reference/submodule/compiler/tsxFragmentChildrenCheck.js.diff @@ -10,13 +10,4 @@ +const my_component_1 = require("./my-component"); const MY_STRING = 'Ceci n\'est pas une string.'; const MY_CLASSNAME = 'jeclass'; - class RenderString extends React.PureComponent { - render() { -- return (React.createElement(React.Fragment, null, -- React.createElement(my_component_1.MyComponent, null), -- React.createElement("span", null, MY_STRING), -- React.createElement("span", { className: MY_CLASSNAME }))); -+ return (React.createElement(React.Fragment, null, React.createElement(my_component_1.MyComponent, null), React.createElement("span", null, MY_STRING), React.createElement("span", { className: MY_CLASSNAME }))); - } - } - exports.default = RenderString; \ No newline at end of file + class RenderString extends React.PureComponent { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/checkJsxChildrenCanBeTupleType.js b/testdata/baselines/reference/submodule/conformance/checkJsxChildrenCanBeTupleType.js index be699a9cb6..71b865abce 100644 --- a/testdata/baselines/reference/submodule/conformance/checkJsxChildrenCanBeTupleType.js +++ b/testdata/baselines/reference/submodule/conformance/checkJsxChildrenCanBeTupleType.js @@ -33,5 +33,10 @@ Object.defineProperty(exports, "__esModule", { value: true }); const react_1 = __importDefault(require("react")); class ResizablePanel extends react_1.default.Component { } -const test = react_1.default.createElement(ResizablePanel, null, react_1.default.createElement("div", null), react_1.default.createElement("div", null)); -const testErr = react_1.default.createElement(ResizablePanel, null, react_1.default.createElement("div", null), react_1.default.createElement("div", null), react_1.default.createElement("div", null)); +const test = react_1.default.createElement(ResizablePanel, null, + react_1.default.createElement("div", null), + react_1.default.createElement("div", null)); +const testErr = react_1.default.createElement(ResizablePanel, null, + react_1.default.createElement("div", null), + react_1.default.createElement("div", null), + react_1.default.createElement("div", null)); diff --git a/testdata/baselines/reference/submodule/conformance/checkJsxChildrenCanBeTupleType.js.diff b/testdata/baselines/reference/submodule/conformance/checkJsxChildrenCanBeTupleType.js.diff index f7faf5c777..50f0de8e3c 100644 --- a/testdata/baselines/reference/submodule/conformance/checkJsxChildrenCanBeTupleType.js.diff +++ b/testdata/baselines/reference/submodule/conformance/checkJsxChildrenCanBeTupleType.js.diff @@ -14,12 +14,4 @@ +const react_1 = __importDefault(require("react")); class ResizablePanel extends react_1.default.Component { } --const test = react_1.default.createElement(ResizablePanel, null, -- react_1.default.createElement("div", null), -- react_1.default.createElement("div", null)); --const testErr = react_1.default.createElement(ResizablePanel, null, -- react_1.default.createElement("div", null), -- react_1.default.createElement("div", null), -- react_1.default.createElement("div", null)); -+const test = react_1.default.createElement(ResizablePanel, null, react_1.default.createElement("div", null), react_1.default.createElement("div", null)); -+const testErr = react_1.default.createElement(ResizablePanel, null, react_1.default.createElement("div", null), react_1.default.createElement("div", null), react_1.default.createElement("div", null)); \ No newline at end of file + const test = react_1.default.createElement(ResizablePanel, null, \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences1.js b/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences1.js index c75b9dfe77..7816881f4a 100644 --- a/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences1.js +++ b/testdata/baselines/reference/submodule/conformance/correctlyMarkAliasAsReferences1.js @@ -19,4 +19,5 @@ let k =