From 43f80c444d8310304863ccd55c6ad714f1563d28 Mon Sep 17 00:00:00 2001 From: Frank Wienberg Date: Thu, 29 Sep 2022 10:59:35 +0200 Subject: [PATCH 001/167] [api-extractor-model, api-extractor] Support for 'abstract' modifier Analogous to other ApiItem mixins, the new ApiAbstractMixin adds 'isAbstract' as a property aspect. It is mixed into ApiClass and ApiMethod, the only models that may have an 'abstract' modifier. ApiModelGenerator detects the modifier and adds it to the models. This change updates all generated *.api.json files to include the new "isAbstract" property. --- .../src/generators/ApiModelGenerator.ts | 5 + .../api-documenter-scenarios.api.json | 12 ++ .../etc/api-documenter-test.api.json | 15 +++ .../api-extractor-scenarios.api.json | 1 + .../api-extractor-scenarios.api.json | 1 + .../api-extractor-scenarios.api.json | 11 ++ .../api-extractor-scenarios.api.json | 1 + .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 4 + .../api-extractor-scenarios.api.json | 1 + .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 9 ++ .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 1 + .../api-extractor-scenarios.api.json | 1 + .../api-extractor-scenarios.api.json | 1 + .../api-extractor-scenarios.api.json | 1 + .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 1 + .../api-extractor-scenarios.api.json | 1 + .../api-extractor-scenarios.api.json | 3 + .../api-extractor-scenarios.api.json | 1 + .../api-extractor-scenarios.api.json | 1 + .../api-extractor-scenarios.api.json | 3 + .../api-extractor-scenarios.api.json | 7 ++ .../api-extractor-scenarios.api.json | 4 + .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 1 + .../api-extractor-scenarios.api.json | 3 + .../api-extractor-scenarios.api.json | 6 + .../api-extractor-scenarios.api.json | 3 + .../api-extractor-scenarios.api.json | 5 + common/reviews/api/api-extractor-model.api.md | 29 ++++- libraries/api-extractor-model/src/index.ts | 1 + .../src/mixins/ApiAbstractMixin.ts | 113 ++++++++++++++++++ .../api-extractor-model/src/model/ApiClass.ts | 11 +- .../src/model/ApiMethod.ts | 12 +- 40 files changed, 276 insertions(+), 9 deletions(-) create mode 100644 libraries/api-extractor-model/src/mixins/ApiAbstractMixin.ts diff --git a/apps/api-extractor/src/generators/ApiModelGenerator.ts b/apps/api-extractor/src/generators/ApiModelGenerator.ts index 86500b6c935..9b85b7b70b0 100644 --- a/apps/api-extractor/src/generators/ApiModelGenerator.ts +++ b/apps/api-extractor/src/generators/ApiModelGenerator.ts @@ -385,9 +385,12 @@ export class ApiModelGenerator { const apiItemMetadata: ApiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration); const docComment: tsdoc.DocComment | undefined = apiItemMetadata.tsdocComment; const releaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag; + const isAbstract: boolean = + (ts.getCombinedModifierFlags(classDeclaration) & ts.ModifierFlags.Abstract) !== 0; apiClass = new ApiClass({ name, + isAbstract, docComment, releaseTag, excerptTokens, @@ -705,9 +708,11 @@ export class ApiModelGenerator { const isOptional: boolean = (astDeclaration.astSymbol.followedSymbol.flags & ts.SymbolFlags.Optional) !== 0; const isProtected: boolean = (astDeclaration.modifierFlags & ts.ModifierFlags.Protected) !== 0; + const isAbstract: boolean = (astDeclaration.modifierFlags & ts.ModifierFlags.Abstract) !== 0; apiMethod = new ApiMethod({ name, + isAbstract, docComment, releaseTag, isProtected, diff --git a/build-tests/api-documenter-scenarios/etc/inheritedMembers/api-documenter-scenarios.api.json b/build-tests/api-documenter-scenarios/etc/inheritedMembers/api-documenter-scenarios.api.json index 1fcb80522a6..87c31c3c732 100644 --- a/build-tests/api-documenter-scenarios/etc/inheritedMembers/api-documenter-scenarios.api.json +++ b/build-tests/api-documenter-scenarios/etc/inheritedMembers/api-documenter-scenarios.api.json @@ -196,6 +196,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "Class1", "preserveMemberOrder": false, "members": [ @@ -302,6 +303,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "someOverload" } ], @@ -344,6 +346,7 @@ } } ], + "isAbstract": false, "name": "Class2", "preserveMemberOrder": false, "members": [ @@ -421,6 +424,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "someMethod" }, { @@ -501,6 +505,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "ExtendsAnonymousClass", "preserveMemberOrder": false, "members": [], @@ -530,6 +535,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "ExtendsClassFromAnotherPackage", "preserveMemberOrder": false, "members": [], @@ -559,6 +565,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "ExtendsClassLikeVariable", "preserveMemberOrder": false, "members": [], @@ -588,6 +595,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "ExtendsUnexportedClass", "preserveMemberOrder": false, "members": [], @@ -903,6 +911,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "Class3", "preserveMemberOrder": false, "members": [ @@ -951,6 +960,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "someMethod" }, { @@ -998,6 +1008,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "someOverload" }, { @@ -1045,6 +1056,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "someOverload" }, { diff --git a/build-tests/api-documenter-test/etc/api-documenter-test.api.json b/build-tests/api-documenter-test/etc/api-documenter-test.api.json index e3ae518d1d1..27abda7eacd 100644 --- a/build-tests/api-documenter-test/etc/api-documenter-test.api.json +++ b/build-tests/api-documenter-test/etc/api-documenter-test.api.json @@ -231,6 +231,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "DecoratorExample", "preserveMemberOrder": false, "members": [ @@ -294,6 +295,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "DocBaseClass", "preserveMemberOrder": false, "members": [ @@ -385,6 +387,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "DocClass1", "preserveMemberOrder": false, "members": [ @@ -416,6 +419,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "deprecatedExample" }, { @@ -479,6 +483,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "exampleFunction" }, { @@ -526,6 +531,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "exampleFunction" }, { @@ -604,6 +610,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "genericWithConstraintAndDefault" }, { @@ -634,6 +641,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "interestingEdgeCases" }, { @@ -770,6 +778,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "optionalParamFunction" }, { @@ -921,6 +930,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "sumWithExample" }, { @@ -951,6 +961,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "tableExample" }, { @@ -1038,6 +1049,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "DocClassInterfaceMerge", "preserveMemberOrder": false, "members": [], @@ -1463,6 +1475,7 @@ } } ], + "isAbstract": false, "name": "Generic", "preserveMemberOrder": false, "members": [], @@ -2534,6 +2547,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "SystemEvent", "preserveMemberOrder": false, "members": [ @@ -2582,6 +2596,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "addHandler" } ], diff --git a/build-tests/api-extractor-scenarios/etc/ambientNameConflict2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/ambientNameConflict2/api-extractor-scenarios.api.json index 13fc823e445..f1768ac298e 100644 --- a/build-tests/api-extractor-scenarios/etc/ambientNameConflict2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/ambientNameConflict2/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "Date_2", "preserveMemberOrder": false, "members": [], diff --git a/build-tests/api-extractor-scenarios/etc/ancillaryDeclarations/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/ancillaryDeclarations/api-extractor-scenarios.api.json index dc2a0908811..4262ce5d636 100644 --- a/build-tests/api-extractor-scenarios/etc/ancillaryDeclarations/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/ancillaryDeclarations/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "MyClass", "preserveMemberOrder": false, "members": [], diff --git a/build-tests/api-extractor-scenarios/etc/apiItemKinds/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/apiItemKinds/api-extractor-scenarios.api.json index 5b822e4801b..67c6b8f7d57 100644 --- a/build-tests/api-extractor-scenarios/etc/apiItemKinds/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/apiItemKinds/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": true, "name": "AbstractClass", "preserveMemberOrder": false, "members": [ @@ -214,6 +215,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": true, "name": "member" } ], @@ -243,6 +245,7 @@ } } ], + "isAbstract": false, "name": "ClassWithTypeParameter", "preserveMemberOrder": false, "members": [], @@ -382,6 +385,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "ExtendsClassWithTypeParameter", "preserveMemberOrder": false, "members": [], @@ -474,6 +478,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "SomeClass3", "preserveMemberOrder": false, "members": [], @@ -492,6 +497,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "SomeClass1", "preserveMemberOrder": false, "members": [], @@ -517,6 +523,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "SomeClass2", "preserveMemberOrder": false, "members": [], @@ -537,6 +544,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "SomeClass4", "preserveMemberOrder": false, "members": [], @@ -656,6 +664,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "SimpleClass", "preserveMemberOrder": false, "members": [ @@ -687,6 +696,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "member" }, { @@ -734,6 +744,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "optionalParamMethod" }, { diff --git a/build-tests/api-extractor-scenarios/etc/bundledPackages/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/bundledPackages/api-extractor-scenarios.api.json index f06c0ef3955..5e3cd67309d 100644 --- a/build-tests/api-extractor-scenarios/etc/bundledPackages/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/bundledPackages/api-extractor-scenarios.api.json @@ -254,6 +254,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "Lib1Class", "preserveMemberOrder": false, "members": [ diff --git a/build-tests/api-extractor-scenarios/etc/circularImport/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/circularImport/api-extractor-scenarios.api.json index 18e5df66989..2ce32af8832 100644 --- a/build-tests/api-extractor-scenarios/etc/circularImport/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/circularImport/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "IFile", "preserveMemberOrder": false, "members": [ @@ -230,6 +231,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "IFolder", "preserveMemberOrder": false, "members": [ diff --git a/build-tests/api-extractor-scenarios/etc/circularImport2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/circularImport2/api-extractor-scenarios.api.json index 48a2c25fb89..8f1f2aacc4f 100644 --- a/build-tests/api-extractor-scenarios/etc/circularImport2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/circularImport2/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "A", "preserveMemberOrder": false, "members": [], @@ -199,6 +200,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "B", "preserveMemberOrder": false, "members": [], @@ -215,6 +217,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "IFile", "preserveMemberOrder": false, "members": [ @@ -262,6 +265,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "IFolder", "preserveMemberOrder": false, "members": [ diff --git a/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint/api-extractor-scenarios.api.json index 2ddcd94bcd4..d44a09c3f70 100644 --- a/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "DefaultClass", "preserveMemberOrder": false, "members": [], diff --git a/build-tests/api-extractor-scenarios/etc/docReferences/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/docReferences/api-extractor-scenarios.api.json index 4ccfd7d2936..fe55c0af4d0 100644 --- a/build-tests/api-extractor-scenarios/etc/docReferences/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/docReferences/api-extractor-scenarios.api.json @@ -251,6 +251,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "MyClass", "preserveMemberOrder": false, "members": [ @@ -299,6 +300,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "myMethod" } ], diff --git a/build-tests/api-extractor-scenarios/etc/docReferences2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/docReferences2/api-extractor-scenarios.api.json index ac73eed8be7..3d52e2bd5e2 100644 --- a/build-tests/api-extractor-scenarios/etc/docReferences2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/docReferences2/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "CyclicA", "preserveMemberOrder": false, "members": [ @@ -214,6 +215,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "methodA1" }, { @@ -244,6 +246,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "methodA3" } ], @@ -260,6 +263,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "CyclicB", "preserveMemberOrder": false, "members": [ @@ -291,6 +295,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "methodB2" }, { @@ -321,6 +326,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "methodB4" } ], @@ -337,6 +343,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "FailWithSelfReference", "preserveMemberOrder": false, "members": [ @@ -368,6 +375,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "method1" }, { @@ -398,6 +406,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "method2" } ], diff --git a/build-tests/api-extractor-scenarios/etc/docReferences3/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/docReferences3/api-extractor-scenarios.api.json index d571b9b5007..f3629bcdfad 100644 --- a/build-tests/api-extractor-scenarios/etc/docReferences3/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/docReferences3/api-extractor-scenarios.api.json @@ -241,6 +241,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "B", "preserveMemberOrder": false, "members": [ @@ -272,6 +273,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "myMethod" } ], diff --git a/build-tests/api-extractor-scenarios/etc/docReferencesAlias/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/docReferencesAlias/api-extractor-scenarios.api.json index 4cefa690518..d6b613e1c02 100644 --- a/build-tests/api-extractor-scenarios/etc/docReferencesAlias/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/docReferencesAlias/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "Item", "preserveMemberOrder": false, "members": [ diff --git a/build-tests/api-extractor-scenarios/etc/docReferencesNamespaceAlias/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/docReferencesNamespaceAlias/api-extractor-scenarios.api.json index d04711be940..972e4ad6fc3 100644 --- a/build-tests/api-extractor-scenarios/etc/docReferencesNamespaceAlias/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/docReferencesNamespaceAlias/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "Item", "preserveMemberOrder": false, "members": [ diff --git a/build-tests/api-extractor-scenarios/etc/dynamicImportType/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/dynamicImportType/api-extractor-scenarios.api.json index d83bbf5d8df..02a33184f84 100644 --- a/build-tests/api-extractor-scenarios/etc/dynamicImportType/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/dynamicImportType/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "Item", "preserveMemberOrder": false, "members": [ diff --git a/build-tests/api-extractor-scenarios/etc/ecmaScriptPrivateFields/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/ecmaScriptPrivateFields/api-extractor-scenarios.api.json index dbb4a5ec3e0..5681a9dd2ab 100644 --- a/build-tests/api-extractor-scenarios/etc/ecmaScriptPrivateFields/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/ecmaScriptPrivateFields/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "Example", "preserveMemberOrder": false, "members": [], diff --git a/build-tests/api-extractor-scenarios/etc/excerptTokens/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/excerptTokens/api-extractor-scenarios.api.json index 903319f7eba..17afc47d2e7 100644 --- a/build-tests/api-extractor-scenarios/etc/excerptTokens/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/excerptTokens/api-extractor-scenarios.api.json @@ -205,6 +205,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "MyClass", "preserveMemberOrder": false, "members": [ @@ -269,6 +270,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "someMethod" } ], diff --git a/build-tests/api-extractor-scenarios/etc/exportDuplicate/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/exportDuplicate/api-extractor-scenarios.api.json index e8ef7fafe38..25271089e96 100644 --- a/build-tests/api-extractor-scenarios/etc/exportDuplicate/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/exportDuplicate/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "X", "preserveMemberOrder": false, "members": [], diff --git a/build-tests/api-extractor-scenarios/etc/exportImportedExternalDefault/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/exportImportedExternalDefault/api-extractor-scenarios.api.json index 82f4eca1655..162201491af 100644 --- a/build-tests/api-extractor-scenarios/etc/exportImportedExternalDefault/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/exportImportedExternalDefault/api-extractor-scenarios.api.json @@ -192,6 +192,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "Child", "preserveMemberOrder": false, "members": [], diff --git a/build-tests/api-extractor-scenarios/etc/exportStar/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/exportStar/api-extractor-scenarios.api.json index 34410a430fb..74e78552077 100644 --- a/build-tests/api-extractor-scenarios/etc/exportStar/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/exportStar/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "A", "preserveMemberOrder": false, "members": [], @@ -199,6 +200,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "B", "preserveMemberOrder": false, "members": [], @@ -215,6 +217,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "C", "preserveMemberOrder": false, "members": [], diff --git a/build-tests/api-extractor-scenarios/etc/exportStar2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/exportStar2/api-extractor-scenarios.api.json index 876cc39e167..26ec6d7c7f6 100644 --- a/build-tests/api-extractor-scenarios/etc/exportStar2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/exportStar2/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "A", "preserveMemberOrder": false, "members": [], diff --git a/build-tests/api-extractor-scenarios/etc/exportStar3/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/exportStar3/api-extractor-scenarios.api.json index 876cc39e167..26ec6d7c7f6 100644 --- a/build-tests/api-extractor-scenarios/etc/exportStar3/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/exportStar3/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "A", "preserveMemberOrder": false, "members": [], diff --git a/build-tests/api-extractor-scenarios/etc/functionOverload/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/functionOverload/api-extractor-scenarios.api.json index 0e1499bd192..9de84ccb1aa 100644 --- a/build-tests/api-extractor-scenarios/etc/functionOverload/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/functionOverload/api-extractor-scenarios.api.json @@ -363,6 +363,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "Combiner", "preserveMemberOrder": false, "members": [ @@ -427,6 +428,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "combine" }, { @@ -490,6 +492,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "combine" } ], diff --git a/build-tests/api-extractor-scenarios/etc/includeForgottenExports/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/includeForgottenExports/api-extractor-scenarios.api.json index 637c6966322..edbb7abb825 100644 --- a/build-tests/api-extractor-scenarios/etc/includeForgottenExports/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/includeForgottenExports/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "AnotherDuplicateName_2", "preserveMemberOrder": false, "members": [], @@ -199,6 +200,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "AnotherDuplicateName", "preserveMemberOrder": false, "members": [], @@ -265,6 +267,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "ForgottenExport1", "preserveMemberOrder": false, "members": [ @@ -366,6 +369,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "ForgottenExport5", "preserveMemberOrder": false, "members": [], @@ -384,6 +388,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "ForgottenExport6", "preserveMemberOrder": false, "members": [], @@ -409,6 +414,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "ForgottenExport6", "preserveMemberOrder": false, "members": [], @@ -609,6 +615,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "ForgottenExport3", "preserveMemberOrder": false, "members": [], diff --git a/build-tests/api-extractor-scenarios/etc/internationalCharacters/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/internationalCharacters/api-extractor-scenarios.api.json index 0f2f17b021f..e4ba3e19250 100644 --- a/build-tests/api-extractor-scenarios/etc/internationalCharacters/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/internationalCharacters/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "ClassΞ", "preserveMemberOrder": false, "members": [ @@ -236,6 +237,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "\"invalid chars\"" }, { @@ -284,6 +286,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "memberΔ" }, { @@ -314,6 +317,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "validChars" } ], diff --git a/build-tests/api-extractor-scenarios/etc/mergedDeclarations/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/mergedDeclarations/api-extractor-scenarios.api.json index f79add87f66..a7c535e14af 100644 --- a/build-tests/api-extractor-scenarios/etc/mergedDeclarations/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/mergedDeclarations/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "MergedClassAndInterface", "preserveMemberOrder": false, "members": [ @@ -318,6 +319,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "MergedClassAndNamespace", "preserveMemberOrder": false, "members": [ diff --git a/build-tests/api-extractor-scenarios/etc/mixinPattern/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/mixinPattern/api-extractor-scenarios.api.json index c35001361df..9487791fce5 100644 --- a/build-tests/api-extractor-scenarios/etc/mixinPattern/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/mixinPattern/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "A", "preserveMemberOrder": false, "members": [ @@ -238,6 +239,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "B", "preserveMemberOrder": false, "members": [], diff --git a/build-tests/api-extractor-scenarios/etc/namespaceImports/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/namespaceImports/api-extractor-scenarios.api.json index 4f050369a44..e96d84eb72f 100644 --- a/build-tests/api-extractor-scenarios/etc/namespaceImports/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/namespaceImports/api-extractor-scenarios.api.json @@ -201,6 +201,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "SomeClass", "preserveMemberOrder": false, "members": [], @@ -239,6 +240,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "SomeClass", "preserveMemberOrder": false, "members": [], diff --git a/build-tests/api-extractor-scenarios/etc/namespaceImports2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/namespaceImports2/api-extractor-scenarios.api.json index 1d2843bbcd5..d6c986625f0 100644 --- a/build-tests/api-extractor-scenarios/etc/namespaceImports2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/namespaceImports2/api-extractor-scenarios.api.json @@ -192,6 +192,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "SomeClass", "preserveMemberOrder": false, "members": [], @@ -210,6 +211,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "SomeClass", "preserveMemberOrder": false, "members": [], diff --git a/build-tests/api-extractor-scenarios/etc/readonlyDeclarations/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/readonlyDeclarations/api-extractor-scenarios.api.json index 42af2ebf181..f57c6ba4fa1 100644 --- a/build-tests/api-extractor-scenarios/etc/readonlyDeclarations/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/readonlyDeclarations/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "MyClass", "preserveMemberOrder": false, "members": [ diff --git a/build-tests/api-extractor-scenarios/etc/referenceTokens/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/referenceTokens/api-extractor-scenarios.api.json index 4bc5e0d37a6..90cf5534ac9 100644 --- a/build-tests/api-extractor-scenarios/etc/referenceTokens/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/referenceTokens/api-extractor-scenarios.api.json @@ -390,6 +390,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "SomeClass1", "preserveMemberOrder": false, "members": [ @@ -445,6 +446,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "SomeClass3", "preserveMemberOrder": false, "members": [], @@ -474,6 +476,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "SomeClass4", "preserveMemberOrder": false, "members": [], diff --git a/build-tests/api-extractor-scenarios/etc/spanSorting/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/spanSorting/api-extractor-scenarios.api.json index e59358c5b10..ae49e9e3340 100644 --- a/build-tests/api-extractor-scenarios/etc/spanSorting/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/spanSorting/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "ExampleA", "preserveMemberOrder": false, "members": [ @@ -248,6 +249,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "member2" } ], @@ -264,6 +266,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "ExampleB", "preserveMemberOrder": false, "members": [ @@ -312,6 +315,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "tryLoadFromFile" } ], @@ -328,6 +332,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "ExampleC", "preserveMemberOrder": false, "members": [ @@ -359,6 +364,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "member1" } ], diff --git a/build-tests/api-extractor-scenarios/etc/typeLiterals/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/typeLiterals/api-extractor-scenarios.api.json index bf6587a6a6e..dc79bfb7b35 100644 --- a/build-tests/api-extractor-scenarios/etc/typeLiterals/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/typeLiterals/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "ClassWithTypeLiterals", "preserveMemberOrder": false, "members": [ @@ -231,6 +232,7 @@ } ], "isOptional": false, + "isAbstract": false, "name": "method1" }, { @@ -270,6 +272,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "method2" } ], diff --git a/build-tests/api-extractor-scenarios/etc/typeParameters/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/typeParameters/api-extractor-scenarios.api.json index a7758beb154..68531db38ef 100644 --- a/build-tests/api-extractor-scenarios/etc/typeParameters/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/typeParameters/api-extractor-scenarios.api.json @@ -183,6 +183,7 @@ } ], "releaseTag": "Public", + "isAbstract": false, "name": "ClassWithGenericMethod", "preserveMemberOrder": false, "members": [ @@ -227,6 +228,7 @@ "overloadIndex": 1, "parameters": [], "isOptional": false, + "isAbstract": false, "name": "method" } ], @@ -256,6 +258,7 @@ } } ], + "isAbstract": false, "name": "GenericClass", "preserveMemberOrder": false, "members": [], @@ -293,6 +296,7 @@ } } ], + "isAbstract": false, "name": "GenericClassWithConstraint", "preserveMemberOrder": false, "members": [], @@ -330,6 +334,7 @@ } } ], + "isAbstract": false, "name": "GenericClassWithDefault", "preserveMemberOrder": false, "members": [], diff --git a/common/reviews/api/api-extractor-model.api.md b/common/reviews/api/api-extractor-model.api.md index a9505bde992..f33d24c2135 100644 --- a/common/reviews/api/api-extractor-model.api.md +++ b/common/reviews/api/api-extractor-model.api.md @@ -25,6 +25,23 @@ export class AedocDefinitions { static get tsdocConfiguration(): TSDocConfiguration; } +// @public +export function ApiAbstractMixin(baseClass: TBaseClass): TBaseClass & (new (...args: any[]) => ApiAbstractMixin); + +// @public +export interface ApiAbstractMixin extends ApiItem { + readonly isAbstract: boolean; + // Warning: (ae-forgotten-export) The symbol "IApiItemJson" needs to be exported by the entry point index.d.ts + // + // (undocumented) + serializeInto(jsonObject: Partial): void; +} + +// @public +export namespace ApiAbstractMixin { + export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiAbstractMixin; +} + // Warning: (ae-forgotten-export) The symbol "ApiCallSignature_base" needs to be exported by the entry point index.d.ts // // @public @@ -112,8 +129,6 @@ export class ApiDeclaredItem extends ApiDocumentedItem { // @public export class ApiDocumentedItem extends ApiItem { constructor(options: IApiDocumentedItemOptions); - // Warning: (ae-forgotten-export) The symbol "IApiItemJson" needs to be exported by the entry point index.d.ts - // // @override (undocumented) static onDeserializeInto(options: Partial, context: DeserializerContext, jsonObject: IApiItemJson): void; // Warning: (ae-forgotten-export) The symbol "IApiDocumentedItemJson" needs to be exported by the entry point index.d.ts @@ -718,12 +733,18 @@ export class HeritageType { readonly excerpt: Excerpt; } +// @public +export interface IApiAbstractMixinOptions extends IApiItemOptions { + // (undocumented) + isAbstract: boolean; +} + // @public export interface IApiCallSignatureOptions extends IApiTypeParameterListMixinOptions, IApiParameterListMixinOptions, IApiReleaseTagMixinOptions, IApiReturnTypeMixinOptions, IApiDeclaredItemOptions { } // @public -export interface IApiClassOptions extends IApiItemContainerMixinOptions, IApiNameMixinOptions, IApiReleaseTagMixinOptions, IApiDeclaredItemOptions, IApiTypeParameterListMixinOptions, IApiExportedMixinOptions { +export interface IApiClassOptions extends IApiItemContainerMixinOptions, IApiNameMixinOptions, IApiAbstractMixinOptions, IApiReleaseTagMixinOptions, IApiDeclaredItemOptions, IApiTypeParameterListMixinOptions, IApiExportedMixinOptions { // (undocumented) extendsTokenRange: IExcerptTokenRange | undefined; // (undocumented) @@ -805,7 +826,7 @@ export interface IApiItemOptions { } // @public -export interface IApiMethodOptions extends IApiNameMixinOptions, IApiOptionalMixinOptions, IApiParameterListMixinOptions, IApiProtectedMixinOptions, IApiReleaseTagMixinOptions, IApiReturnTypeMixinOptions, IApiStaticMixinOptions, IApiTypeParameterListMixinOptions, IApiDeclaredItemOptions { +export interface IApiMethodOptions extends IApiNameMixinOptions, IApiAbstractMixinOptions, IApiOptionalMixinOptions, IApiParameterListMixinOptions, IApiProtectedMixinOptions, IApiReleaseTagMixinOptions, IApiReturnTypeMixinOptions, IApiStaticMixinOptions, IApiTypeParameterListMixinOptions, IApiDeclaredItemOptions { } // @public (undocumented) diff --git a/libraries/api-extractor-model/src/index.ts b/libraries/api-extractor-model/src/index.ts index 7e3bf3b9b9e..187d29da142 100644 --- a/libraries/api-extractor-model/src/index.ts +++ b/libraries/api-extractor-model/src/index.ts @@ -30,6 +30,7 @@ export { IApiTypeParameterListMixinOptions, ApiTypeParameterListMixin } from './mixins/ApiTypeParameterListMixin'; +export { IApiAbstractMixinOptions, ApiAbstractMixin } from './mixins/ApiAbstractMixin'; export { IApiItemContainerMixinOptions, ApiItemContainerMixin } from './mixins/ApiItemContainerMixin'; export { IApiProtectedMixinOptions, ApiProtectedMixin } from './mixins/ApiProtectedMixin'; export { IApiReleaseTagMixinOptions, ApiReleaseTagMixin } from './mixins/ApiReleaseTagMixin'; diff --git a/libraries/api-extractor-model/src/mixins/ApiAbstractMixin.ts b/libraries/api-extractor-model/src/mixins/ApiAbstractMixin.ts new file mode 100644 index 00000000000..f73aa84cb50 --- /dev/null +++ b/libraries/api-extractor-model/src/mixins/ApiAbstractMixin.ts @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information.s + +import { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem'; +import { DeserializerContext } from '../model/DeserializerContext'; + +/** + * Constructor options for {@link (ApiAbstractMixin:interface)}. + * @public + */ +export interface IApiAbstractMixinOptions extends IApiItemOptions { + isAbstract: boolean; +} + +export interface IApiAbstractMixinJson extends IApiItemJson { + isAbstract: boolean; +} + +const _isAbstract: unique symbol = Symbol('ApiAbstractMixin._isAbstract'); + +/** + * The mixin base class for API items that have an abstract modifier. + * + * @remarks + * + * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of + * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use + * TypeScript "mixin" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various + * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class + * to extend more than one base class). The "mixin" is a TypeScript merged declaration with three components: + * the function that generates a subclass, an interface that describes the members of the subclass, and + * a namespace containing static members of the class. + * + * @public + */ +// eslint-disable-next-line @typescript-eslint/naming-convention +export interface ApiAbstractMixin extends ApiItem { + /** + * Indicates that the API item's value has an 'abstract' modifier. + */ + readonly isAbstract: boolean; + + serializeInto(jsonObject: Partial): void; +} + +/** + * Mixin function for {@link (ApiAbstractMixin:interface)}. + * + * @param baseClass - The base class to be extended + * @returns A child class that extends baseClass, adding the {@link (ApiAbstractMixin:interface)} + * functionality. + * + * @public + */ +export function ApiAbstractMixin( + baseClass: TBaseClass + // eslint-disable-next-line @typescript-eslint/no-explicit-any +): TBaseClass & (new (...args: any[]) => ApiAbstractMixin) { + class MixedClass extends baseClass implements ApiAbstractMixin { + public [_isAbstract]: boolean; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + public constructor(...args: any[]) { + super(...args); + + const options: IApiAbstractMixinOptions = args[0]; + this[_isAbstract] = options.isAbstract; + } + + /** @override */ + public static onDeserializeInto( + options: Partial, + context: DeserializerContext, + jsonObject: IApiAbstractMixinJson + ): void { + baseClass.onDeserializeInto(options, context, jsonObject); + + options.isAbstract = jsonObject.isAbstract || false; + } + + public get isAbstract(): boolean { + return this[_isAbstract]; + } + + /** @override */ + public serializeInto(jsonObject: Partial): void { + super.serializeInto(jsonObject); + + jsonObject.isAbstract = this.isAbstract; + } + } + + return MixedClass; +} + +/** + * Static members for {@link (ApiAbstractMixin:interface)}. + * @public + */ +export namespace ApiAbstractMixin { + /** + * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiAbstractMixin` mixin. + * + * @remarks + * + * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of + * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however + * the TypeScript type system cannot invoke a runtime test.) + */ + export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiAbstractMixin { + return apiItem.hasOwnProperty(_isAbstract); + } +} diff --git a/libraries/api-extractor-model/src/model/ApiClass.ts b/libraries/api-extractor-model/src/model/ApiClass.ts index d207d96a6b9..6fc51b4bc83 100644 --- a/libraries/api-extractor-model/src/model/ApiClass.ts +++ b/libraries/api-extractor-model/src/model/ApiClass.ts @@ -25,6 +25,11 @@ import { IApiExportedMixinOptions, ApiExportedMixin } from '../mixins/ApiExportedMixin'; +import { + ApiAbstractMixin, + IApiAbstractMixinJson, + IApiAbstractMixinOptions +} from '../mixins/ApiAbstractMixin'; /** * Constructor options for {@link ApiClass}. @@ -33,6 +38,7 @@ import { export interface IApiClassOptions extends IApiItemContainerMixinOptions, IApiNameMixinOptions, + IApiAbstractMixinOptions, IApiReleaseTagMixinOptions, IApiDeclaredItemOptions, IApiTypeParameterListMixinOptions, @@ -43,6 +49,7 @@ export interface IApiClassOptions export interface IApiClassJson extends IApiDeclaredItemJson, + IApiAbstractMixinJson, IApiTypeParameterListMixinJson, IApiExportedMixinJson { extendsTokenRange?: IExcerptTokenRange; @@ -66,7 +73,9 @@ export interface IApiClassJson * @public */ export class ApiClass extends ApiItemContainerMixin( - ApiNameMixin(ApiTypeParameterListMixin(ApiReleaseTagMixin(ApiExportedMixin(ApiDeclaredItem)))) + ApiNameMixin( + ApiAbstractMixin(ApiTypeParameterListMixin(ApiReleaseTagMixin(ApiExportedMixin(ApiDeclaredItem)))) + ) ) { /** * The base class that this class inherits from (using the `extends` keyword), or undefined if there is no base class. diff --git a/libraries/api-extractor-model/src/model/ApiMethod.ts b/libraries/api-extractor-model/src/model/ApiMethod.ts index c5b71ae03a5..ea3a5fd576d 100644 --- a/libraries/api-extractor-model/src/model/ApiMethod.ts +++ b/libraries/api-extractor-model/src/model/ApiMethod.ts @@ -15,6 +15,7 @@ import { IApiParameterListMixinOptions, ApiParameterListMixin } from '../mixins/ import { IApiReleaseTagMixinOptions, ApiReleaseTagMixin } from '../mixins/ApiReleaseTagMixin'; import { ApiReturnTypeMixin, IApiReturnTypeMixinOptions } from '../mixins/ApiReturnTypeMixin'; import { IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin'; +import { IApiAbstractMixinOptions, ApiAbstractMixin } from '../mixins/ApiAbstractMixin'; import { ApiTypeParameterListMixin, IApiTypeParameterListMixinOptions @@ -27,6 +28,7 @@ import { ApiOptionalMixin, IApiOptionalMixinOptions } from '../mixins/ApiOptiona */ export interface IApiMethodOptions extends IApiNameMixinOptions, + IApiAbstractMixinOptions, IApiOptionalMixinOptions, IApiParameterListMixinOptions, IApiProtectedMixinOptions, @@ -58,10 +60,12 @@ export interface IApiMethodOptions * @public */ export class ApiMethod extends ApiNameMixin( - ApiOptionalMixin( - ApiParameterListMixin( - ApiProtectedMixin( - ApiReleaseTagMixin(ApiReturnTypeMixin(ApiStaticMixin(ApiTypeParameterListMixin(ApiDeclaredItem)))) + ApiAbstractMixin( + ApiOptionalMixin( + ApiParameterListMixin( + ApiProtectedMixin( + ApiReleaseTagMixin(ApiReturnTypeMixin(ApiStaticMixin(ApiTypeParameterListMixin(ApiDeclaredItem)))) + ) ) ) ) From b1460474eec355290890a5f511ebbbed1f9e32bd Mon Sep 17 00:00:00 2001 From: Frank Wienberg Date: Thu, 29 Sep 2022 11:06:57 +0200 Subject: [PATCH 002/167] [api-documenter] Add 'abstract' to "Modifiers" column Generate "abstract" if an API item has the ApiAbstractMixin and 'isAbstract' is true. So far, this only works for methods, since the classes overview table does not have a "Modifiers" column. --- .../api-documenter/src/documenters/MarkdownDocumenter.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/api-documenter/src/documenters/MarkdownDocumenter.ts b/apps/api-documenter/src/documenters/MarkdownDocumenter.ts index e8f374c476d..f750e546866 100644 --- a/apps/api-documenter/src/documenters/MarkdownDocumenter.ts +++ b/apps/api-documenter/src/documenters/MarkdownDocumenter.ts @@ -32,6 +32,7 @@ import { ApiPropertyItem, ApiInterface, Excerpt, + ApiAbstractMixin, ApiParameterListMixin, ApiReturnTypeMixin, ApiDeclaredItem, @@ -1057,6 +1058,14 @@ export class MarkdownDocumenter { } } + if (ApiAbstractMixin.isBaseClassOf(apiItem)) { + if (apiItem.isAbstract) { + section.appendNode( + new DocParagraph({ configuration }, [new DocCodeSpan({ configuration, code: 'abstract' })]) + ); + } + } + return new DocTableCell({ configuration }, section.nodes); } From 66932f60de5dd518e96bc9c6529f03d76520dece Mon Sep 17 00:00:00 2001 From: Frank Wienberg Date: Thu, 29 Sep 2022 11:08:46 +0200 Subject: [PATCH 003/167] [api-documenter] Separate "Abstract Classes" overview table Split classes into abstract and non-abstract classes and add a separate overview table for "Abstract Classes". The alternative would be to add a "Modifiers" column to the existing "Classes" overview table. --- .../src/documenters/MarkdownDocumenter.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/apps/api-documenter/src/documenters/MarkdownDocumenter.ts b/apps/api-documenter/src/documenters/MarkdownDocumenter.ts index f750e546866..4f441361e2a 100644 --- a/apps/api-documenter/src/documenters/MarkdownDocumenter.ts +++ b/apps/api-documenter/src/documenters/MarkdownDocumenter.ts @@ -503,6 +503,11 @@ export class MarkdownDocumenter { private _writePackageOrNamespaceTables(output: DocSection, apiContainer: ApiPackage | ApiNamespace): void { const configuration: TSDocConfiguration = this._tsdocConfiguration; + const abstractClassesTable: DocTable = new DocTable({ + configuration, + headerTitles: ['Abstract Class', 'Description'] + }); + const classesTable: DocTable = new DocTable({ configuration, headerTitles: ['Class', 'Description'] @@ -551,7 +556,11 @@ export class MarkdownDocumenter { switch (apiMember.kind) { case ApiItemKind.Class: - classesTable.addRow(row); + if (ApiAbstractMixin.isBaseClassOf(apiMember) && apiMember.isAbstract) { + abstractClassesTable.addRow(row); + } else { + classesTable.addRow(row); + } this._writeApiItemPage(apiMember); break; @@ -592,6 +601,11 @@ export class MarkdownDocumenter { output.appendNode(classesTable); } + if (abstractClassesTable.rows.length > 0) { + output.appendNode(new DocHeading({ configuration, title: 'Abstract Classes' })); + output.appendNode(abstractClassesTable); + } + if (enumerationsTable.rows.length > 0) { output.appendNode(new DocHeading({ configuration, title: 'Enumerations' })); output.appendNode(enumerationsTable); From c4c0d53c79d1e4e90f15756facb3deb8a254d765 Mon Sep 17 00:00:00 2001 From: Frank Wienberg Date: Tue, 18 Oct 2022 13:35:00 +0200 Subject: [PATCH 004/167] [api-extractor-model, api-extractor] Support for 'abstract' modifier also for ApiProperty When adding 'abstract' for classes and methods, @zelliott mentioned that properties can have this modifier, too. Thus, ApiProperty must be extended just like ApiMethod and ApiClass, and ApiModelGenerator must extract the 'abstract' modifier into the ApiProperty model. Expected test results change accordingly. --- .../src/generators/ApiModelGenerator.ts | 2 ++ .../api-documenter-scenarios.api.json | 15 +++++++---- .../etc/api-documenter-test.api.json | 27 ++++++++++++------- .../api-extractor-scenarios.api.json | 12 ++++++--- .../api-extractor-scenarios.api.json | 6 +++-- .../api-extractor-scenarios.api.json | 9 ++++--- .../api-extractor-scenarios.api.json | 9 ++++--- .../api-extractor-scenarios.api.json | 3 ++- .../api-extractor-scenarios.api.json | 3 ++- .../api-extractor-scenarios.api.json | 15 +++++++---- .../api-extractor-scenarios.api.json | 3 ++- .../api-extractor-scenarios.api.json | 6 +++-- .../api-extractor-scenarios.api.json | 3 ++- .../api-extractor-scenarios.api.json | 15 +++++++---- .../api-extractor-scenarios.api.json | 3 ++- .../api-extractor-scenarios.api.json | 3 ++- common/reviews/api/api-extractor-model.api.md | 2 +- .../src/model/ApiProperty.ts | 6 ++++- 18 files changed, 96 insertions(+), 46 deletions(-) diff --git a/apps/api-extractor/src/generators/ApiModelGenerator.ts b/apps/api-extractor/src/generators/ApiModelGenerator.ts index 9b85b7b70b0..4f37a1b8242 100644 --- a/apps/api-extractor/src/generators/ApiModelGenerator.ts +++ b/apps/api-extractor/src/generators/ApiModelGenerator.ts @@ -844,12 +844,14 @@ export class ApiModelGenerator { const isOptional: boolean = (astDeclaration.astSymbol.followedSymbol.flags & ts.SymbolFlags.Optional) !== 0; const isProtected: boolean = (astDeclaration.modifierFlags & ts.ModifierFlags.Protected) !== 0; + const isAbstract: boolean = (astDeclaration.modifierFlags & ts.ModifierFlags.Abstract) !== 0; const isReadonly: boolean = this._isReadonly(astDeclaration); apiProperty = new ApiProperty({ name, docComment, releaseTag, + isAbstract, isProtected, isStatic, isOptional, diff --git a/build-tests/api-documenter-scenarios/etc/inheritedMembers/api-documenter-scenarios.api.json b/build-tests/api-documenter-scenarios/etc/inheritedMembers/api-documenter-scenarios.api.json index 87c31c3c732..a372066f77e 100644 --- a/build-tests/api-documenter-scenarios/etc/inheritedMembers/api-documenter-scenarios.api.json +++ b/build-tests/api-documenter-scenarios/etc/inheritedMembers/api-documenter-scenarios.api.json @@ -227,7 +227,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -256,7 +257,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Method", @@ -377,7 +379,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Method", @@ -454,7 +457,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "extendsTokenRange": { @@ -1086,7 +1090,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "implementsTokenRanges": [] diff --git a/build-tests/api-documenter-test/etc/api-documenter-test.api.json b/build-tests/api-documenter-test/etc/api-documenter-test.api.json index 27abda7eacd..901a3c71b6b 100644 --- a/build-tests/api-documenter-test/etc/api-documenter-test.api.json +++ b/build-tests/api-documenter-test/etc/api-documenter-test.api.json @@ -263,7 +263,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "implementsTokenRanges": [] @@ -672,7 +673,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -702,7 +704,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -731,7 +734,8 @@ "endIndex": 2 }, "isStatic": true, - "isProtected": true + "isProtected": true, + "isAbstract": false }, { "kind": "Method", @@ -808,7 +812,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": true + "isProtected": true, + "isAbstract": false }, { "kind": "Property", @@ -837,7 +842,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -867,7 +873,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Method", @@ -991,7 +998,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -1020,7 +1028,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "extendsTokenRange": { diff --git a/build-tests/api-extractor-scenarios/etc/apiItemKinds/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/apiItemKinds/api-extractor-scenarios.api.json index 67c6b8f7d57..c6b8f1b778f 100644 --- a/build-tests/api-extractor-scenarios/etc/apiItemKinds/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/apiItemKinds/api-extractor-scenarios.api.json @@ -774,7 +774,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -807,7 +808,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -836,7 +838,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -865,7 +868,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "implementsTokenRanges": [] diff --git a/build-tests/api-extractor-scenarios/etc/bundledPackages/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/bundledPackages/api-extractor-scenarios.api.json index 5e3cd67309d..3d2cfb44107 100644 --- a/build-tests/api-extractor-scenarios/etc/bundledPackages/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/bundledPackages/api-extractor-scenarios.api.json @@ -285,7 +285,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -314,7 +315,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "extendsTokenRange": { diff --git a/build-tests/api-extractor-scenarios/etc/circularImport/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/circularImport/api-extractor-scenarios.api.json index 2ce32af8832..823cfd6a0c6 100644 --- a/build-tests/api-extractor-scenarios/etc/circularImport/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/circularImport/api-extractor-scenarios.api.json @@ -215,7 +215,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "implementsTokenRanges": [] @@ -267,7 +268,8 @@ "endIndex": 3 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -301,7 +303,8 @@ "endIndex": 3 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "implementsTokenRanges": [] diff --git a/build-tests/api-extractor-scenarios/etc/circularImport2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/circularImport2/api-extractor-scenarios.api.json index 8f1f2aacc4f..6b695b554c6 100644 --- a/build-tests/api-extractor-scenarios/etc/circularImport2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/circularImport2/api-extractor-scenarios.api.json @@ -249,7 +249,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "implementsTokenRanges": [] @@ -301,7 +302,8 @@ "endIndex": 3 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -335,7 +337,8 @@ "endIndex": 3 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "implementsTokenRanges": [] diff --git a/build-tests/api-extractor-scenarios/etc/docReferencesAlias/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/docReferencesAlias/api-extractor-scenarios.api.json index d6b613e1c02..d94419567fe 100644 --- a/build-tests/api-extractor-scenarios/etc/docReferencesAlias/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/docReferencesAlias/api-extractor-scenarios.api.json @@ -215,7 +215,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "implementsTokenRanges": [] diff --git a/build-tests/api-extractor-scenarios/etc/docReferencesNamespaceAlias/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/docReferencesNamespaceAlias/api-extractor-scenarios.api.json index 972e4ad6fc3..5d4f156922f 100644 --- a/build-tests/api-extractor-scenarios/etc/docReferencesNamespaceAlias/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/docReferencesNamespaceAlias/api-extractor-scenarios.api.json @@ -215,7 +215,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "implementsTokenRanges": [] diff --git a/build-tests/api-extractor-scenarios/etc/dynamicImportType/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/dynamicImportType/api-extractor-scenarios.api.json index 02a33184f84..2c417144b22 100644 --- a/build-tests/api-extractor-scenarios/etc/dynamicImportType/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/dynamicImportType/api-extractor-scenarios.api.json @@ -219,7 +219,8 @@ "endIndex": 3 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -253,7 +254,8 @@ "endIndex": 3 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -287,7 +289,8 @@ "endIndex": 3 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -321,7 +324,8 @@ "endIndex": 3 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -355,7 +359,8 @@ "endIndex": 3 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "implementsTokenRanges": [] diff --git a/build-tests/api-extractor-scenarios/etc/includeForgottenExports/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/includeForgottenExports/api-extractor-scenarios.api.json index edbb7abb825..4bc46aacf00 100644 --- a/build-tests/api-extractor-scenarios/etc/includeForgottenExports/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/includeForgottenExports/api-extractor-scenarios.api.json @@ -314,7 +314,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "implementsTokenRanges": [] diff --git a/build-tests/api-extractor-scenarios/etc/mergedDeclarations/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/mergedDeclarations/api-extractor-scenarios.api.json index a7c535e14af..bea8571066d 100644 --- a/build-tests/api-extractor-scenarios/etc/mergedDeclarations/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/mergedDeclarations/api-extractor-scenarios.api.json @@ -214,7 +214,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "implementsTokenRanges": [] @@ -350,7 +351,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "implementsTokenRanges": [] diff --git a/build-tests/api-extractor-scenarios/etc/mixinPattern/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/mixinPattern/api-extractor-scenarios.api.json index 9487791fce5..81022be8737 100644 --- a/build-tests/api-extractor-scenarios/etc/mixinPattern/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/mixinPattern/api-extractor-scenarios.api.json @@ -214,7 +214,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "implementsTokenRanges": [] diff --git a/build-tests/api-extractor-scenarios/etc/readonlyDeclarations/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/readonlyDeclarations/api-extractor-scenarios.api.json index f57c6ba4fa1..35df379d2f1 100644 --- a/build-tests/api-extractor-scenarios/etc/readonlyDeclarations/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/readonlyDeclarations/api-extractor-scenarios.api.json @@ -214,7 +214,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -243,7 +244,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Property", @@ -272,7 +274,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "implementsTokenRanges": [] @@ -318,7 +321,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "IndexSignature", @@ -418,7 +422,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "extendsTokenRanges": [] diff --git a/build-tests/api-extractor-scenarios/etc/referenceTokens/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/referenceTokens/api-extractor-scenarios.api.json index 90cf5534ac9..b8c1d0f29a0 100644 --- a/build-tests/api-extractor-scenarios/etc/referenceTokens/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/referenceTokens/api-extractor-scenarios.api.json @@ -421,7 +421,8 @@ "endIndex": 2 }, "isStatic": true, - "isProtected": false + "isProtected": false, + "isAbstract": false } ], "implementsTokenRanges": [] diff --git a/build-tests/api-extractor-scenarios/etc/spanSorting/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/spanSorting/api-extractor-scenarios.api.json index ae49e9e3340..f95c5f66538 100644 --- a/build-tests/api-extractor-scenarios/etc/spanSorting/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/spanSorting/api-extractor-scenarios.api.json @@ -214,7 +214,8 @@ "endIndex": 2 }, "isStatic": false, - "isProtected": false + "isProtected": false, + "isAbstract": false }, { "kind": "Method", diff --git a/common/reviews/api/api-extractor-model.api.md b/common/reviews/api/api-extractor-model.api.md index f33d24c2135..7948e5cbaa0 100644 --- a/common/reviews/api/api-extractor-model.api.md +++ b/common/reviews/api/api-extractor-model.api.md @@ -887,7 +887,7 @@ export interface IApiPropertyItemOptions extends IApiNameMixinOptions, IApiRelea } // @public -export interface IApiPropertyOptions extends IApiPropertyItemOptions, IApiProtectedMixinOptions, IApiStaticMixinOptions, IApiInitializerMixinOptions { +export interface IApiPropertyOptions extends IApiPropertyItemOptions, IApiAbstractMixinOptions, IApiProtectedMixinOptions, IApiStaticMixinOptions, IApiInitializerMixinOptions { } // @public diff --git a/libraries/api-extractor-model/src/model/ApiProperty.ts b/libraries/api-extractor-model/src/model/ApiProperty.ts index 23aa832ffb1..f198a96dd5b 100644 --- a/libraries/api-extractor-model/src/model/ApiProperty.ts +++ b/libraries/api-extractor-model/src/model/ApiProperty.ts @@ -8,6 +8,7 @@ import { Component } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference'; import { ApiItemKind } from '../items/ApiItem'; +import { ApiAbstractMixin, IApiAbstractMixinOptions } from '../mixins/ApiAbstractMixin'; import { ApiProtectedMixin, IApiProtectedMixinOptions } from '../mixins/ApiProtectedMixin'; import { ApiStaticMixin, IApiStaticMixinOptions } from '../mixins/ApiStaticMixin'; import { ApiInitializerMixin, IApiInitializerMixinOptions } from '../mixins/ApiInitializerMixin'; @@ -19,6 +20,7 @@ import { ApiPropertyItem, IApiPropertyItemOptions } from '../items/ApiPropertyIt */ export interface IApiPropertyOptions extends IApiPropertyItemOptions, + IApiAbstractMixinOptions, IApiProtectedMixinOptions, IApiStaticMixinOptions, IApiInitializerMixinOptions {} @@ -57,7 +59,9 @@ export interface IApiPropertyOptions * * @public */ -export class ApiProperty extends ApiProtectedMixin(ApiStaticMixin(ApiInitializerMixin(ApiPropertyItem))) { +export class ApiProperty extends ApiAbstractMixin( + ApiProtectedMixin(ApiStaticMixin(ApiInitializerMixin(ApiPropertyItem))) +) { public constructor(options: IApiPropertyOptions) { super(options); } From 2088fd38b0766ab3c2273bb8d1e184dd16cc2ccd Mon Sep 17 00:00:00 2001 From: Frank Wienberg Date: Tue, 18 Oct 2022 14:21:23 +0200 Subject: [PATCH 005/167] Add new ApiJsonSchemaVersion (V_1011) for 'isAbstract' field --- .../src/model/DeserializerContext.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libraries/api-extractor-model/src/model/DeserializerContext.ts b/libraries/api-extractor-model/src/model/DeserializerContext.ts index 6c1d6fab487..b50aa8b1a68 100644 --- a/libraries/api-extractor-model/src/model/DeserializerContext.ts +++ b/libraries/api-extractor-model/src/model/DeserializerContext.ts @@ -82,13 +82,21 @@ export enum ApiJsonSchemaVersion { */ V_1010 = 1010, + /** + * Add an `isAbstract` field to `ApiClass`, `ApiMethod`, and `ApiProperty` to + * track whether the item is abstract. + * + * When loading older JSON files, the value defaults to `false`. + */ + V_1011 = 1011, + /** * The current latest .api.json schema version. * * IMPORTANT: When incrementing this number, consider whether `OLDEST_SUPPORTED` or `OLDEST_FORWARDS_COMPATIBLE` * should be updated. */ - LATEST = V_1010, + LATEST = V_1011, /** * The oldest .api.json schema version that is still supported for backwards compatibility. From dc41cb57f233242914ab0159c22a6b250d927d84 Mon Sep 17 00:00:00 2001 From: Frank Wienberg Date: Tue, 18 Oct 2022 14:34:25 +0200 Subject: [PATCH 006/167] Add change log entries for new 'isAbstract' field The support to track and render 'abstract' modifiers on classes, methods, and properties affects api-extractor-model, api-extractor, and api-documenter. --- ...ber-support-abstract-modifier_2022-10-18-12-29.json | 10 ++++++++++ ...ber-support-abstract-modifier_2022-10-18-12-29.json | 10 ++++++++++ ...ber-support-abstract-modifier_2022-10-18-12-29.json | 10 ++++++++++ 3 files changed, 30 insertions(+) create mode 100644 common/changes/@microsoft/api-documenter/fwienber-support-abstract-modifier_2022-10-18-12-29.json create mode 100644 common/changes/@microsoft/api-extractor-model/fwienber-support-abstract-modifier_2022-10-18-12-29.json create mode 100644 common/changes/@microsoft/api-extractor/fwienber-support-abstract-modifier_2022-10-18-12-29.json diff --git a/common/changes/@microsoft/api-documenter/fwienber-support-abstract-modifier_2022-10-18-12-29.json b/common/changes/@microsoft/api-documenter/fwienber-support-abstract-modifier_2022-10-18-12-29.json new file mode 100644 index 00000000000..471188587c6 --- /dev/null +++ b/common/changes/@microsoft/api-documenter/fwienber-support-abstract-modifier_2022-10-18-12-29.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/api-documenter", + "comment": "Fix #3661: Render 'abstract' modifier for classes and members", + "type": "minor" + } + ], + "packageName": "@microsoft/api-documenter" +} \ No newline at end of file diff --git a/common/changes/@microsoft/api-extractor-model/fwienber-support-abstract-modifier_2022-10-18-12-29.json b/common/changes/@microsoft/api-extractor-model/fwienber-support-abstract-modifier_2022-10-18-12-29.json new file mode 100644 index 00000000000..a9523fbd575 --- /dev/null +++ b/common/changes/@microsoft/api-extractor-model/fwienber-support-abstract-modifier_2022-10-18-12-29.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/api-extractor-model", + "comment": "Fix #3661: New field 'isAbstract' to track 'abstract' modifier in 'ApiClass', 'ApiMethod', and 'ApiProperty' via 'ApiAbstractMixin'", + "type": "minor" + } + ], + "packageName": "@microsoft/api-extractor-model" +} \ No newline at end of file diff --git a/common/changes/@microsoft/api-extractor/fwienber-support-abstract-modifier_2022-10-18-12-29.json b/common/changes/@microsoft/api-extractor/fwienber-support-abstract-modifier_2022-10-18-12-29.json new file mode 100644 index 00000000000..e7caf61702e --- /dev/null +++ b/common/changes/@microsoft/api-extractor/fwienber-support-abstract-modifier_2022-10-18-12-29.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/api-extractor", + "comment": "Fix #3661: Track 'abstract' modifier of classes, methods, and properties in new field 'isAbstract'", + "type": "minor" + } + ], + "packageName": "@microsoft/api-extractor" +} \ No newline at end of file From 5a7e4dbea1130204517bac7dc099b61c7cfb64a3 Mon Sep 17 00:00:00 2001 From: Frank Wienberg Date: Tue, 18 Oct 2022 15:07:04 +0200 Subject: [PATCH 007/167] [api-documenter] Change modifier output order to match TypeScript syntax Unlike other languages like Java, in TypeScript, the order of modifiers is defined strictly. Currently, it looks like api-documenter uses alphabetical order, which is not the correct TypeScript modifier order. It seems the correct order is (`public` | `protected` | `private`)? (`static`? | `abstract`?) `override`? `readonly`? No member can be `static` and `abstract` at the same time, so the order of these two does not matter. api-documenter currently only uses `protected`, `static`, `abstract` (new in this PR) and `readonly`, so `public` (default!), `private` (no API!) and `override` (maybe interesting for navigation, but not as a modifier) do not apply. Added a code comment about the order and moved `readonly` to the last position so that the overall modifier output order now matches TypeScript syntax. --- .../src/documenters/MarkdownDocumenter.ts | 20 +++++++++++-------- .../markdown/api-documenter-test.docclass1.md | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/apps/api-documenter/src/documenters/MarkdownDocumenter.ts b/apps/api-documenter/src/documenters/MarkdownDocumenter.ts index 4f441361e2a..e2f3afdf7d9 100644 --- a/apps/api-documenter/src/documenters/MarkdownDocumenter.ts +++ b/apps/api-documenter/src/documenters/MarkdownDocumenter.ts @@ -1048,6 +1048,10 @@ export class MarkdownDocumenter { const section: DocSection = new DocSection({ configuration }); + // Output modifiers in syntactically correct order: first access modifier (here: `protected`), then + // `static` or `abstract` (no member can be both, so the order between the two of them does not matter), + // last `readonly`. If `override` was supported, it would go directly before `readonly`. + if (ApiProtectedMixin.isBaseClassOf(apiItem)) { if (apiItem.isProtected) { section.appendNode( @@ -1056,14 +1060,6 @@ export class MarkdownDocumenter { } } - if (ApiReadonlyMixin.isBaseClassOf(apiItem)) { - if (apiItem.isReadonly) { - section.appendNode( - new DocParagraph({ configuration }, [new DocCodeSpan({ configuration, code: 'readonly' })]) - ); - } - } - if (ApiStaticMixin.isBaseClassOf(apiItem)) { if (apiItem.isStatic) { section.appendNode( @@ -1080,6 +1076,14 @@ export class MarkdownDocumenter { } } + if (ApiReadonlyMixin.isBaseClassOf(apiItem)) { + if (apiItem.isReadonly) { + section.appendNode( + new DocParagraph({ configuration }, [new DocCodeSpan({ configuration, code: 'readonly' })]) + ); + } + } + return new DocTableCell({ configuration }, section.nodes); } diff --git a/build-tests/api-documenter-test/etc/markdown/api-documenter-test.docclass1.md b/build-tests/api-documenter-test/etc/markdown/api-documenter-test.docclass1.md index 4ae28213699..f5c16d25f12 100644 --- a/build-tests/api-documenter-test/etc/markdown/api-documenter-test.docclass1.md +++ b/build-tests/api-documenter-test/etc/markdown/api-documenter-test.docclass1.md @@ -35,7 +35,7 @@ The constructor for this class is marked as internal. Third-party code should no | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [multipleModifiersProperty](./api-documenter-test.docclass1.multiplemodifiersproperty.md) |

protected

readonly

static

| boolean | Some property with multiple modifiers. | +| [multipleModifiersProperty](./api-documenter-test.docclass1.multiplemodifiersproperty.md) |

protected

static

readonly

| boolean | Some property with multiple modifiers. | | [protectedProperty](./api-documenter-test.docclass1.protectedproperty.md) | protected | string | Some protected property. | | [readonlyProperty](./api-documenter-test.docclass1.readonlyproperty.md) | readonly | string | | | [regularProperty](./api-documenter-test.docclass1.regularproperty.md) | | [SystemEvent](./api-documenter-test.systemevent.md) | This is a regular property that happens to use the SystemEvent type. | From c1e886ae53bf54ec5eb83269170747da1ddf6eec Mon Sep 17 00:00:00 2001 From: Frank Wienberg Date: Tue, 18 Oct 2022 18:00:54 +0200 Subject: [PATCH 008/167] Regenerate expected test data after updating schemaVersion The schema version was updated from 1010 to 1011 in 2088fd38, so this changed should be squashed with 2088fd38. --- .../etc/inheritedMembers/api-documenter-scenarios.api.json | 2 +- .../api-documenter-test/etc/api-documenter-test.api.json | 2 +- .../etc/ambientNameConflict/api-extractor-scenarios.api.json | 2 +- .../etc/ambientNameConflict2/api-extractor-scenarios.api.json | 2 +- .../etc/ancillaryDeclarations/api-extractor-scenarios.api.json | 2 +- .../etc/apiItemKinds/api-extractor-scenarios.api.json | 2 +- .../etc/bundledPackages/api-extractor-scenarios.api.json | 2 +- .../etc/circularImport/api-extractor-scenarios.api.json | 2 +- .../etc/circularImport2/api-extractor-scenarios.api.json | 2 +- .../defaultExportOfEntryPoint/api-extractor-scenarios.api.json | 2 +- .../defaultExportOfEntryPoint2/api-extractor-scenarios.api.json | 2 +- .../defaultExportOfEntryPoint3/api-extractor-scenarios.api.json | 2 +- .../defaultExportOfEntryPoint4/api-extractor-scenarios.api.json | 2 +- .../etc/docReferences/api-extractor-scenarios.api.json | 2 +- .../etc/docReferences2/api-extractor-scenarios.api.json | 2 +- .../etc/docReferences3/api-extractor-scenarios.api.json | 2 +- .../etc/docReferencesAlias/api-extractor-scenarios.api.json | 2 +- .../api-extractor-scenarios.api.json | 2 +- .../etc/dynamicImportType/api-extractor-scenarios.api.json | 2 +- .../etc/dynamicImportType2/api-extractor-scenarios.api.json | 2 +- .../etc/dynamicImportType3/api-extractor-scenarios.api.json | 2 +- .../ecmaScriptPrivateFields/api-extractor-scenarios.api.json | 2 +- .../etc/enumSorting/api-extractor-scenarios.api.json | 2 +- .../etc/excerptTokens/api-extractor-scenarios.api.json | 2 +- .../etc/exportDuplicate/api-extractor-scenarios.api.json | 2 +- .../etc/exportEquals/api-extractor-scenarios.api.json | 2 +- .../etc/exportImportStarAs/api-extractor-scenarios.api.json | 2 +- .../etc/exportImportStarAs2/api-extractor-scenarios.api.json | 2 +- .../etc/exportImportedExternal/api-extractor-scenarios.api.json | 2 +- .../exportImportedExternal2/api-extractor-scenarios.api.json | 2 +- .../api-extractor-scenarios.api.json | 2 +- .../etc/exportStar/api-extractor-scenarios.api.json | 2 +- .../etc/exportStar2/api-extractor-scenarios.api.json | 2 +- .../etc/exportStar3/api-extractor-scenarios.api.json | 2 +- .../etc/functionOverload/api-extractor-scenarios.api.json | 2 +- .../etc/importEquals/api-extractor-scenarios.api.json | 2 +- .../etc/importType/api-extractor-scenarios.api.json | 2 +- .../includeForgottenExports/api-extractor-scenarios.api.json | 2 +- .../inconsistentReleaseTags/api-extractor-scenarios.api.json | 2 +- .../internationalCharacters/api-extractor-scenarios.api.json | 2 +- .../etc/mergedDeclarations/api-extractor-scenarios.api.json | 2 +- .../etc/mixinPattern/api-extractor-scenarios.api.json | 2 +- .../etc/namedDefaultImport/api-extractor-scenarios.api.json | 2 +- .../etc/namespaceImports/api-extractor-scenarios.api.json | 2 +- .../etc/namespaceImports2/api-extractor-scenarios.api.json | 2 +- .../etc/preapproved/api-extractor-scenarios.api.json | 2 +- .../etc/projectFolderUrl/api-extractor-scenarios.api.json | 2 +- .../etc/readonlyDeclarations/api-extractor-scenarios.api.json | 2 +- .../etc/referenceTokens/api-extractor-scenarios.api.json | 2 +- .../etc/spanSorting/api-extractor-scenarios.api.json | 2 +- .../etc/typeLiterals/api-extractor-scenarios.api.json | 2 +- .../etc/typeOf/api-extractor-scenarios.api.json | 2 +- .../etc/typeOf2/api-extractor-scenarios.api.json | 2 +- .../etc/typeOf3/api-extractor-scenarios.api.json | 2 +- .../etc/typeParameters/api-extractor-scenarios.api.json | 2 +- 55 files changed, 55 insertions(+), 55 deletions(-) diff --git a/build-tests/api-documenter-scenarios/etc/inheritedMembers/api-documenter-scenarios.api.json b/build-tests/api-documenter-scenarios/etc/inheritedMembers/api-documenter-scenarios.api.json index 353fb1d844e..9118d0a598f 100644 --- a/build-tests/api-documenter-scenarios/etc/inheritedMembers/api-documenter-scenarios.api.json +++ b/build-tests/api-documenter-scenarios/etc/inheritedMembers/api-documenter-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-documenter-test/etc/api-documenter-test.api.json b/build-tests/api-documenter-test/etc/api-documenter-test.api.json index ecdc4270683..5d91fa222fd 100644 --- a/build-tests/api-documenter-test/etc/api-documenter-test.api.json +++ b/build-tests/api-documenter-test/etc/api-documenter-test.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/ambientNameConflict/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/ambientNameConflict/api-extractor-scenarios.api.json index c8044d1642a..0697715d9d5 100644 --- a/build-tests/api-extractor-scenarios/etc/ambientNameConflict/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/ambientNameConflict/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/ambientNameConflict2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/ambientNameConflict2/api-extractor-scenarios.api.json index 15509ec1718..d0e3d0c7980 100644 --- a/build-tests/api-extractor-scenarios/etc/ambientNameConflict2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/ambientNameConflict2/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/ancillaryDeclarations/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/ancillaryDeclarations/api-extractor-scenarios.api.json index 53341afdf70..8eda7baa8a6 100644 --- a/build-tests/api-extractor-scenarios/etc/ancillaryDeclarations/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/ancillaryDeclarations/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/apiItemKinds/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/apiItemKinds/api-extractor-scenarios.api.json index a23e873dea6..5399ba5ef08 100644 --- a/build-tests/api-extractor-scenarios/etc/apiItemKinds/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/apiItemKinds/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/bundledPackages/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/bundledPackages/api-extractor-scenarios.api.json index c28e68ec177..5146f92aab4 100644 --- a/build-tests/api-extractor-scenarios/etc/bundledPackages/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/bundledPackages/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/circularImport/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/circularImport/api-extractor-scenarios.api.json index ae1bbe97086..d4f99324946 100644 --- a/build-tests/api-extractor-scenarios/etc/circularImport/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/circularImport/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/circularImport2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/circularImport2/api-extractor-scenarios.api.json index e4776282848..2af5ea9bb31 100644 --- a/build-tests/api-extractor-scenarios/etc/circularImport2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/circularImport2/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint/api-extractor-scenarios.api.json index c10423b414a..ddc7e3f6556 100644 --- a/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint2/api-extractor-scenarios.api.json index 0a539f8cec6..d5b2da9ff7c 100644 --- a/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint2/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint3/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint3/api-extractor-scenarios.api.json index c3534ce9d89..35ffd2ab980 100644 --- a/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint3/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint3/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint4/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint4/api-extractor-scenarios.api.json index f15c13d7f97..5cdb5ae7e93 100644 --- a/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint4/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint4/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/docReferences/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/docReferences/api-extractor-scenarios.api.json index 1f7a7c233ad..fa4fdb7faba 100644 --- a/build-tests/api-extractor-scenarios/etc/docReferences/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/docReferences/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/docReferences2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/docReferences2/api-extractor-scenarios.api.json index 9356d944113..89801701c03 100644 --- a/build-tests/api-extractor-scenarios/etc/docReferences2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/docReferences2/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/docReferences3/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/docReferences3/api-extractor-scenarios.api.json index 86eb2fecd4e..f6bdf6840ed 100644 --- a/build-tests/api-extractor-scenarios/etc/docReferences3/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/docReferences3/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/docReferencesAlias/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/docReferencesAlias/api-extractor-scenarios.api.json index 9c19c8f5e0b..0e10f085184 100644 --- a/build-tests/api-extractor-scenarios/etc/docReferencesAlias/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/docReferencesAlias/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/docReferencesNamespaceAlias/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/docReferencesNamespaceAlias/api-extractor-scenarios.api.json index 56da84a2127..4bf60a5d307 100644 --- a/build-tests/api-extractor-scenarios/etc/docReferencesNamespaceAlias/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/docReferencesNamespaceAlias/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/dynamicImportType/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/dynamicImportType/api-extractor-scenarios.api.json index 98b9058167c..3a7783606e3 100644 --- a/build-tests/api-extractor-scenarios/etc/dynamicImportType/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/dynamicImportType/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/dynamicImportType2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/dynamicImportType2/api-extractor-scenarios.api.json index 0648ab651e8..b7a2b150998 100644 --- a/build-tests/api-extractor-scenarios/etc/dynamicImportType2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/dynamicImportType2/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/dynamicImportType3/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/dynamicImportType3/api-extractor-scenarios.api.json index 67334643b3d..45d2df5805b 100644 --- a/build-tests/api-extractor-scenarios/etc/dynamicImportType3/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/dynamicImportType3/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/ecmaScriptPrivateFields/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/ecmaScriptPrivateFields/api-extractor-scenarios.api.json index 9b1d9572484..623949f6883 100644 --- a/build-tests/api-extractor-scenarios/etc/ecmaScriptPrivateFields/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/ecmaScriptPrivateFields/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/enumSorting/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/enumSorting/api-extractor-scenarios.api.json index 999d0461953..e5c18346cba 100644 --- a/build-tests/api-extractor-scenarios/etc/enumSorting/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/enumSorting/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/excerptTokens/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/excerptTokens/api-extractor-scenarios.api.json index 8a92f59ef79..a79d24c516d 100644 --- a/build-tests/api-extractor-scenarios/etc/excerptTokens/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/excerptTokens/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/exportDuplicate/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/exportDuplicate/api-extractor-scenarios.api.json index 756706dfe72..f4ca40c849b 100644 --- a/build-tests/api-extractor-scenarios/etc/exportDuplicate/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/exportDuplicate/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/exportEquals/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/exportEquals/api-extractor-scenarios.api.json index 197bc9cff8f..14e0e241335 100644 --- a/build-tests/api-extractor-scenarios/etc/exportEquals/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/exportEquals/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/exportImportStarAs/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/exportImportStarAs/api-extractor-scenarios.api.json index 88dcd4cf162..65254a86a60 100644 --- a/build-tests/api-extractor-scenarios/etc/exportImportStarAs/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/exportImportStarAs/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/exportImportStarAs2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/exportImportStarAs2/api-extractor-scenarios.api.json index 404939b565c..569dc468334 100644 --- a/build-tests/api-extractor-scenarios/etc/exportImportStarAs2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/exportImportStarAs2/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/exportImportedExternal/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/exportImportedExternal/api-extractor-scenarios.api.json index 79a07fd02a9..895ed82382e 100644 --- a/build-tests/api-extractor-scenarios/etc/exportImportedExternal/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/exportImportedExternal/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/exportImportedExternal2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/exportImportedExternal2/api-extractor-scenarios.api.json index 79a07fd02a9..895ed82382e 100644 --- a/build-tests/api-extractor-scenarios/etc/exportImportedExternal2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/exportImportedExternal2/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/exportImportedExternalDefault/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/exportImportedExternalDefault/api-extractor-scenarios.api.json index 2a05f3d8c7f..e38f2eb3fbc 100644 --- a/build-tests/api-extractor-scenarios/etc/exportImportedExternalDefault/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/exportImportedExternalDefault/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/exportStar/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/exportStar/api-extractor-scenarios.api.json index c95675e2bac..034087c4404 100644 --- a/build-tests/api-extractor-scenarios/etc/exportStar/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/exportStar/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/exportStar2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/exportStar2/api-extractor-scenarios.api.json index a2ed1b1288b..89196c9883e 100644 --- a/build-tests/api-extractor-scenarios/etc/exportStar2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/exportStar2/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/exportStar3/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/exportStar3/api-extractor-scenarios.api.json index b99c5701c38..978e79dd798 100644 --- a/build-tests/api-extractor-scenarios/etc/exportStar3/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/exportStar3/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/functionOverload/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/functionOverload/api-extractor-scenarios.api.json index eae5b3f2d67..77963078446 100644 --- a/build-tests/api-extractor-scenarios/etc/functionOverload/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/functionOverload/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/importEquals/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/importEquals/api-extractor-scenarios.api.json index ba8e99605cf..99e2120fe4f 100644 --- a/build-tests/api-extractor-scenarios/etc/importEquals/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/importEquals/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/importType/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/importType/api-extractor-scenarios.api.json index f81b7a3945a..9b7a0ba9812 100644 --- a/build-tests/api-extractor-scenarios/etc/importType/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/importType/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/includeForgottenExports/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/includeForgottenExports/api-extractor-scenarios.api.json index 5bdbc889658..edf03124928 100644 --- a/build-tests/api-extractor-scenarios/etc/includeForgottenExports/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/includeForgottenExports/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/inconsistentReleaseTags/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/inconsistentReleaseTags/api-extractor-scenarios.api.json index b7121a25fcc..fd70ca6eb1a 100644 --- a/build-tests/api-extractor-scenarios/etc/inconsistentReleaseTags/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/inconsistentReleaseTags/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/internationalCharacters/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/internationalCharacters/api-extractor-scenarios.api.json index ebd4505fbd4..5c99dc8cdb7 100644 --- a/build-tests/api-extractor-scenarios/etc/internationalCharacters/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/internationalCharacters/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/mergedDeclarations/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/mergedDeclarations/api-extractor-scenarios.api.json index ce0022a7547..41bf7a4b7cd 100644 --- a/build-tests/api-extractor-scenarios/etc/mergedDeclarations/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/mergedDeclarations/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/mixinPattern/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/mixinPattern/api-extractor-scenarios.api.json index 6c6e7e652d5..133cb558f57 100644 --- a/build-tests/api-extractor-scenarios/etc/mixinPattern/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/mixinPattern/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/namedDefaultImport/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/namedDefaultImport/api-extractor-scenarios.api.json index 3e06f53760f..e4a6ab82c27 100644 --- a/build-tests/api-extractor-scenarios/etc/namedDefaultImport/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/namedDefaultImport/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/namespaceImports/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/namespaceImports/api-extractor-scenarios.api.json index 5462f9c539b..7c915e7984a 100644 --- a/build-tests/api-extractor-scenarios/etc/namespaceImports/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/namespaceImports/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/namespaceImports2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/namespaceImports2/api-extractor-scenarios.api.json index b9cfe1afe5d..f40d2e64608 100644 --- a/build-tests/api-extractor-scenarios/etc/namespaceImports2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/namespaceImports2/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/preapproved/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/preapproved/api-extractor-scenarios.api.json index 79a07fd02a9..895ed82382e 100644 --- a/build-tests/api-extractor-scenarios/etc/preapproved/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/preapproved/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/projectFolderUrl/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/projectFolderUrl/api-extractor-scenarios.api.json index 223a02e84bc..bb32a39af82 100644 --- a/build-tests/api-extractor-scenarios/etc/projectFolderUrl/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/projectFolderUrl/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/readonlyDeclarations/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/readonlyDeclarations/api-extractor-scenarios.api.json index ca20b2bb194..c0ed696410b 100644 --- a/build-tests/api-extractor-scenarios/etc/readonlyDeclarations/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/readonlyDeclarations/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/referenceTokens/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/referenceTokens/api-extractor-scenarios.api.json index 2f4eba57845..3840c1933fe 100644 --- a/build-tests/api-extractor-scenarios/etc/referenceTokens/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/referenceTokens/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/spanSorting/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/spanSorting/api-extractor-scenarios.api.json index 2a616ddd8ce..5315cb39238 100644 --- a/build-tests/api-extractor-scenarios/etc/spanSorting/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/spanSorting/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/typeLiterals/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/typeLiterals/api-extractor-scenarios.api.json index 35ad0b7ef62..9e76ccb3d77 100644 --- a/build-tests/api-extractor-scenarios/etc/typeLiterals/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/typeLiterals/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/typeOf/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/typeOf/api-extractor-scenarios.api.json index c37e28a4708..52ea964fd3c 100644 --- a/build-tests/api-extractor-scenarios/etc/typeOf/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/typeOf/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/typeOf2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/typeOf2/api-extractor-scenarios.api.json index da1afcf027c..bd0a1edd8c6 100644 --- a/build-tests/api-extractor-scenarios/etc/typeOf2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/typeOf2/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/typeOf3/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/typeOf3/api-extractor-scenarios.api.json index ac5372d4cc6..36f784c17cc 100644 --- a/build-tests/api-extractor-scenarios/etc/typeOf3/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/typeOf3/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", diff --git a/build-tests/api-extractor-scenarios/etc/typeParameters/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/typeParameters/api-extractor-scenarios.api.json index 05c515e3859..c50dc7eb1bb 100644 --- a/build-tests/api-extractor-scenarios/etc/typeParameters/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/typeParameters/api-extractor-scenarios.api.json @@ -2,7 +2,7 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1010, + "schemaVersion": 1011, "oldestForwardsCompatibleVersion": 1001, "tsdocConfig": { "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", From 0a55655178a696ea86782005526d6cef1e540de8 Mon Sep 17 00:00:00 2001 From: Frank Wienberg Date: Tue, 29 Nov 2022 17:55:06 +0100 Subject: [PATCH 009/167] [api-documenter] Add test for an abstract class with abstract method & property Add a simple abstract class with an abstract method and an abstract property at build-tests/api-documenter-tests/src/AbstractClass.ts, re-export it in the corresponding index.ts and rebuild build-tests/api-documenter-tests. The updated report files look good. Especially note the "Modifiers" column of both tables in api-documenter-test.abstractclass.md now containing the "abstract" entry. --- .../etc/api-documenter-test.api.json | 80 +++++++++ .../etc/api-documenter-test.api.md | 6 + .../api-documenter-test.abstractclass.md | 26 +++ ...pi-documenter-test.abstractclass.method.md | 17 ++ ...-documenter-test.abstractclass.property.md | 13 ++ .../etc/markdown/api-documenter-test.md | 6 + .../etc/yaml/api-documenter-test.yml | 139 +++++++-------- .../api-documenter-test/abstractclass.yml | 40 +++++ .../api-documenter-test/etc/yaml/toc.yml | 160 +++++++++--------- .../api-documenter-test/src/AbstractClass.ts | 10 ++ build-tests/api-documenter-test/src/index.ts | 2 + 11 files changed, 351 insertions(+), 148 deletions(-) create mode 100644 build-tests/api-documenter-test/etc/markdown/api-documenter-test.abstractclass.md create mode 100644 build-tests/api-documenter-test/etc/markdown/api-documenter-test.abstractclass.method.md create mode 100644 build-tests/api-documenter-test/etc/markdown/api-documenter-test.abstractclass.property.md create mode 100644 build-tests/api-documenter-test/etc/yaml/api-documenter-test/abstractclass.yml create mode 100644 build-tests/api-documenter-test/src/AbstractClass.ts diff --git a/build-tests/api-documenter-test/etc/api-documenter-test.api.json b/build-tests/api-documenter-test/etc/api-documenter-test.api.json index 5d91fa222fd..4b8d0a7951b 100644 --- a/build-tests/api-documenter-test/etc/api-documenter-test.api.json +++ b/build-tests/api-documenter-test/etc/api-documenter-test.api.json @@ -182,6 +182,86 @@ "name": "", "preserveMemberOrder": false, "members": [ + { + "kind": "Class", + "canonicalReference": "api-documenter-test!AbstractClass:class", + "docComment": "/**\n * Some abstract class with abstract members.\n *\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare abstract class AbstractClass " + } + ], + "fileUrlPath": "src/AbstractClass.ts", + "releaseTag": "Public", + "isAbstract": true, + "name": "AbstractClass", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Method", + "canonicalReference": "api-documenter-test!AbstractClass#method:member(1)", + "docComment": "/**\n * Some abstract method.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "abstract method(): " + }, + { + "kind": "Content", + "text": "void" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isStatic": false, + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "releaseTag": "Public", + "isProtected": false, + "overloadIndex": 1, + "parameters": [], + "isOptional": false, + "isAbstract": true, + "name": "method" + }, + { + "kind": "Property", + "canonicalReference": "api-documenter-test!AbstractClass#property:member", + "docComment": "/**\n * Some abstract property.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "protected abstract property: " + }, + { + "kind": "Content", + "text": "number" + }, + { + "kind": "Content", + "text": ";" + } + ], + "isReadonly": false, + "isOptional": false, + "releaseTag": "Public", + "name": "property", + "propertyTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isStatic": false, + "isProtected": true, + "isAbstract": true + } + ], + "implementsTokenRanges": [] + }, { "kind": "Interface", "canonicalReference": "api-documenter-test!Constraint:interface", diff --git a/build-tests/api-documenter-test/etc/api-documenter-test.api.md b/build-tests/api-documenter-test/etc/api-documenter-test.api.md index 22fa1fef52d..18bab020adb 100644 --- a/build-tests/api-documenter-test/etc/api-documenter-test.api.md +++ b/build-tests/api-documenter-test/etc/api-documenter-test.api.md @@ -4,6 +4,12 @@ ```ts +// @public +export abstract class AbstractClass { + abstract method(): void; + protected abstract property: number; +} + // @public export interface Constraint { } diff --git a/build-tests/api-documenter-test/etc/markdown/api-documenter-test.abstractclass.md b/build-tests/api-documenter-test/etc/markdown/api-documenter-test.abstractclass.md new file mode 100644 index 00000000000..743b8feecd0 --- /dev/null +++ b/build-tests/api-documenter-test/etc/markdown/api-documenter-test.abstractclass.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [api-documenter-test](./api-documenter-test.md) > [AbstractClass](./api-documenter-test.abstractclass.md) + +## AbstractClass class + +Some abstract class with abstract members. + +Signature: + +```typescript +export declare abstract class AbstractClass +``` + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [property](./api-documenter-test.abstractclass.property.md) |

protected

abstract

| number | Some abstract property. | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [method()](./api-documenter-test.abstractclass.method.md) | abstract | Some abstract method. | + diff --git a/build-tests/api-documenter-test/etc/markdown/api-documenter-test.abstractclass.method.md b/build-tests/api-documenter-test/etc/markdown/api-documenter-test.abstractclass.method.md new file mode 100644 index 00000000000..bed2cf4bdeb --- /dev/null +++ b/build-tests/api-documenter-test/etc/markdown/api-documenter-test.abstractclass.method.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [api-documenter-test](./api-documenter-test.md) > [AbstractClass](./api-documenter-test.abstractclass.md) > [method](./api-documenter-test.abstractclass.method.md) + +## AbstractClass.method() method + +Some abstract method. + +Signature: + +```typescript +abstract method(): void; +``` +Returns: + +void + diff --git a/build-tests/api-documenter-test/etc/markdown/api-documenter-test.abstractclass.property.md b/build-tests/api-documenter-test/etc/markdown/api-documenter-test.abstractclass.property.md new file mode 100644 index 00000000000..6fb693016d1 --- /dev/null +++ b/build-tests/api-documenter-test/etc/markdown/api-documenter-test.abstractclass.property.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [api-documenter-test](./api-documenter-test.md) > [AbstractClass](./api-documenter-test.abstractclass.md) > [property](./api-documenter-test.abstractclass.property.md) + +## AbstractClass.property property + +Some abstract property. + +Signature: + +```typescript +protected abstract property: number; +``` diff --git a/build-tests/api-documenter-test/etc/markdown/api-documenter-test.md b/build-tests/api-documenter-test/etc/markdown/api-documenter-test.md index 8ac3f68444c..ff7da3c5e33 100644 --- a/build-tests/api-documenter-test/etc/markdown/api-documenter-test.md +++ b/build-tests/api-documenter-test/etc/markdown/api-documenter-test.md @@ -19,6 +19,12 @@ This project tests various documentation generation scenarios and doc comment sy | [Generic](./api-documenter-test.generic.md) | Generic class. | | [SystemEvent](./api-documenter-test.systemevent.md) |

A class used to exposed events.

| +## Abstract Classes + +| Abstract Class | Description | +| --- | --- | +| [AbstractClass](./api-documenter-test.abstractclass.md) | Some abstract class with abstract members. | + ## Enumerations | Enumeration | Description | diff --git a/build-tests/api-documenter-test/etc/yaml/api-documenter-test.yml b/build-tests/api-documenter-test/etc/yaml/api-documenter-test.yml index 7576e5ade75..b0f265aeb59 100644 --- a/build-tests/api-documenter-test/etc/yaml/api-documenter-test.yml +++ b/build-tests/api-documenter-test/etc/yaml/api-documenter-test.yml @@ -1,69 +1,70 @@ -### YamlMime:TSPackage -uid: api-documenter-test! -name: api-documenter-test -type: package -summary: |- - api-extractor-test-05 - - This project tests various documentation generation scenarios and doc comment syntaxes. -interfaces: - - 'api-documenter-test!Constraint:interface' - - 'api-documenter-test!DefaultType:interface' - - 'api-documenter-test!DocClassInterfaceMerge:interface' - - 'api-documenter-test!IDocInterface1:interface' - - 'api-documenter-test!IDocInterface2:interface' - - 'api-documenter-test!IDocInterface3:interface' - - 'api-documenter-test!IDocInterface4:interface' - - 'api-documenter-test!IDocInterface5:interface' - - 'api-documenter-test!IDocInterface6:interface' - - 'api-documenter-test!IDocInterface7:interface' -classes: - - 'api-documenter-test!DecoratorExample:class' - - 'api-documenter-test!DocBaseClass:class' - - 'api-documenter-test!DocClass1:class' - - 'api-documenter-test!DocClassInterfaceMerge:class' - - 'api-documenter-test!Generic:class' - - 'api-documenter-test!SystemEvent:class' -enums: - - 'api-documenter-test!DocEnum:enum' - - 'api-documenter-test!DocEnumNamespaceMerge:enum' -typeAliases: - - 'api-documenter-test!ExampleDuplicateTypeAlias:type' - - 'api-documenter-test!ExampleTypeAlias:type' - - 'api-documenter-test!ExampleUnionTypeAlias:type' - - 'api-documenter-test!GenericTypeAlias:type' - - 'api-documenter-test!TypeAlias:type' -functions: - - name: 'exampleFunction(x, y)' - uid: 'api-documenter-test!exampleFunction:function(1)' - package: api-documenter-test! - summary: An exported function with hyperlinked parameters and return value. - remarks: '' - example: [] - isPreview: false - isDeprecated: false - syntax: - content: 'export declare function exampleFunction(x: ExampleTypeAlias, y: number): IDocInterface1;' - parameters: - - id: x - description: an API item that should get hyperlinked - type: '' - - id: 'y' - description: a system type that should NOT get hyperlinked - type: number - return: - type: '' - description: an interface that should get hyperlinked - - name: yamlReferenceUniquenessTest() - uid: 'api-documenter-test!yamlReferenceUniquenessTest:function(1)' - package: api-documenter-test! - summary: '' - remarks: '' - example: [] - isPreview: false - isDeprecated: false - syntax: - content: 'export declare function yamlReferenceUniquenessTest(): IDocInterface1;' - return: - type: '' - description: '' +### YamlMime:TSPackage +uid: api-documenter-test! +name: api-documenter-test +type: package +summary: |- + api-extractor-test-05 + + This project tests various documentation generation scenarios and doc comment syntaxes. +interfaces: + - 'api-documenter-test!Constraint:interface' + - 'api-documenter-test!DefaultType:interface' + - 'api-documenter-test!DocClassInterfaceMerge:interface' + - 'api-documenter-test!IDocInterface1:interface' + - 'api-documenter-test!IDocInterface2:interface' + - 'api-documenter-test!IDocInterface3:interface' + - 'api-documenter-test!IDocInterface4:interface' + - 'api-documenter-test!IDocInterface5:interface' + - 'api-documenter-test!IDocInterface6:interface' + - 'api-documenter-test!IDocInterface7:interface' +classes: + - 'api-documenter-test!AbstractClass:class' + - 'api-documenter-test!DecoratorExample:class' + - 'api-documenter-test!DocBaseClass:class' + - 'api-documenter-test!DocClass1:class' + - 'api-documenter-test!DocClassInterfaceMerge:class' + - 'api-documenter-test!Generic:class' + - 'api-documenter-test!SystemEvent:class' +enums: + - 'api-documenter-test!DocEnum:enum' + - 'api-documenter-test!DocEnumNamespaceMerge:enum' +typeAliases: + - 'api-documenter-test!ExampleDuplicateTypeAlias:type' + - 'api-documenter-test!ExampleTypeAlias:type' + - 'api-documenter-test!ExampleUnionTypeAlias:type' + - 'api-documenter-test!GenericTypeAlias:type' + - 'api-documenter-test!TypeAlias:type' +functions: + - name: 'exampleFunction(x, y)' + uid: 'api-documenter-test!exampleFunction:function(1)' + package: api-documenter-test! + summary: An exported function with hyperlinked parameters and return value. + remarks: '' + example: [] + isPreview: false + isDeprecated: false + syntax: + content: 'export declare function exampleFunction(x: ExampleTypeAlias, y: number): IDocInterface1;' + parameters: + - id: x + description: an API item that should get hyperlinked + type: '' + - id: 'y' + description: a system type that should NOT get hyperlinked + type: number + return: + type: '' + description: an interface that should get hyperlinked + - name: yamlReferenceUniquenessTest() + uid: 'api-documenter-test!yamlReferenceUniquenessTest:function(1)' + package: api-documenter-test! + summary: '' + remarks: '' + example: [] + isPreview: false + isDeprecated: false + syntax: + content: 'export declare function yamlReferenceUniquenessTest(): IDocInterface1;' + return: + type: '' + description: '' diff --git a/build-tests/api-documenter-test/etc/yaml/api-documenter-test/abstractclass.yml b/build-tests/api-documenter-test/etc/yaml/api-documenter-test/abstractclass.yml new file mode 100644 index 00000000000..7d215efa4f1 --- /dev/null +++ b/build-tests/api-documenter-test/etc/yaml/api-documenter-test/abstractclass.yml @@ -0,0 +1,40 @@ +### YamlMime:TSType +name: AbstractClass +uid: 'api-documenter-test!AbstractClass:class' +package: api-documenter-test! +fullName: AbstractClass +summary: Some abstract class with abstract members. +remarks: '' +example: [] +isPreview: false +isDeprecated: false +type: class +properties: + - name: property + uid: 'api-documenter-test!AbstractClass#property:member' + package: api-documenter-test! + fullName: property + summary: Some abstract property. + remarks: '' + example: [] + isPreview: false + isDeprecated: false + syntax: + content: 'protected abstract property: number;' + return: + type: number +methods: + - name: method() + uid: 'api-documenter-test!AbstractClass#method:member(1)' + package: api-documenter-test! + fullName: method() + summary: Some abstract method. + remarks: '' + example: [] + isPreview: false + isDeprecated: false + syntax: + content: 'abstract method(): void;' + return: + type: void + description: '' diff --git a/build-tests/api-documenter-test/etc/yaml/toc.yml b/build-tests/api-documenter-test/etc/yaml/toc.yml index caa0193215c..22523f8276b 100644 --- a/build-tests/api-documenter-test/etc/yaml/toc.yml +++ b/build-tests/api-documenter-test/etc/yaml/toc.yml @@ -1,79 +1,81 @@ -items: - - name: Test api-documenter - href: ~/homepage/homepage.md - - name: Test Sample for AD - href: api-documenter-test - extended: true - items: - - name: Classes - items: - - name: DocBaseClass - items: - - name: DocBaseClass - uid: 'api-documenter-test!DocBaseClass:class' - - name: IDocInterface1 - uid: 'api-documenter-test!IDocInterface1:interface' - - name: IDocInterface2 - uid: 'api-documenter-test!IDocInterface2:interface' - - name: DocClass1 - items: - - name: DocClass1 - uid: 'api-documenter-test!DocClass1:class' - - name: IDocInterface3 - uid: 'api-documenter-test!IDocInterface3:interface' - - name: IDocInterface4 - uid: 'api-documenter-test!IDocInterface4:interface' - - name: Interfaces - items: - - name: Interface5 - items: - - name: IDocInterface5 - uid: 'api-documenter-test!IDocInterface5:interface' - - name: Interface6 - items: - - name: InjectedCustomInterface - uid: customUid - - name: IDocInterface6 - uid: 'api-documenter-test!IDocInterface6:interface' - - name: References - items: - - name: InjectedCustomItem - uid: customUrl - - name: Constraint - uid: 'api-documenter-test!Constraint:interface' - - name: DecoratorExample - uid: 'api-documenter-test!DecoratorExample:class' - - name: DefaultType - uid: 'api-documenter-test!DefaultType:interface' - - name: DocClassInterfaceMerge (Class) - uid: 'api-documenter-test!DocClassInterfaceMerge:class' - - name: DocClassInterfaceMerge (Interface) - uid: 'api-documenter-test!DocClassInterfaceMerge:interface' - - name: DocEnum - uid: 'api-documenter-test!DocEnum:enum' - - name: DocEnumNamespaceMerge (Enum) - uid: 'api-documenter-test!DocEnumNamespaceMerge:enum' - - name: DocEnumNamespaceMerge (Namespace) - uid: 'api-documenter-test!DocEnumNamespaceMerge:namespace' - - name: EcmaSmbols - uid: 'api-documenter-test!EcmaSmbols:namespace' - - name: ExampleDuplicateTypeAlias - uid: 'api-documenter-test!ExampleDuplicateTypeAlias:type' - - name: ExampleTypeAlias - uid: 'api-documenter-test!ExampleTypeAlias:type' - - name: ExampleUnionTypeAlias - uid: 'api-documenter-test!ExampleUnionTypeAlias:type' - - name: Generic - uid: 'api-documenter-test!Generic:class' - - name: GenericTypeAlias - uid: 'api-documenter-test!GenericTypeAlias:type' - - name: IDocInterface7 - uid: 'api-documenter-test!IDocInterface7:interface' - - name: OuterNamespace - uid: 'api-documenter-test!OuterNamespace:namespace' - - name: OuterNamespace.InnerNamespace - uid: 'api-documenter-test!OuterNamespace.InnerNamespace:namespace' - - name: SystemEvent - uid: 'api-documenter-test!SystemEvent:class' - - name: TypeAlias - uid: 'api-documenter-test!TypeAlias:type' +items: + - name: Test api-documenter + href: ~/homepage/homepage.md + - name: Test Sample for AD + href: api-documenter-test + extended: true + items: + - name: Classes + items: + - name: DocBaseClass + items: + - name: DocBaseClass + uid: 'api-documenter-test!DocBaseClass:class' + - name: IDocInterface1 + uid: 'api-documenter-test!IDocInterface1:interface' + - name: IDocInterface2 + uid: 'api-documenter-test!IDocInterface2:interface' + - name: DocClass1 + items: + - name: DocClass1 + uid: 'api-documenter-test!DocClass1:class' + - name: IDocInterface3 + uid: 'api-documenter-test!IDocInterface3:interface' + - name: IDocInterface4 + uid: 'api-documenter-test!IDocInterface4:interface' + - name: Interfaces + items: + - name: Interface5 + items: + - name: IDocInterface5 + uid: 'api-documenter-test!IDocInterface5:interface' + - name: Interface6 + items: + - name: InjectedCustomInterface + uid: customUid + - name: IDocInterface6 + uid: 'api-documenter-test!IDocInterface6:interface' + - name: References + items: + - name: InjectedCustomItem + uid: customUrl + - name: AbstractClass + uid: 'api-documenter-test!AbstractClass:class' + - name: Constraint + uid: 'api-documenter-test!Constraint:interface' + - name: DecoratorExample + uid: 'api-documenter-test!DecoratorExample:class' + - name: DefaultType + uid: 'api-documenter-test!DefaultType:interface' + - name: DocClassInterfaceMerge (Class) + uid: 'api-documenter-test!DocClassInterfaceMerge:class' + - name: DocClassInterfaceMerge (Interface) + uid: 'api-documenter-test!DocClassInterfaceMerge:interface' + - name: DocEnum + uid: 'api-documenter-test!DocEnum:enum' + - name: DocEnumNamespaceMerge (Enum) + uid: 'api-documenter-test!DocEnumNamespaceMerge:enum' + - name: DocEnumNamespaceMerge (Namespace) + uid: 'api-documenter-test!DocEnumNamespaceMerge:namespace' + - name: EcmaSmbols + uid: 'api-documenter-test!EcmaSmbols:namespace' + - name: ExampleDuplicateTypeAlias + uid: 'api-documenter-test!ExampleDuplicateTypeAlias:type' + - name: ExampleTypeAlias + uid: 'api-documenter-test!ExampleTypeAlias:type' + - name: ExampleUnionTypeAlias + uid: 'api-documenter-test!ExampleUnionTypeAlias:type' + - name: Generic + uid: 'api-documenter-test!Generic:class' + - name: GenericTypeAlias + uid: 'api-documenter-test!GenericTypeAlias:type' + - name: IDocInterface7 + uid: 'api-documenter-test!IDocInterface7:interface' + - name: OuterNamespace + uid: 'api-documenter-test!OuterNamespace:namespace' + - name: OuterNamespace.InnerNamespace + uid: 'api-documenter-test!OuterNamespace.InnerNamespace:namespace' + - name: SystemEvent + uid: 'api-documenter-test!SystemEvent:class' + - name: TypeAlias + uid: 'api-documenter-test!TypeAlias:type' diff --git a/build-tests/api-documenter-test/src/AbstractClass.ts b/build-tests/api-documenter-test/src/AbstractClass.ts new file mode 100644 index 00000000000..bfb5f3d4dd9 --- /dev/null +++ b/build-tests/api-documenter-test/src/AbstractClass.ts @@ -0,0 +1,10 @@ +/** + * Some abstract class with abstract members. + * @public + */ +export abstract class AbstractClass { + /** Some abstract method. */ + public abstract method(): void; + /** Some abstract property. */ + protected abstract property: number; +} diff --git a/build-tests/api-documenter-test/src/index.ts b/build-tests/api-documenter-test/src/index.ts index b073763ebd6..bc08d496e2b 100644 --- a/build-tests/api-documenter-test/src/index.ts +++ b/build-tests/api-documenter-test/src/index.ts @@ -16,6 +16,8 @@ import { IDocInterface1, IDocInterface3, SystemEvent } from './DocClass1'; export { DecoratorExample } from './DecoratorExample'; +export { AbstractClass } from './AbstractClass'; + /** * A type alias * @public From 8b58a33b61442f168a57f0bec60df696f9514ae2 Mon Sep 17 00:00:00 2001 From: Lukas <4083977+lukaskl@users.noreply.github.com> Date: Wed, 7 Dec 2022 23:10:26 +0700 Subject: [PATCH 010/167] Introduce dependsOnAdditionalFiles setting per operation --- .../src/api/RushProjectConfiguration.ts | 11 +++ .../logic/buildCache/AdditionalFilesHasher.ts | 85 +++++++++++++++++++ .../logic/operations/ShellOperationRunner.ts | 18 ++++ .../src/schemas/rush-project.schema.json | 9 ++ 4 files changed, 123 insertions(+) create mode 100644 libraries/rush-lib/src/logic/buildCache/AdditionalFilesHasher.ts diff --git a/libraries/rush-lib/src/api/RushProjectConfiguration.ts b/libraries/rush-lib/src/api/RushProjectConfiguration.ts index bb5aa5b432f..0245b8c53a9 100644 --- a/libraries/rush-lib/src/api/RushProjectConfiguration.ts +++ b/libraries/rush-lib/src/api/RushProjectConfiguration.ts @@ -76,6 +76,17 @@ export interface IOperationSettings { * you list them here. */ dependsOnEnvVars?: string[]; + + /** + * An optional list of glob (minimatch) patterns pointing to files that can affect this operation. + * The hash values of the contents of these files will become part of the final hash when reading + * and writing the build cache. + * + * Note: if a particular file will be matched by patterns provided by both `incrementalBuildIgnoredGlobs` and + * `dependsOnAdditionalFiles` options - `dependsOnAdditionalFiles` will win and the file will be included + * calculating final hash value when reading and writing the build cache + */ + dependsOnAdditionalFiles?: string[]; } interface IOldRushProjectJson { diff --git a/libraries/rush-lib/src/logic/buildCache/AdditionalFilesHasher.ts b/libraries/rush-lib/src/logic/buildCache/AdditionalFilesHasher.ts new file mode 100644 index 00000000000..397bbba9535 --- /dev/null +++ b/libraries/rush-lib/src/logic/buildCache/AdditionalFilesHasher.ts @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. +import { Import } from '@rushstack/node-core-library'; +import crypto from 'crypto'; +import fs from 'fs'; +import path from 'path'; + +import type { IOptions } from 'glob'; + +const glob: typeof import('glob') = Import.lazy('glob', require); + +const globAsync = (pattern: string, options: IOptions = {}): Promise => { + return new Promise((resolve, reject) => { + glob(pattern, options, (err, matches) => { + if (err) { + reject(err); + return; + } + resolve(matches); + }); + }); +}; + +export class AdditionalFilesHasher { + public static async getFileHashedFilesMap( + globPatterns: string[], + cwd: string + ): Promise> { + const filePaths: Set = await this._expandGlobPatterns(globPatterns, cwd); + + return await this._calculateFileHashes(filePaths, cwd); + } + + private static async _expandGlobPatterns(globPatterns: string[], cwd: string): Promise> { + const allMatches: Set = new Set(); + for (const pattern of globPatterns) { + const matches: string[] = await globAsync(pattern, { + cwd, + nodir: true, + // We want to keep path's type unchanged, + // i.e. if the pattern was a relative path, then matched paths should also be relative paths + // if the pattern was an absolute path, then matched paths should also be absolute paths + // + // We are doing this because these paths are going to be used to calculate a hash for the build cache and some users + // might choose to depend on global files (e.g. `/etc/os-release`) and some might choose to depend on local files + // (e.g. `../path/to/workspace/file`) + // + // In both cases we want that path to the resource would be the same on all machines, + // regardless of what is the current working directory. + // + // That being said, we want to keep `realpath` and `absolute` options here as false: + realpath: false, + absolute: false + }); + + matches.forEach((match) => allMatches.add(match)); + } + + if (allMatches.size === 0) { + throw new Error( + `Couldn't find any files matching provided glob patterns: ["${globPatterns.join('", "')}"].` + ); + } + + return allMatches; + } + + private static async _calculateFileHashes( + filePaths: Set, + cwd: string + ): Promise> { + const fileHashes: Map = new Map(); + + for (const filepath of filePaths.values()) { + const fullPath: string = path.isAbsolute(filepath) ? filepath : path.join(cwd, filepath); + const content: string = await fs.promises.readFile(fullPath, 'utf-8'); + + const hashValue: string = crypto.createHash('sha1').update(content).digest('hex'); + + fileHashes.set(filepath, hashValue); + } + + return fileHashes; + } +} diff --git a/libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts b/libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts index 147b5609d5d..aef6e17f198 100644 --- a/libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts +++ b/libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts @@ -29,6 +29,7 @@ import { OperationError } from './OperationError'; import { IOperationRunner, IOperationRunnerContext } from './IOperationRunner'; import { ProjectLogWritable } from './ProjectLogWritable'; import { ProjectBuildCache } from '../buildCache/ProjectBuildCache'; +import { AdditionalFilesHasher } from '../buildCache/AdditionalFilesHasher'; import { IOperationSettings, RushProjectConfiguration } from '../../api/RushProjectConfiguration'; import { CollatedTerminalProvider } from '../../utilities/CollatedTerminalProvider'; import { RushConstants } from '../RushConstants'; @@ -450,6 +451,23 @@ export class ShellOperationRunner implements IOperationRunner { additionalContext['$' + varName] = process.env[varName] || ''; } } + if (operationSettings.dependsOnAdditionalFiles) { + const additionalFiles: Map = + await AdditionalFilesHasher.getFileHashedFilesMap( + operationSettings.dependsOnAdditionalFiles, + this._rushProject.projectFolder + ); + + terminal.writeDebugLine( + `Including additional files to calculate build cache hash:\n ${Array.from( + additionalFiles.keys() + ).join('\n ')} ` + ); + + for (const [filePath, fileHash] of additionalFiles) { + additionalContext['file://' + filePath] = fileHash; + } + } this._projectBuildCache = await ProjectBuildCache.tryGetProjectBuildCache({ projectConfiguration, projectOutputFolderNames, diff --git a/libraries/rush-lib/src/schemas/rush-project.schema.json b/libraries/rush-lib/src/schemas/rush-project.schema.json index 6b163cfd04f..d309a568e45 100644 --- a/libraries/rush-lib/src/schemas/rush-project.schema.json +++ b/libraries/rush-lib/src/schemas/rush-project.schema.json @@ -60,6 +60,15 @@ "uniqueItems": true }, + "dependsOnAdditionalFiles": { + "type": "array", + "description": "Specify a list of glob (minimatch) paths (absolute or relative) pointing to files (within or outside the .git repository) that affect the output of this operation. If provided, the hash values of these files will become part of the final hash when reading and writing from cache.", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "disableBuildCacheForOperation": { "description": "Disable caching for this operation. The operation will never be restored from cache. This may be useful if this operation affects state outside of its folder.", "type": "boolean" From 0efe029a6409a566daab2488f87146085d587532 Mon Sep 17 00:00:00 2001 From: Lukas <4083977+lukaskl@users.noreply.github.com> Date: Wed, 7 Dec 2022 23:12:27 +0700 Subject: [PATCH 011/167] rush change --- .../lukaskl-additional-files_2022-12-07-16-12.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@microsoft/rush/lukaskl-additional-files_2022-12-07-16-12.json diff --git a/common/changes/@microsoft/rush/lukaskl-additional-files_2022-12-07-16-12.json b/common/changes/@microsoft/rush/lukaskl-additional-files_2022-12-07-16-12.json new file mode 100644 index 00000000000..4b22bf27a29 --- /dev/null +++ b/common/changes/@microsoft/rush/lukaskl-additional-files_2022-12-07-16-12.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Introduce \"dependsOnAdditionalFiles\" configuration option to operations in rush-project.json. This option allows to pass glob (minimatch) patterns pointing to files outside of .git repository. If provided, the hash values of these files will become part of the final hash when reading and writing from cache.", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} From 4f9fa41793daa125dcd48d290387fff659ae2bff Mon Sep 17 00:00:00 2001 From: Lukas <4083977+lukaskl@users.noreply.github.com> Date: Thu, 8 Dec 2022 17:31:03 +0700 Subject: [PATCH 012/167] Code review: use node-core-library Use helper class provided by @rushstack/node-core-library instead of plain 'fs' package or manually converting callback to promise. --- .../logic/buildCache/AdditionalFilesHasher.ts | 75 +++++++++---------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/libraries/rush-lib/src/logic/buildCache/AdditionalFilesHasher.ts b/libraries/rush-lib/src/logic/buildCache/AdditionalFilesHasher.ts index 397bbba9535..f0bdf2412e6 100644 --- a/libraries/rush-lib/src/logic/buildCache/AdditionalFilesHasher.ts +++ b/libraries/rush-lib/src/logic/buildCache/AdditionalFilesHasher.ts @@ -1,8 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { Import } from '@rushstack/node-core-library'; +import { Async, FileSystem, Import, LegacyAdapters } from '@rushstack/node-core-library'; import crypto from 'crypto'; -import fs from 'fs'; import path from 'path'; import type { IOptions } from 'glob'; @@ -10,15 +9,7 @@ import type { IOptions } from 'glob'; const glob: typeof import('glob') = Import.lazy('glob', require); const globAsync = (pattern: string, options: IOptions = {}): Promise => { - return new Promise((resolve, reject) => { - glob(pattern, options, (err, matches) => { - if (err) { - reject(err); - return; - } - resolve(matches); - }); - }); + return LegacyAdapters.convertCallbackToPromise(glob, pattern, options); }; export class AdditionalFilesHasher { @@ -33,28 +24,32 @@ export class AdditionalFilesHasher { private static async _expandGlobPatterns(globPatterns: string[], cwd: string): Promise> { const allMatches: Set = new Set(); - for (const pattern of globPatterns) { - const matches: string[] = await globAsync(pattern, { - cwd, - nodir: true, - // We want to keep path's type unchanged, - // i.e. if the pattern was a relative path, then matched paths should also be relative paths - // if the pattern was an absolute path, then matched paths should also be absolute paths - // - // We are doing this because these paths are going to be used to calculate a hash for the build cache and some users - // might choose to depend on global files (e.g. `/etc/os-release`) and some might choose to depend on local files - // (e.g. `../path/to/workspace/file`) - // - // In both cases we want that path to the resource would be the same on all machines, - // regardless of what is the current working directory. - // - // That being said, we want to keep `realpath` and `absolute` options here as false: - realpath: false, - absolute: false - }); - matches.forEach((match) => allMatches.add(match)); - } + await Async.forEachAsync( + globPatterns, + async (pattern) => { + const matches: string[] = await globAsync(pattern, { + cwd, + nodir: true, + // We want to keep path's type unchanged, + // i.e. if the pattern was a relative path, then matched paths should also be relative paths + // if the pattern was an absolute path, then matched paths should also be absolute paths + // + // We are doing this because these paths are going to be used to calculate a hash for the build cache and some users + // might choose to depend on global files (e.g. `/etc/os-release`) and some might choose to depend on local files + // (e.g. `../path/to/workspace/file`) + // + // In both cases we want that path to the resource would be the same on all machines, + // regardless of what is the current working directory. + // + // That being said, we want to keep `realpath` and `absolute` options here as false: + realpath: false, + absolute: false + }); + matches.forEach((match) => allMatches.add(match)); + }, + { concurrency: 10 } + ); if (allMatches.size === 0) { throw new Error( @@ -71,14 +66,18 @@ export class AdditionalFilesHasher { ): Promise> { const fileHashes: Map = new Map(); - for (const filepath of filePaths.values()) { - const fullPath: string = path.isAbsolute(filepath) ? filepath : path.join(cwd, filepath); - const content: string = await fs.promises.readFile(fullPath, 'utf-8'); + await Async.forEachAsync( + filePaths, + async (filepath) => { + const fullPath: string = path.isAbsolute(filepath) ? filepath : path.join(cwd, filepath); + const content: string = await FileSystem.readFileAsync(fullPath); - const hashValue: string = crypto.createHash('sha1').update(content).digest('hex'); + const hashValue: string = crypto.createHash('sha1').update(content).digest('hex'); - fileHashes.set(filepath, hashValue); - } + fileHashes.set(filepath, hashValue); + }, + { concurrency: 10 } + ); return fileHashes; } From b99b3bca28101947a615d1625847e32d9bd02af3 Mon Sep 17 00:00:00 2001 From: Lukas <4083977+lukaskl@users.noreply.github.com> Date: Tue, 13 Dec 2022 16:36:32 +0700 Subject: [PATCH 013/167] Code review: use package-deps-hash to hash files --- .../logic/buildCache/AdditionalFilesHasher.ts | 39 ++++--------------- 1 file changed, 8 insertions(+), 31 deletions(-) diff --git a/libraries/rush-lib/src/logic/buildCache/AdditionalFilesHasher.ts b/libraries/rush-lib/src/logic/buildCache/AdditionalFilesHasher.ts index f0bdf2412e6..b6df5463101 100644 --- a/libraries/rush-lib/src/logic/buildCache/AdditionalFilesHasher.ts +++ b/libraries/rush-lib/src/logic/buildCache/AdditionalFilesHasher.ts @@ -1,8 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { Async, FileSystem, Import, LegacyAdapters } from '@rushstack/node-core-library'; -import crypto from 'crypto'; -import path from 'path'; +import { Async, Import, LegacyAdapters } from '@rushstack/node-core-library'; +import { getGitHashForFiles } from '@rushstack/package-deps-hash'; import type { IOptions } from 'glob'; @@ -15,21 +14,21 @@ const globAsync = (pattern: string, options: IOptions = {}): Promise = export class AdditionalFilesHasher { public static async getFileHashedFilesMap( globPatterns: string[], - cwd: string + packagePath: string ): Promise> { - const filePaths: Set = await this._expandGlobPatterns(globPatterns, cwd); + const filePaths: string[] = await this._expandGlobPatterns(globPatterns, packagePath); - return await this._calculateFileHashes(filePaths, cwd); + return getGitHashForFiles(filePaths, packagePath); } - private static async _expandGlobPatterns(globPatterns: string[], cwd: string): Promise> { + private static async _expandGlobPatterns(globPatterns: string[], packagePath: string): Promise { const allMatches: Set = new Set(); await Async.forEachAsync( globPatterns, async (pattern) => { const matches: string[] = await globAsync(pattern, { - cwd, + cwd: packagePath, nodir: true, // We want to keep path's type unchanged, // i.e. if the pattern was a relative path, then matched paths should also be relative paths @@ -57,28 +56,6 @@ export class AdditionalFilesHasher { ); } - return allMatches; - } - - private static async _calculateFileHashes( - filePaths: Set, - cwd: string - ): Promise> { - const fileHashes: Map = new Map(); - - await Async.forEachAsync( - filePaths, - async (filepath) => { - const fullPath: string = path.isAbsolute(filepath) ? filepath : path.join(cwd, filepath); - const content: string = await FileSystem.readFileAsync(fullPath); - - const hashValue: string = crypto.createHash('sha1').update(content).digest('hex'); - - fileHashes.set(filepath, hashValue); - }, - { concurrency: 10 } - ); - - return fileHashes; + return Array.from(allMatches); } } From f0183fd67e660b0fe2353f421ddc70c7123f9f43 Mon Sep 17 00:00:00 2001 From: sherlockfeng Date: Wed, 21 Dec 2022 15:26:05 +0800 Subject: [PATCH 014/167] feat: Execute a shell command in scope of a project --- ...d-in-scope-of-a-project_2022-12-21-07-25.json | 10 ++++++++++ common/reviews/api/rush-lib.api.md | 1 + .../rush-lib/src/api/CommandLineConfiguration.ts | 8 +++++++- libraries/rush-lib/src/api/CommandLineJson.ts | 1 + .../operations/ShellOperationRunnerPlugin.ts | 16 +++++++++++----- 5 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 common/changes/@microsoft/rush/feat-execute-a-shell-command-in-scope-of-a-project_2022-12-21-07-25.json diff --git a/common/changes/@microsoft/rush/feat-execute-a-shell-command-in-scope-of-a-project_2022-12-21-07-25.json b/common/changes/@microsoft/rush/feat-execute-a-shell-command-in-scope-of-a-project_2022-12-21-07-25.json new file mode 100644 index 00000000000..27071dc4680 --- /dev/null +++ b/common/changes/@microsoft/rush/feat-execute-a-shell-command-in-scope-of-a-project_2022-12-21-07-25.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Execute a shell command in scope of a project", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file diff --git a/common/reviews/api/rush-lib.api.md b/common/reviews/api/rush-lib.api.md index 2a0de769dcd..72488a28692 100644 --- a/common/reviews/api/rush-lib.api.md +++ b/common/reviews/api/rush-lib.api.md @@ -449,6 +449,7 @@ export interface IPhase { isSynthetic: boolean; logFilenameIdentifier: string; name: string; + shellCommand?: string; } // @beta diff --git a/libraries/rush-lib/src/api/CommandLineConfiguration.ts b/libraries/rush-lib/src/api/CommandLineConfiguration.ts index e05587797cd..5509d35c098 100644 --- a/libraries/rush-lib/src/api/CommandLineConfiguration.ts +++ b/libraries/rush-lib/src/api/CommandLineConfiguration.ts @@ -70,6 +70,11 @@ export interface IPhase { * By default, Rush returns a nonzero exit code if errors or warnings occur during a command. If this option is set to \"true\", Rush will return a zero exit code if warnings occur during the execution of this phase. */ allowWarningsOnSuccess: boolean; + + /** + * If the \"shellCommand\" field is set in a bulk type command, rush will use this command instead of \"scripts\" entry matching that the phase name + */ + shellCommand?: string; } export interface ICommandWithParameters { @@ -658,7 +663,8 @@ export class CommandLineConfiguration { upstream: new Set() }, ignoreMissingScript: !!command.ignoreMissingScript, - allowWarningsOnSuccess: !!command.allowWarningsInSuccessfulBuild + allowWarningsOnSuccess: !!command.allowWarningsInSuccessfulBuild, + shellCommand: command.shellCommand }; if (!command.ignoreDependencyOrder) { diff --git a/libraries/rush-lib/src/api/CommandLineJson.ts b/libraries/rush-lib/src/api/CommandLineJson.ts index 3d140c9473f..c9abe5468b2 100644 --- a/libraries/rush-lib/src/api/CommandLineJson.ts +++ b/libraries/rush-lib/src/api/CommandLineJson.ts @@ -14,6 +14,7 @@ export interface IBaseCommandJson { description?: string; safeForSimultaneousRushProcesses: boolean; autoinstallerName?: string; + shellCommand?: string; } /** diff --git a/libraries/rush-lib/src/logic/operations/ShellOperationRunnerPlugin.ts b/libraries/rush-lib/src/logic/operations/ShellOperationRunnerPlugin.ts index 31129619a28..e3d0db662a8 100644 --- a/libraries/rush-lib/src/logic/operations/ShellOperationRunnerPlugin.ts +++ b/libraries/rush-lib/src/logic/operations/ShellOperationRunnerPlugin.ts @@ -61,7 +61,12 @@ function createShellOperations( // to specify a runner type requested in rush-project.json const customParameterValues: ReadonlyArray = getCustomParameterValuesForPhase(phase); - const commandToRun: string | undefined = getScriptToRun(project, phase.name, customParameterValues); + const commandToRun: string | undefined = getScriptToRun( + project, + phase.name, + customParameterValues, + phase.shellCommand + ); if (commandToRun === undefined && !phase.ignoreMissingScript) { throw new Error( @@ -71,10 +76,10 @@ function createShellOperations( const displayName: string = getDisplayName(phase, project); - if (commandToRun) { + if (commandToRun || phase.shellCommand) { operation.runner = new ShellOperationRunner({ buildCacheConfiguration, - commandToRun: commandToRun || '', + commandToRun: phase.shellCommand || commandToRun || '', displayName, isIncrementalBuildAllowed, phase, @@ -100,11 +105,12 @@ function createShellOperations( function getScriptToRun( rushProject: RushConfigurationProject, commandToRun: string, - customParameterValues: ReadonlyArray + customParameterValues: ReadonlyArray, + shellCommand?: string ): string | undefined { const { scripts } = rushProject.packageJson; - const rawCommand: string | undefined | null = scripts?.[commandToRun]; + const rawCommand: string | undefined | null = scripts?.[commandToRun] ?? shellCommand; if (rawCommand === undefined || rawCommand === null) { return undefined; From 58d13a5f80c1e5f94e5453737267154054a5ce00 Mon Sep 17 00:00:00 2001 From: sherlockfeng Date: Thu, 22 Dec 2022 15:22:53 +0800 Subject: [PATCH 015/167] feat: add test and fix conversation issue --- .../api/test/CommandLineConfiguration.test.ts | 34 +++++- .../operations/ShellOperationRunnerPlugin.ts | 6 +- .../test/ShellOperationRunnerPlugin.test.ts | 110 ++++++++++++++++++ .../ShellOperationRunnerPlugin.test.ts.snap | 27 +++++ .../a/package.json | 9 ++ .../b/package.json | 10 ++ .../common/config/rush/command-line.json | 21 ++++ .../rush.json | 17 +++ .../a/package.json | 9 ++ .../b/package.json | 9 ++ .../common/config/rush/command-line.json | 21 ++++ .../customShellCommandinBulkRepo/rush.json | 17 +++ .../src/schemas/command-line.schema.json | 3 +- 13 files changed, 288 insertions(+), 5 deletions(-) create mode 100644 libraries/rush-lib/src/logic/operations/test/ShellOperationRunnerPlugin.test.ts create mode 100644 libraries/rush-lib/src/logic/operations/test/__snapshots__/ShellOperationRunnerPlugin.test.ts.snap create mode 100644 libraries/rush-lib/src/logic/test/customShellCommandinBulkOverrideScriptsRepo/a/package.json create mode 100644 libraries/rush-lib/src/logic/test/customShellCommandinBulkOverrideScriptsRepo/b/package.json create mode 100644 libraries/rush-lib/src/logic/test/customShellCommandinBulkOverrideScriptsRepo/common/config/rush/command-line.json create mode 100644 libraries/rush-lib/src/logic/test/customShellCommandinBulkOverrideScriptsRepo/rush.json create mode 100644 libraries/rush-lib/src/logic/test/customShellCommandinBulkRepo/a/package.json create mode 100644 libraries/rush-lib/src/logic/test/customShellCommandinBulkRepo/b/package.json create mode 100644 libraries/rush-lib/src/logic/test/customShellCommandinBulkRepo/common/config/rush/command-line.json create mode 100644 libraries/rush-lib/src/logic/test/customShellCommandinBulkRepo/rush.json diff --git a/libraries/rush-lib/src/api/test/CommandLineConfiguration.test.ts b/libraries/rush-lib/src/api/test/CommandLineConfiguration.test.ts index ea069525820..7bb8fe2d795 100644 --- a/libraries/rush-lib/src/api/test/CommandLineConfiguration.test.ts +++ b/libraries/rush-lib/src/api/test/CommandLineConfiguration.test.ts @@ -2,7 +2,13 @@ // See LICENSE in the project root for license information. import { RushConstants } from '../../logic/RushConstants'; -import { Command, CommandLineConfiguration, IParameterJson, IPhase } from '../CommandLineConfiguration'; +import { + IPhasedCommandConfig, + CommandLineConfiguration, + IParameterJson, + IPhase, + Command +} from '../CommandLineConfiguration'; describe(CommandLineConfiguration.name, () => { it('Forbids a misnamed phase', () => { @@ -262,4 +268,30 @@ describe(CommandLineConfiguration.name, () => { expect(phaseParametersArray).toHaveLength(0); }); }); + + describe('shellCommand in bulk command', () => { + it('get "custom-shell-command-echo" command', () => { + const commandLineConfiguration: CommandLineConfiguration = new CommandLineConfiguration({ + commands: [ + { + commandKind: 'bulk', + name: 'custom-shell-command-echo', + summary: 'custom define bulk shellCommand echo', + enableParallelism: true, + safeForSimultaneousRushProcesses: false, + shellCommand: 'echo' + } + ] + }); + + const command: IPhasedCommandConfig | undefined = commandLineConfiguration.commands.get( + 'custom-shell-command-echo' + ) as IPhasedCommandConfig; + expect(command).toBeDefined(); + expect(command?.phases).toBeDefined(); + const phase = [...command?.phases][0]; + expect(phase.name).toEqual('custom-shell-command-echo'); + expect(phase.shellCommand).toEqual('echo'); + }); + }); }); diff --git a/libraries/rush-lib/src/logic/operations/ShellOperationRunnerPlugin.ts b/libraries/rush-lib/src/logic/operations/ShellOperationRunnerPlugin.ts index e3d0db662a8..f59a1d51b6e 100644 --- a/libraries/rush-lib/src/logic/operations/ShellOperationRunnerPlugin.ts +++ b/libraries/rush-lib/src/logic/operations/ShellOperationRunnerPlugin.ts @@ -76,10 +76,10 @@ function createShellOperations( const displayName: string = getDisplayName(phase, project); - if (commandToRun || phase.shellCommand) { + if (commandToRun) { operation.runner = new ShellOperationRunner({ buildCacheConfiguration, - commandToRun: phase.shellCommand || commandToRun || '', + commandToRun: commandToRun || '', displayName, isIncrementalBuildAllowed, phase, @@ -110,7 +110,7 @@ function getScriptToRun( ): string | undefined { const { scripts } = rushProject.packageJson; - const rawCommand: string | undefined | null = scripts?.[commandToRun] ?? shellCommand; + const rawCommand: string | undefined | null = shellCommand ?? scripts?.[commandToRun]; if (rawCommand === undefined || rawCommand === null) { return undefined; diff --git a/libraries/rush-lib/src/logic/operations/test/ShellOperationRunnerPlugin.test.ts b/libraries/rush-lib/src/logic/operations/test/ShellOperationRunnerPlugin.test.ts new file mode 100644 index 00000000000..66f95ffec73 --- /dev/null +++ b/libraries/rush-lib/src/logic/operations/test/ShellOperationRunnerPlugin.test.ts @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import path from 'path'; +import { JsonFile } from '@rushstack/node-core-library'; + +import { RushConfiguration } from '../../../api/RushConfiguration'; +import { CommandLineConfiguration, IPhasedCommandConfig } from '../../../api/CommandLineConfiguration'; +import { Operation } from '../Operation'; +import { ICommandLineJson } from '../../../api/CommandLineJson'; +import { PhasedOperationPlugin } from '../PhasedOperationPlugin'; +import { ShellOperationRunnerPlugin } from '../ShellOperationRunnerPlugin'; +import { ICreateOperationsContext, PhasedCommandHooks } from '../../../pluginFramework/PhasedCommandHooks'; +import { ShellOperationRunner } from '../ShellOperationRunner'; + +interface ISerializedOperation { + name: string; + commandToRun: string; +} + +function serializeOperation(operation: Operation): ISerializedOperation { + return { + name: operation.name!, + commandToRun: (operation.runner as ShellOperationRunner)['_commandToRun'] + }; +} + +describe(ShellOperationRunnerPlugin.name, () => { + it('shellCommand "echo custom shellCommand" should be set to commandToRun', async () => { + const rushJsonFile: string = path.resolve(__dirname, `../../test/customShellCommandinBulkRepo/rush.json`); + const commandLineJsonFile: string = path.resolve( + __dirname, + `../../test/customShellCommandinBulkRepo/common/config/rush/command-line.json` + ); + + const rushConfiguration = RushConfiguration.loadFromConfigurationFile(rushJsonFile); + const commandLineJson: ICommandLineJson = JsonFile.load(commandLineJsonFile); + + const commandLineConfiguration = new CommandLineConfiguration(commandLineJson); + + const echoCommand: IPhasedCommandConfig = commandLineConfiguration.commands.get( + 'echo' + )! as IPhasedCommandConfig; + + const fakeCreateOperationsContext: Pick< + ICreateOperationsContext, + 'phaseSelection' | 'projectSelection' | 'projectsInUnknownState' + > = { + phaseSelection: echoCommand.phases, + projectSelection: new Set(rushConfiguration.projects), + projectsInUnknownState: new Set(rushConfiguration.projects) + }; + + const hooks: PhasedCommandHooks = new PhasedCommandHooks(); + + // Generates the default operation graph + new PhasedOperationPlugin().apply(hooks); + // Applies the Shell Operation Runner to selected operations + new ShellOperationRunnerPlugin().apply(hooks); + + const operations: Set = await hooks.createOperations.promise( + new Set(), + fakeCreateOperationsContext as ICreateOperationsContext + ); + // All projects + expect(Array.from(operations, serializeOperation)).toMatchSnapshot(); + }); + + it('shellCommand priority should be higher than script name', async () => { + const rushJsonFile: string = path.resolve( + __dirname, + `../../test/customShellCommandinBulkOverrideScriptsRepo/rush.json` + ); + const commandLineJsonFile: string = path.resolve( + __dirname, + `../../test/customShellCommandinBulkOverrideScriptsRepo/common/config/rush/command-line.json` + ); + + const rushConfiguration = RushConfiguration.loadFromConfigurationFile(rushJsonFile); + const commandLineJson: ICommandLineJson = JsonFile.load(commandLineJsonFile); + + const commandLineConfiguration = new CommandLineConfiguration(commandLineJson); + const echoCommand: IPhasedCommandConfig = commandLineConfiguration.commands.get( + 'echo' + )! as IPhasedCommandConfig; + + const fakeCreateOperationsContext: Pick< + ICreateOperationsContext, + 'phaseSelection' | 'projectSelection' | 'projectsInUnknownState' + > = { + phaseSelection: echoCommand.phases, + projectSelection: new Set(rushConfiguration.projects), + projectsInUnknownState: new Set(rushConfiguration.projects) + }; + + const hooks: PhasedCommandHooks = new PhasedCommandHooks(); + + // Generates the default operation graph + new PhasedOperationPlugin().apply(hooks); + // Applies the Shell Operation Runner to selected operations + new ShellOperationRunnerPlugin().apply(hooks); + + const operations: Set = await hooks.createOperations.promise( + new Set(), + fakeCreateOperationsContext as ICreateOperationsContext + ); + // All projects + expect(Array.from(operations, serializeOperation)).toMatchSnapshot(); + }); +}); diff --git a/libraries/rush-lib/src/logic/operations/test/__snapshots__/ShellOperationRunnerPlugin.test.ts.snap b/libraries/rush-lib/src/logic/operations/test/__snapshots__/ShellOperationRunnerPlugin.test.ts.snap new file mode 100644 index 00000000000..f5990af4d43 --- /dev/null +++ b/libraries/rush-lib/src/logic/operations/test/__snapshots__/ShellOperationRunnerPlugin.test.ts.snap @@ -0,0 +1,27 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ShellOperationRunnerPlugin shellCommand "echo custom shellCommand" should be set to commandToRun 1`] = ` +Array [ + Object { + "commandToRun": "echo custom shellCommand ", + "name": "a", + }, + Object { + "commandToRun": "echo custom shellCommand ", + "name": "b", + }, +] +`; + +exports[`ShellOperationRunnerPlugin shellCommand priority should be higher than script name 1`] = ` +Array [ + Object { + "commandToRun": "echo custom shellCommand ", + "name": "a", + }, + Object { + "commandToRun": "echo custom shellCommand ", + "name": "b", + }, +] +`; diff --git a/libraries/rush-lib/src/logic/test/customShellCommandinBulkOverrideScriptsRepo/a/package.json b/libraries/rush-lib/src/logic/test/customShellCommandinBulkOverrideScriptsRepo/a/package.json new file mode 100644 index 00000000000..f00575e3099 --- /dev/null +++ b/libraries/rush-lib/src/logic/test/customShellCommandinBulkOverrideScriptsRepo/a/package.json @@ -0,0 +1,9 @@ +{ + "name": "a", + "version": "1.0.0", + "description": "Test package a", + "scripts": { + "build": "fake_build_task_but_works_with_mock", + "rebuild": "fake_REbuild_task_but_works_with_mock" + } +} diff --git a/libraries/rush-lib/src/logic/test/customShellCommandinBulkOverrideScriptsRepo/b/package.json b/libraries/rush-lib/src/logic/test/customShellCommandinBulkOverrideScriptsRepo/b/package.json new file mode 100644 index 00000000000..8b915354e7c --- /dev/null +++ b/libraries/rush-lib/src/logic/test/customShellCommandinBulkOverrideScriptsRepo/b/package.json @@ -0,0 +1,10 @@ +{ + "name": "b", + "version": "1.0.0", + "description": "Test package b", + "scripts": { + "build": "fake_build_task_but_works_with_mock", + "rebuild": "fake_REbuild_task_but_works_with_mock", + "echo": "fake_echo_task_but_works_with_mock" + } +} diff --git a/libraries/rush-lib/src/logic/test/customShellCommandinBulkOverrideScriptsRepo/common/config/rush/command-line.json b/libraries/rush-lib/src/logic/test/customShellCommandinBulkOverrideScriptsRepo/common/config/rush/command-line.json new file mode 100644 index 00000000000..4070ff96146 --- /dev/null +++ b/libraries/rush-lib/src/logic/test/customShellCommandinBulkOverrideScriptsRepo/common/config/rush/command-line.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/command-line.schema.json", + "commands": [ + { + "commandKind": "bulk", + "name": "echo", + "summary": "execute 'echo' command", + "description": "execute 'echo' command for selected project", + "enableParallelism": true, + "shellCommand": "echo custom shellCommand" + } + ], + "parameters": [ + { + "longName": "--flag-for-echo", + "description": "This flag should be usable for build and rebuild commands.", + "parameterKind": "flag", + "associatedCommands": ["echo"] + } + ] +} diff --git a/libraries/rush-lib/src/logic/test/customShellCommandinBulkOverrideScriptsRepo/rush.json b/libraries/rush-lib/src/logic/test/customShellCommandinBulkOverrideScriptsRepo/rush.json new file mode 100644 index 00000000000..f39da1606c4 --- /dev/null +++ b/libraries/rush-lib/src/logic/test/customShellCommandinBulkOverrideScriptsRepo/rush.json @@ -0,0 +1,17 @@ +{ + "npmVersion": "6.4.1", + "rushVersion": "5.5.2", + "projectFolderMinDepth": 1, + "projectFolderMaxDepth": 99, + + "projects": [ + { + "packageName": "a", + "projectFolder": "a" + }, + { + "packageName": "b", + "projectFolder": "b" + } + ] +} diff --git a/libraries/rush-lib/src/logic/test/customShellCommandinBulkRepo/a/package.json b/libraries/rush-lib/src/logic/test/customShellCommandinBulkRepo/a/package.json new file mode 100644 index 00000000000..f00575e3099 --- /dev/null +++ b/libraries/rush-lib/src/logic/test/customShellCommandinBulkRepo/a/package.json @@ -0,0 +1,9 @@ +{ + "name": "a", + "version": "1.0.0", + "description": "Test package a", + "scripts": { + "build": "fake_build_task_but_works_with_mock", + "rebuild": "fake_REbuild_task_but_works_with_mock" + } +} diff --git a/libraries/rush-lib/src/logic/test/customShellCommandinBulkRepo/b/package.json b/libraries/rush-lib/src/logic/test/customShellCommandinBulkRepo/b/package.json new file mode 100644 index 00000000000..8f203bb691d --- /dev/null +++ b/libraries/rush-lib/src/logic/test/customShellCommandinBulkRepo/b/package.json @@ -0,0 +1,9 @@ +{ + "name": "b", + "version": "1.0.0", + "description": "Test package b", + "scripts": { + "build": "fake_build_task_but_works_with_mock", + "rebuild": "fake_REbuild_task_but_works_with_mock" + } +} diff --git a/libraries/rush-lib/src/logic/test/customShellCommandinBulkRepo/common/config/rush/command-line.json b/libraries/rush-lib/src/logic/test/customShellCommandinBulkRepo/common/config/rush/command-line.json new file mode 100644 index 00000000000..4070ff96146 --- /dev/null +++ b/libraries/rush-lib/src/logic/test/customShellCommandinBulkRepo/common/config/rush/command-line.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/command-line.schema.json", + "commands": [ + { + "commandKind": "bulk", + "name": "echo", + "summary": "execute 'echo' command", + "description": "execute 'echo' command for selected project", + "enableParallelism": true, + "shellCommand": "echo custom shellCommand" + } + ], + "parameters": [ + { + "longName": "--flag-for-echo", + "description": "This flag should be usable for build and rebuild commands.", + "parameterKind": "flag", + "associatedCommands": ["echo"] + } + ] +} diff --git a/libraries/rush-lib/src/logic/test/customShellCommandinBulkRepo/rush.json b/libraries/rush-lib/src/logic/test/customShellCommandinBulkRepo/rush.json new file mode 100644 index 00000000000..f39da1606c4 --- /dev/null +++ b/libraries/rush-lib/src/logic/test/customShellCommandinBulkRepo/rush.json @@ -0,0 +1,17 @@ +{ + "npmVersion": "6.4.1", + "rushVersion": "5.5.2", + "projectFolderMinDepth": 1, + "projectFolderMaxDepth": 99, + + "projects": [ + { + "packageName": "a", + "projectFolder": "a" + }, + { + "packageName": "b", + "projectFolder": "b" + } + ] +} diff --git a/libraries/rush-lib/src/schemas/command-line.schema.json b/libraries/rush-lib/src/schemas/command-line.schema.json index a1a27511adb..ba71a255eca 100644 --- a/libraries/rush-lib/src/schemas/command-line.schema.json +++ b/libraries/rush-lib/src/schemas/command-line.schema.json @@ -109,7 +109,8 @@ "incremental": { "$ref": "#/definitions/anything" }, "allowWarningsInSuccessfulBuild": { "$ref": "#/definitions/anything" }, "watchForChanges": { "$ref": "#/definitions/anything" }, - "disableBuildCache": { "$ref": "#/definitions/anything" } + "disableBuildCache": { "$ref": "#/definitions/anything" }, + "shellCommand": { "$ref": "#/definitions/anything" } } } ] From 39f63b0acb1d113074679c8582bea879e0d89636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20S=CC=8Ctekl?= Date: Thu, 5 Jan 2023 11:37:12 +0100 Subject: [PATCH 016/167] [rush] Create custom git hooks instead of copy --- .../stekycz-git-hooks-exec_2023-01-05-10-36.json | 10 ++++++++++ .../rush-lib/src/logic/base/BaseInstallManager.ts | 15 +++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 common/changes/@microsoft/rush/stekycz-git-hooks-exec_2023-01-05-10-36.json diff --git a/common/changes/@microsoft/rush/stekycz-git-hooks-exec_2023-01-05-10-36.json b/common/changes/@microsoft/rush/stekycz-git-hooks-exec_2023-01-05-10-36.json new file mode 100644 index 00000000000..11653445111 --- /dev/null +++ b/common/changes/@microsoft/rush/stekycz-git-hooks-exec_2023-01-05-10-36.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "[rush] Create custom git hooks instead of copy", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file diff --git a/libraries/rush-lib/src/logic/base/BaseInstallManager.ts b/libraries/rush-lib/src/logic/base/BaseInstallManager.ts index 17c9a0dabb1..ac988115d16 100644 --- a/libraries/rush-lib/src/logic/base/BaseInstallManager.ts +++ b/libraries/rush-lib/src/logic/base/BaseInstallManager.ts @@ -449,11 +449,22 @@ export abstract class BaseInstallManager { // Clear the currently installed git hooks and install fresh copies FileSystem.ensureEmptyFolder(hookDestination); + // Find the relative path from Git hooks directory to the directory storing the actual scripts. + const hookRelativePath: string = path.relative(hookDestination, hookSource); + // Only copy files that look like Git hook names const filteredHookFilenames: string[] = hookFilenames.filter((x) => /^[a-z\-]+/.test(x)); for (const filename of filteredHookFilenames) { - // Copy the file. Important: For Bash scripts, the EOL must not be CRLF. - const hookFileContent: string = FileSystem.readFile(path.join(hookSource, filename)); + const hookFileContent: string = `#!/bin/bash +SCRIPT_DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +SCRIPT_IMPLEMENTATION_PATH="$SCRIPT_DIR/${hookRelativePath}/${filename}" +if [[ -f "$SCRIPT_IMPLEMENTATION_PATH" ]]; then + exec "$SCRIPT_IMPLEMENTATION_PATH" +else + echo "The ${filename} Git hook does not exist in your version of the repo. Either remove the ${filename} hook file (e.g. '.git/hooks/${filename}') in case this feature is not used anymore in main branch. Otherwise, updating your branch to current mainstream will solve the issue." +fi +`; + // Create the hook file. Important: For Bash scripts, the EOL must not be CRLF. FileSystem.writeFile(path.join(hookDestination, filename), hookFileContent, { convertLineEndings: NewlineKind.Lf }); From f9878ba1e3bf97498db72f8890f940a0ed3dc356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20S=CC=8Ctekl?= Date: Tue, 10 Jan 2023 15:42:26 +0100 Subject: [PATCH 017/167] Ensure hook relative path to always use slashes --- libraries/rush-lib/src/logic/base/BaseInstallManager.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/rush-lib/src/logic/base/BaseInstallManager.ts b/libraries/rush-lib/src/logic/base/BaseInstallManager.ts index ac988115d16..1dd39d612cf 100644 --- a/libraries/rush-lib/src/logic/base/BaseInstallManager.ts +++ b/libraries/rush-lib/src/logic/base/BaseInstallManager.ts @@ -16,7 +16,8 @@ import { FileSystemStats, ConsoleTerminalProvider, Terminal, - ITerminalProvider + ITerminalProvider, + Path } from '@rushstack/node-core-library'; import { PrintUtilities } from '@rushstack/terminal'; @@ -450,7 +451,7 @@ export abstract class BaseInstallManager { FileSystem.ensureEmptyFolder(hookDestination); // Find the relative path from Git hooks directory to the directory storing the actual scripts. - const hookRelativePath: string = path.relative(hookDestination, hookSource); + const hookRelativePath: string = Path.convertToSlashes(path.relative(hookDestination, hookSource)); // Only copy files that look like Git hook names const filteredHookFilenames: string[] = hookFilenames.filter((x) => /^[a-z\-]+/.test(x)); From c2fc78c917ff50fa8a9390e7ace0e25f591ed313 Mon Sep 17 00:00:00 2001 From: Lukas <4083977+lukaskl@users.noreply.github.com> Date: Wed, 11 Jan 2023 19:29:27 +0700 Subject: [PATCH 018/167] Code review: update getHashesForGlobsAsync function --- .../logic/buildCache/AdditionalFilesHasher.ts | 61 ------------------ .../buildCache/getHashesForGlobsAsync.ts | 62 +++++++++++++++++++ .../logic/operations/ShellOperationRunner.ts | 11 ++-- 3 files changed, 67 insertions(+), 67 deletions(-) delete mode 100644 libraries/rush-lib/src/logic/buildCache/AdditionalFilesHasher.ts create mode 100644 libraries/rush-lib/src/logic/buildCache/getHashesForGlobsAsync.ts diff --git a/libraries/rush-lib/src/logic/buildCache/AdditionalFilesHasher.ts b/libraries/rush-lib/src/logic/buildCache/AdditionalFilesHasher.ts deleted file mode 100644 index b6df5463101..00000000000 --- a/libraries/rush-lib/src/logic/buildCache/AdditionalFilesHasher.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. -// See LICENSE in the project root for license information. -import { Async, Import, LegacyAdapters } from '@rushstack/node-core-library'; -import { getGitHashForFiles } from '@rushstack/package-deps-hash'; - -import type { IOptions } from 'glob'; - -const glob: typeof import('glob') = Import.lazy('glob', require); - -const globAsync = (pattern: string, options: IOptions = {}): Promise => { - return LegacyAdapters.convertCallbackToPromise(glob, pattern, options); -}; - -export class AdditionalFilesHasher { - public static async getFileHashedFilesMap( - globPatterns: string[], - packagePath: string - ): Promise> { - const filePaths: string[] = await this._expandGlobPatterns(globPatterns, packagePath); - - return getGitHashForFiles(filePaths, packagePath); - } - - private static async _expandGlobPatterns(globPatterns: string[], packagePath: string): Promise { - const allMatches: Set = new Set(); - - await Async.forEachAsync( - globPatterns, - async (pattern) => { - const matches: string[] = await globAsync(pattern, { - cwd: packagePath, - nodir: true, - // We want to keep path's type unchanged, - // i.e. if the pattern was a relative path, then matched paths should also be relative paths - // if the pattern was an absolute path, then matched paths should also be absolute paths - // - // We are doing this because these paths are going to be used to calculate a hash for the build cache and some users - // might choose to depend on global files (e.g. `/etc/os-release`) and some might choose to depend on local files - // (e.g. `../path/to/workspace/file`) - // - // In both cases we want that path to the resource would be the same on all machines, - // regardless of what is the current working directory. - // - // That being said, we want to keep `realpath` and `absolute` options here as false: - realpath: false, - absolute: false - }); - matches.forEach((match) => allMatches.add(match)); - }, - { concurrency: 10 } - ); - - if (allMatches.size === 0) { - throw new Error( - `Couldn't find any files matching provided glob patterns: ["${globPatterns.join('", "')}"].` - ); - } - - return Array.from(allMatches); - } -} diff --git a/libraries/rush-lib/src/logic/buildCache/getHashesForGlobsAsync.ts b/libraries/rush-lib/src/logic/buildCache/getHashesForGlobsAsync.ts new file mode 100644 index 00000000000..59588a69363 --- /dev/null +++ b/libraries/rush-lib/src/logic/buildCache/getHashesForGlobsAsync.ts @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. +import { Async, Import, LegacyAdapters } from '@rushstack/node-core-library'; +import { getGitHashForFiles } from '@rushstack/package-deps-hash'; + +import type { IOptions } from 'glob'; + +const glob: typeof import('glob') = Import.lazy('glob', require); + +const globAsync = (pattern: string, options: IOptions = {}): Promise => { + return LegacyAdapters.convertCallbackToPromise(glob, pattern, options); +}; + +async function expandGlobPatternsAsync( + globPatterns: Iterable, + packagePath: string +): Promise { + const allMatches: Set = new Set(); + + await Async.forEachAsync( + globPatterns, + async (pattern) => { + const matches: string[] = await globAsync(pattern, { + cwd: packagePath, + nodir: true, + // We want to keep path's type unchanged, + // i.e. if the pattern was a relative path, then matched paths should also be relative paths + // if the pattern was an absolute path, then matched paths should also be absolute paths + // + // We are doing this because these paths are going to be used to calculate a hash for the build cache and some users + // might choose to depend on global files (e.g. `/etc/os-release`) and some might choose to depend on local files + // (e.g. `../path/to/workspace/file`) + // + // In both cases we want that path to the resource would be the same on all machines, + // regardless of what is the current working directory. + // + // That being said, we want to keep `realpath` and `absolute` options here as false: + realpath: false, + absolute: false + }); + matches.forEach((match) => allMatches.add(match)); + }, + { concurrency: 10 } + ); + + if (allMatches.size === 0) { + throw new Error( + `Couldn't find any files matching provided glob patterns: ["${Array.from(globPatterns).join('", "')}"].` + ); + } + + return Array.from(allMatches); +} + +export async function getHashesForGlobsAsync( + globPatterns: Iterable, + packagePath: string +): Promise> { + const filePaths: string[] = await expandGlobPatternsAsync(globPatterns, packagePath); + + return getGitHashForFiles(filePaths, packagePath); +} diff --git a/libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts b/libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts index aef6e17f198..b9a62d7af59 100644 --- a/libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts +++ b/libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts @@ -29,7 +29,7 @@ import { OperationError } from './OperationError'; import { IOperationRunner, IOperationRunnerContext } from './IOperationRunner'; import { ProjectLogWritable } from './ProjectLogWritable'; import { ProjectBuildCache } from '../buildCache/ProjectBuildCache'; -import { AdditionalFilesHasher } from '../buildCache/AdditionalFilesHasher'; +import { getHashesForGlobsAsync } from '../buildCache/getHashesForGlobsAsync'; import { IOperationSettings, RushProjectConfiguration } from '../../api/RushProjectConfiguration'; import { CollatedTerminalProvider } from '../../utilities/CollatedTerminalProvider'; import { RushConstants } from '../RushConstants'; @@ -452,11 +452,10 @@ export class ShellOperationRunner implements IOperationRunner { } } if (operationSettings.dependsOnAdditionalFiles) { - const additionalFiles: Map = - await AdditionalFilesHasher.getFileHashedFilesMap( - operationSettings.dependsOnAdditionalFiles, - this._rushProject.projectFolder - ); + const additionalFiles: Map = await getHashesForGlobsAsync( + operationSettings.dependsOnAdditionalFiles, + this._rushProject.projectFolder + ); terminal.writeDebugLine( `Including additional files to calculate build cache hash:\n ${Array.from( From 989175b6d427b527d265705a2380bd5a46bf2611 Mon Sep 17 00:00:00 2001 From: Lukas <4083977+lukaskl@users.noreply.github.com> Date: Wed, 11 Jan 2023 23:14:10 +0700 Subject: [PATCH 019/167] Optimize "dependsOnAdditionalFiles" option by reusing known git hashes --- .../src/logic/ProjectChangeAnalyzer.ts | 12 +++- .../buildCache/getHashesForGlobsAsync.ts | 64 ++++++++++++++++++- .../logic/operations/ShellOperationRunner.ts | 9 ++- 3 files changed, 77 insertions(+), 8 deletions(-) diff --git a/libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts b/libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts index da0f2cd2413..f7353446860 100644 --- a/libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts +++ b/libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts @@ -51,9 +51,13 @@ interface IGitState { rootDir: string; } -interface IRawRepoState { +/** + * @internal + */ +export interface IRawRepoState { projectState: Map> | undefined; rootDir: string; + rawHashes: Map; } /** @@ -331,7 +335,8 @@ export class ProjectChangeAnalyzer { // Mark as resolved, but no data return { projectState: undefined, - rootDir: this._rushConfiguration.rushJsonFolder + rootDir: this._rushConfiguration.rushJsonFolder, + rawHashes: new Map() }; } @@ -416,7 +421,8 @@ export class ProjectChangeAnalyzer { return { projectState: projectHashDeps, - rootDir + rootDir, + rawHashes: repoState.hashes }; } diff --git a/libraries/rush-lib/src/logic/buildCache/getHashesForGlobsAsync.ts b/libraries/rush-lib/src/logic/buildCache/getHashesForGlobsAsync.ts index 59588a69363..4e3f136602a 100644 --- a/libraries/rush-lib/src/logic/buildCache/getHashesForGlobsAsync.ts +++ b/libraries/rush-lib/src/logic/buildCache/getHashesForGlobsAsync.ts @@ -2,8 +2,9 @@ // See LICENSE in the project root for license information. import { Async, Import, LegacyAdapters } from '@rushstack/node-core-library'; import { getGitHashForFiles } from '@rushstack/package-deps-hash'; - +import * as path from 'path'; import type { IOptions } from 'glob'; +import type { IRawRepoState } from '../ProjectChangeAnalyzer'; const glob: typeof import('glob') = Import.lazy('glob', require); @@ -52,11 +53,68 @@ async function expandGlobPatternsAsync( return Array.from(allMatches); } +interface IKnownHashesResult { + foundPaths: Map; + missingPaths: string[]; +} + +function getKnownHashes( + filePaths: string[], + packagePath: string, + repoState: IRawRepoState +): IKnownHashesResult { + const missingPaths: string[] = []; + const foundPaths: Map = new Map(); + + for (const filePath of filePaths) { + const absolutePath: string = path.isAbsolute(filePath) ? filePath : path.join(packagePath, filePath); + + /** + * We are using RegExp here to prevent false positives in the following string.replace function + * - `^` anchor makes sure that we are replacing only the beginning of the string + * - extra `/` makes sure that we are remove extra slash from the relative path + */ + const gitFilePath: string = absolutePath.replace(new RegExp('^' + repoState.rootDir + '/'), ''); + const foundHash: string | undefined = repoState.rawHashes.get(gitFilePath); + + if (foundHash) { + foundPaths.set(filePath, foundHash); + } else { + missingPaths.push(filePath); + } + } + + return { foundPaths, missingPaths }; +} + export async function getHashesForGlobsAsync( globPatterns: Iterable, - packagePath: string + packagePath: string, + repoState: IRawRepoState | undefined ): Promise> { const filePaths: string[] = await expandGlobPatternsAsync(globPatterns, packagePath); - return getGitHashForFiles(filePaths, packagePath); + if (!repoState) { + return getGitHashForFiles(filePaths, packagePath); + } + + const { foundPaths, missingPaths } = getKnownHashes(filePaths, packagePath, repoState); + const calculatedHashes: Map = getGitHashForFiles(missingPaths, packagePath); + + /** + * We want to keep the order of the output the same regardless whether the file was already + * hashed by git or not (as this can change, e.g. due to .gitignore). + * Therefore we will populate our final hashes map in the same order as `filePaths`. + */ + const result: Map = new Map(); + for (const filePath of filePaths) { + const hash: string | undefined = foundPaths.get(filePath) || calculatedHashes.get(filePath); + if (!hash) { + // Sanity check -- this should never happen + throw new Error(`Failed to calculate hash of file: "${filePath}"`); + } + result.set(filePath, hash); + } + + return result; } diff --git a/libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts b/libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts index b9a62d7af59..d5d57bbfbd3 100644 --- a/libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts +++ b/libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts @@ -38,7 +38,7 @@ import { OperationStateFile } from './OperationStateFile'; import type { RushConfiguration } from '../../api/RushConfiguration'; import type { RushConfigurationProject } from '../../api/RushConfigurationProject'; -import type { ProjectChangeAnalyzer } from '../ProjectChangeAnalyzer'; +import type { ProjectChangeAnalyzer, IRawRepoState } from '../ProjectChangeAnalyzer'; import type { BuildCacheConfiguration } from '../../api/BuildCacheConfiguration'; import type { IPhase } from '../../api/CommandLineConfiguration'; @@ -451,10 +451,15 @@ export class ShellOperationRunner implements IOperationRunner { additionalContext['$' + varName] = process.env[varName] || ''; } } + if (operationSettings.dependsOnAdditionalFiles) { + const repoState: IRawRepoState | undefined = + this._projectChangeAnalyzer._ensureInitialized(terminal); + const additionalFiles: Map = await getHashesForGlobsAsync( operationSettings.dependsOnAdditionalFiles, - this._rushProject.projectFolder + this._rushProject.projectFolder, + repoState ); terminal.writeDebugLine( From 205c834c6b47491e305d41c300f466a5d6880aae Mon Sep 17 00:00:00 2001 From: Will Huang Date: Wed, 21 Dec 2022 17:31:11 -0500 Subject: [PATCH 020/167] feat: added first component to rushstack components --- apps/lockfile-explorer-web/package.json | 3 +- apps/lockfile-explorer-web/src/App.tsx | 2 + .../containers/SelectedEntryPreview/index.tsx | 2 + apps/rush-components/.eslintrc.js | 7 + apps/rush-components/.npmignore | 30 ++++ apps/rush-components/LICENSE | 24 +++ apps/rush-components/README.md | 83 ++++++++++ apps/rush-components/assets/index.html | 12 ++ apps/rush-components/config/heft.json | 129 ++++++++++++++++ apps/rush-components/config/jest.config.json | 6 + apps/rush-components/config/rig.json | 6 + apps/rush-components/package.json | 31 ++++ .../src/components/Button/index.tsx | 5 + .../src/components/ScrollArea/index.tsx | 27 ++++ .../src/components/ScrollArea/styles.scss | 79 ++++++++++ apps/rush-components/src/start.ts | 2 + apps/rush-components/tsconfig.json | 8 + apps/rush-components/tsconfig.type.json | 7 + apps/rush-components/webpack.config.js | 40 +++++ .../rush/browser-approved-packages.json | 8 + common/config/rush/pnpm-lock.yaml | 145 ++++++++++++++++++ common/config/rush/repo-state.json | 2 +- rush.json | 5 + 23 files changed, 661 insertions(+), 2 deletions(-) create mode 100644 apps/rush-components/.eslintrc.js create mode 100644 apps/rush-components/.npmignore create mode 100644 apps/rush-components/LICENSE create mode 100644 apps/rush-components/README.md create mode 100644 apps/rush-components/assets/index.html create mode 100644 apps/rush-components/config/heft.json create mode 100644 apps/rush-components/config/jest.config.json create mode 100644 apps/rush-components/config/rig.json create mode 100644 apps/rush-components/package.json create mode 100644 apps/rush-components/src/components/Button/index.tsx create mode 100644 apps/rush-components/src/components/ScrollArea/index.tsx create mode 100644 apps/rush-components/src/components/ScrollArea/styles.scss create mode 100644 apps/rush-components/src/start.ts create mode 100644 apps/rush-components/tsconfig.json create mode 100644 apps/rush-components/tsconfig.type.json create mode 100644 apps/rush-components/webpack.config.js diff --git a/apps/lockfile-explorer-web/package.json b/apps/lockfile-explorer-web/package.json index 2a3564d9c03..083e84cf130 100644 --- a/apps/lockfile-explorer-web/package.json +++ b/apps/lockfile-explorer-web/package.json @@ -18,7 +18,8 @@ "@lifaon/path": "~2.1.0", "@reduxjs/toolkit": "~1.8.6", "react-redux": "~8.0.4", - "redux": "~4.2.0" + "redux": "~4.2.0", + "@rushstack/components": "workspace:*" }, "devDependencies": { "@rushstack/eslint-config": "workspace:*", diff --git a/apps/lockfile-explorer-web/src/App.tsx b/apps/lockfile-explorer-web/src/App.tsx index e0d110a2c62..586019aed5c 100644 --- a/apps/lockfile-explorer-web/src/App.tsx +++ b/apps/lockfile-explorer-web/src/App.tsx @@ -13,6 +13,7 @@ import { BookmarksSidebar } from './containers/BookmarksSidebar'; import { SelectedEntryPreview } from './containers/SelectedEntryPreview'; import { LogoPanel } from './containers/LogoPanel'; import { ConnectionModal } from './components/ConnectionModal'; +import { ScrollArea } from '@rushstack/components'; /** * This React component renders the application page. @@ -43,6 +44,7 @@ export const App = (): JSX.Element => { +
diff --git a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx index 739afb5ceac..03f82679e3e 100644 --- a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx @@ -11,6 +11,7 @@ import { removeBookmark, selectCurrentEntry } from '../../store/slices/entrySlice'; +import { Button } from '@rushstack/components'; export const SelectedEntryPreview = (): JSX.Element => { const selectedEntry = useAppSelector(selectCurrentEntry); @@ -64,6 +65,7 @@ export const SelectedEntryPreview = (): JSX.Element => {
No Entry Selected
{renderButtonRow()} +
); diff --git a/apps/rush-components/.eslintrc.js b/apps/rush-components/.eslintrc.js new file mode 100644 index 00000000000..60160b354c4 --- /dev/null +++ b/apps/rush-components/.eslintrc.js @@ -0,0 +1,7 @@ +// This is a workaround for https://github.com/eslint/eslint/issues/3458 +require('@rushstack/eslint-config/patch/modern-module-resolution'); + +module.exports = { + extends: ['@rushstack/eslint-config/profile/node'], + parserOptions: { tsconfigRootDir: __dirname } +}; diff --git a/apps/rush-components/.npmignore b/apps/rush-components/.npmignore new file mode 100644 index 00000000000..302dbc5b019 --- /dev/null +++ b/apps/rush-components/.npmignore @@ -0,0 +1,30 @@ +# THIS IS A STANDARD TEMPLATE FOR .npmignore FILES IN THIS REPO. + +# Ignore all files by default, to avoid accidentally publishing unintended files. +* + +# Use negative patterns to bring back the specific things we want to publish. +!/bin/** +!/lib/** +!/lib-*/** +!/dist/** +!ThirdPartyNotice.txt + +# Ignore certain patterns that should not get published. +/dist/*.stats.* +/lib/**/test/ +/lib-*/**/test/ +*.test.js + +# NOTE: These don't need to be specified, because NPM includes them automatically. +# +# package.json +# README (and its variants) +# CHANGELOG (and its variants) +# LICENSE / LICENCE + +#-------------------------------------------- +# DO NOT MODIFY THE TEMPLATE ABOVE THIS LINE +#-------------------------------------------- + +# (Add your project-specific overrides here) \ No newline at end of file diff --git a/apps/rush-components/LICENSE b/apps/rush-components/LICENSE new file mode 100644 index 00000000000..e6b6c3080e6 --- /dev/null +++ b/apps/rush-components/LICENSE @@ -0,0 +1,24 @@ +@rushstack/lockfile-explorer + +Copyright (c) Microsoft Corporation. All rights reserved. + +MIT License + +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. diff --git a/apps/rush-components/README.md b/apps/rush-components/README.md new file mode 100644 index 00000000000..1643d5bdd27 --- /dev/null +++ b/apps/rush-components/README.md @@ -0,0 +1,83 @@ +# @rushstack/lockfile-explorer + +
+
+ + Rush Lockfile Explorer + +

+

+ +> 🚨 *EARLY PREVIEW RELEASE* 🚨 +> +> Please provide feedback by commenting on +> the [Design Proposal](https://github.com/microsoft/rushstack/issues/3695) +> or creating a GitHub issue. Thanks! + +**Rush Lockfile Explorer** helps you investigate and solve version conflicts when working +in a [Rush](https://rushjs.io) monorepo using the [PNPM package manager](https://pnpm.io/). + +Typical use cases: + +- After `rush update`, the app is reporting errors caused by duplicate instances of + a singleton object, probably introduced by a + [peer dependency doppelganger](https://rushjs.io/pages/advanced/npm_doppelgangers/) + -- how to find the likely culprits? + +- After `rush update`, the app's bundle size has increased significantly due to + side-by-side versions -- how to find which packages have extra versions? + +- When you identify the problematic package, it is an obscure indirect dependency of + your middleware -- how to work backwards in the dependency graph to determine which + **package.json** files should be patched in **.pnpmfile.cjs**? + +- Your project's installation footprint is unusually large because it has picked up + a lot of extra NPM dependencies that seem unnecessary, however `rush-pnpm why` prints + thousands of lines of output. How to filter this report to see the important + relationships? + + +## Usage + +```bash +# Install the NPM package globally: +npm install -g @rushstack/lockfile-explorer + +# Go to your monorepo folder +cd my-rush-repo + +# Run "rush install" to ensure common/temp/node_modules is up to date +rush install + +# Launch the Lockfile Explorer command line interface (CLI). +# It expects to find a Rush workspace in your shell's current working directory. +lockfile-explorer +``` + +The CLI will start a Node.js service on `http://localhost/` and try to launch your default web browser: + +screenshot
+*Lockfile Explorer main window* + + +## How it works + +The web app will expect to find a Rush workspace in the current working directory where the `lockfile-explorer` +command was invoked. It will read files such as: + +- **common/config/rush/pnpm-lock.yaml** - the PNPM lockfile for your monorepo +- **common/config/rush/.pnpmfile.cjs** - which transforms **package.json** files during installation +- The **package.json** files for your Rush projects +- The **package.json** files for packages installed under + + +## Links + +- [Documentation](https://lfx.rushstack.io/) on the Lockfile Explorer project website +- [CHANGELOG.md]( + https://github.com/microsoft/rushstack/blob/main/apps/lockfile-explorer/CHANGELOG.md) - Find + out what's new in the latest version +- [@rushstack/trace-import](https://www.npmjs.com/package/@rushstack/trace-import) - + a command-line tool for troubleshooting how modules are resolved by `import` and `require()` + +Rush Lockfile Explorer is part of the [Rush Stack](https://rushstack.io/) family of projects. diff --git a/apps/rush-components/assets/index.html b/apps/rush-components/assets/index.html new file mode 100644 index 00000000000..8e36d3d1016 --- /dev/null +++ b/apps/rush-components/assets/index.html @@ -0,0 +1,12 @@ + + + + + + Rush Components + + + +
+ + diff --git a/apps/rush-components/config/heft.json b/apps/rush-components/config/heft.json new file mode 100644 index 00000000000..f859f9c5abe --- /dev/null +++ b/apps/rush-components/config/heft.json @@ -0,0 +1,129 @@ +/** + * Defines configuration used by core Heft. + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for standard + * settings to be shared across multiple projects. + */ + "extends": "@rushstack/heft-web-rig/profiles/app/config/heft.json", + + "eventActions": [ + // { + // /** + // * (Required) The kind of built-in operation that should be performed. + // * The "deleteGlobs" action deletes files or folders that match the specified glob patterns. + // */ + // "actionKind": "deleteGlobs", + // + // /** + // * (Required) The Heft stage when this action should be performed. Note that heft.json event actions + // * are scheduled after any plugin tasks have processed the event. For example, a "compile" event action + // * will be performed after the TypeScript compiler has been invoked. + // * + // * Options: "clean", "pre-compile", "compile", "bundle", "post-build" + // */ + // "heftEvent": "clean", + // + // /** + // * (Required) A user-defined tag whose purpose is to allow configs to replace/delete handlers that + // * were added by other configs. + // */ + // "actionId": "my-example-action", + // + // /** + // * (Required) Glob patterns to be deleted. The paths are resolved relative to the project folder. + // * Documentation for supported glob syntaxes: https://www.npmjs.com/package/fast-glob + // */ + // "globsToDelete": [ + // "dist", + // "lib", + // "lib-esnext", + // "temp" + // ] + // }, + // + // { + // /** + // * (Required) The kind of built-in operation that should be performed. + // * The "copyFiles" action copies files that match the specified patterns. + // */ + // "actionKind": "copyFiles", + // + // /** + // * (Required) The Heft stage when this action should be performed. Note that heft.json event actions + // * are scheduled after any plugin tasks have processed the event. For example, a "compile" event action + // * will be performed after the TypeScript compiler has been invoked. + // * + // * Options: "pre-compile", "compile", "bundle", "post-build" + // */ + // "heftEvent": "pre-compile", + // + // /** + // * (Required) A user-defined tag whose purpose is to allow configs to replace/delete handlers that + // * were added by other configs. + // */ + // "actionId": "my-example-action", + // + // /** + // * (Required) An array of copy operations to run perform during the specified Heft event. + // */ + // "copyOperations": [ + // { + // /** + // * (Required) The base folder that files will be copied from, relative to the project root. + // * Settings such as "includeGlobs" and "excludeGlobs" will be resolved relative + // * to this folder. + // * NOTE: Assigning "sourceFolder" does not by itself select any files to be copied. + // */ + // "sourceFolder": "src", + // + // /** + // * (Required) One or more folders that files will be copied into, relative to the project root. + // * If you specify more than one destination folder, Heft will read the input files only once, using + // * streams to efficiently write multiple outputs. + // */ + // "destinationFolders": ["dist/assets"], + // + // /** + // * If specified, this option recursively scans all folders under "sourceFolder" and includes any files + // * that match the specified extensions. (If "fileExtensions" and "includeGlobs" are both + // * specified, their selections are added together.) + // */ + // "fileExtensions": [".jpg", ".png"], + // + // /** + // * A list of glob patterns that select files to be copied. The paths are resolved relative + // * to "sourceFolder". + // * Documentation for supported glob syntaxes: https://www.npmjs.com/package/fast-glob + // */ + // "includeGlobs": ["assets/*.md"], + // + // /** + // * A list of glob patterns that exclude files/folders from being copied. The paths are resolved relative + // * to "sourceFolder". These exclusions eliminate items that were selected by the "includeGlobs" + // * or "fileExtensions" setting. + // */ + // "excludeGlobs": [], + // + // /** + // * Normally, when files are selected under a child folder, a corresponding folder will be created in + // * the destination folder. Specify flatten=true to discard the source path and copy all matching files + // * to the same folder. If two files have the same name an error will be reported. + // * The default value is false. + // */ + // "flatten": false, + // + // /** + // * If true, filesystem hard links will be created instead of copying the file. Depending on the + // * operating system, this may be faster. (But note that it may cause unexpected behavior if a tool + // * modifies the link.) The default value is false. + // */ + // "hardlink": false + // } + // ] + // } + ] +} diff --git a/apps/rush-components/config/jest.config.json b/apps/rush-components/config/jest.config.json new file mode 100644 index 00000000000..7f2f5dc42b6 --- /dev/null +++ b/apps/rush-components/config/jest.config.json @@ -0,0 +1,6 @@ +{ + "extends": "@rushstack/heft-web-rig/profiles/app/config/jest.config.json", + + // Load the initappcontext.js stub when running tests + "setupFiles": ["../lib-commonjs/stub/initappcontext.js"] +} diff --git a/apps/rush-components/config/rig.json b/apps/rush-components/config/rig.json new file mode 100644 index 00000000000..687fc2911bc --- /dev/null +++ b/apps/rush-components/config/rig.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + + "rigPackageName": "@rushstack/heft-web-rig", + "rigProfile": "app" +} diff --git a/apps/rush-components/package.json b/apps/rush-components/package.json new file mode 100644 index 00000000000..55b50e33b81 --- /dev/null +++ b/apps/rush-components/package.json @@ -0,0 +1,31 @@ +{ + "name": "@rushstack/components", + "description": "Rush Component Library: a set of themed components for rush projects", + "version": "0.0.0", + "private": true, + "license": "MIT", + "module": "lib/start.js", + "types": "lib/start.d.ts", + "scripts": { + "build": "heft test --clean", + "start": "heft start", + "test": "heft test", + "_phase:build": "heft build --clean", + "_phase:test": "heft test --no-build" + }, + "dependencies": { + "react": "~16.13.1", + "react-dom": "~16.13.1" + }, + "devDependencies": { + "@rushstack/eslint-config": "workspace:*", + "@rushstack/heft-web-rig": "workspace:*", + "@rushstack/heft": "workspace:*", + "@types/heft-jest": "1.0.1", + "@types/react-dom": "16.9.14", + "@types/react": "16.14.23", + "@types/webpack-env": "1.13.0", + "@radix-ui/react-scroll-area": "~1.0.2", + "@radix-ui/colors": "~0.1.8" + } +} diff --git a/apps/rush-components/src/components/Button/index.tsx b/apps/rush-components/src/components/Button/index.tsx new file mode 100644 index 00000000000..f72ed78f607 --- /dev/null +++ b/apps/rush-components/src/components/Button/index.tsx @@ -0,0 +1,5 @@ +import React from 'react'; + +export const Button = () => { + return ; +}; diff --git a/apps/rush-components/src/components/ScrollArea/index.tsx b/apps/rush-components/src/components/ScrollArea/index.tsx new file mode 100644 index 00000000000..439b11a8d89 --- /dev/null +++ b/apps/rush-components/src/components/ScrollArea/index.tsx @@ -0,0 +1,27 @@ +import React from 'react'; +import * as RadixScrollArea from '@radix-ui/react-scroll-area'; +import styles from './styles.scss'; + +const TAGS = Array.from({ length: 50 }).map((_, i, a) => `v1.2.0-beta.${a.length - i}`); + +export const ScrollArea = () => ( + + +
+
Tags
+ {TAGS.map((tag) => ( +
+ {tag} +
+ ))} +
+
+ + + + + + + +
+); diff --git a/apps/rush-components/src/components/ScrollArea/styles.scss b/apps/rush-components/src/components/ScrollArea/styles.scss new file mode 100644 index 00000000000..c896d38d7bf --- /dev/null +++ b/apps/rush-components/src/components/ScrollArea/styles.scss @@ -0,0 +1,79 @@ +@import '@radix-ui/colors/blackA.css'; +@import '@radix-ui/colors/mauve.css'; +@import '@radix-ui/colors/violet.css'; + +.ScrollAreaRoot { + width: 200px; + height: 225px; + border-radius: 4px; + overflow: hidden; + box-shadow: 0 2px 10px var(--blackA7); + background-color: white; + --scrollbar-size: 6px; +} + +.ScrollAreaViewport { + width: 100%; + height: 100%; + border-radius: inherit; +} + +.ScrollAreaScrollbar { + display: flex; + /* ensures no selection */ + user-select: none; + /* disable browser handling of all panning and zooming gestures on touch devices */ + touch-action: none; + padding: 2px; + background: var(--blackA6); + transition: background 160ms ease-out; +} +.ScrollAreaScrollbar:hover { + background: var(--blackA8); +} +.ScrollAreaScrollbar[data-orientation='vertical'] { + width: var(--scrollbar-size); +} +.ScrollAreaScrollbar[data-orientation='horizontal'] { + flex-direction: column; + height: var(--scrollbar-size); +} + +.ScrollAreaThumb { + flex: 1; + background: var(--mauve10); + border-radius: var(--scrollbar-size); + position: relative; +} +/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */ +.ScrollAreaThumb::before { + content: ''; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 100%; + height: 100%; + min-width: 44px; + min-height: 44px; +} + +.ScrollAreaCorner { + background: var(--blackA8); +} + +.Text { + color: var(--violet11); + font-size: 15px; + line-height: 18px; + font-weight: 500; +} + +.Tag { + color: var(--mauve12); + font-size: 13px; + line-height: 18px; + margin-top: 10px; + border-top: 1px solid var(--mauve6); + padding-top: 10px; +} diff --git a/apps/rush-components/src/start.ts b/apps/rush-components/src/start.ts new file mode 100644 index 00000000000..96b2be9d808 --- /dev/null +++ b/apps/rush-components/src/start.ts @@ -0,0 +1,2 @@ +export * from './components/Button'; +export * from './components/ScrollArea'; diff --git a/apps/rush-components/tsconfig.json b/apps/rush-components/tsconfig.json new file mode 100644 index 00000000000..18d8c1a0dab --- /dev/null +++ b/apps/rush-components/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "./node_modules/@rushstack/heft-web-rig/profiles/app/tsconfig-base.json", + "compilerOptions": { + "types": ["heft-jest", "webpack-env"], + "target": "es2017", + "lib": ["es2017", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"] + } +} diff --git a/apps/rush-components/tsconfig.type.json b/apps/rush-components/tsconfig.type.json new file mode 100644 index 00000000000..112edd30eb0 --- /dev/null +++ b/apps/rush-components/tsconfig.type.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "emitDeclarationOnly": true + }, + "include": ["src/index.ts"] +} diff --git a/apps/rush-components/webpack.config.js b/apps/rush-components/webpack.config.js new file mode 100644 index 00000000000..3725a2ce687 --- /dev/null +++ b/apps/rush-components/webpack.config.js @@ -0,0 +1,40 @@ +'use strict'; + +const path = require('path'); +const createWebpackConfig = require('@rushstack/heft-web-rig/profiles/app/webpack-base.config'); + +module.exports = function createConfig(env, argv) { + return createWebpackConfig({ + env: env, + argv: argv, + projectRoot: __dirname, + // Documentation: https://webpack.js.org/configuration/ + configOverride: { + resolve: { + alias: { + // // Use the bundled library + // 'heft-web-rig-library-tutorial': + // 'heft-web-rig-library-tutorial/dist/heft-web-rig-library-tutorial.js' + } + }, + performance: { + hints: env.production ? 'error' : false + // This specifies the bundle size limit that will trigger Webpack's warning saying: + // "The following entrypoint(s) combined asset size exceeds the recommended limit." + // maxEntrypointSize: 500000, + // maxAssetSize: 500000 + }, + devServer: { + port: 8090, + static: { + directory: path.join(__dirname, 'dist') + }, + client: { + webSocketURL: { + port: 8090 + } + } + } + } + }); +}; diff --git a/common/config/rush/browser-approved-packages.json b/common/config/rush/browser-approved-packages.json index e81054b2c2c..42aabcf3362 100644 --- a/common/config/rush/browser-approved-packages.json +++ b/common/config/rush/browser-approved-packages.json @@ -10,10 +10,18 @@ "name": "@lifaon/path", "allowedCategories": [ "libraries" ] }, + { + "name": "@radix-ui/react-scroll-area", + "allowedCategories": [ "libraries" ] + }, { "name": "@reduxjs/toolkit", "allowedCategories": [ "libraries" ] }, + { + "name": "@rushstack/components", + "allowedCategories": [ "libraries" ] + }, { "name": "axios", "allowedCategories": [ "libraries" ] diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 97c81aa0b73..d3c2a89c774 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -186,6 +186,7 @@ importers: '@fluentui/react': ^8.96.1 '@lifaon/path': ~2.1.0 '@reduxjs/toolkit': ~1.8.6 + '@rushstack/components': workspace:* '@rushstack/eslint-config': workspace:* '@rushstack/heft': workspace:* '@rushstack/heft-web-rig': workspace:* @@ -202,6 +203,7 @@ importers: '@fluentui/react': 8.103.6_tlqvpdqnq63ssdllbmshthdmo4 '@lifaon/path': 2.1.0 '@reduxjs/toolkit': 1.8.6_qfynotfwlyrsyq662adyrweaoe + '@rushstack/components': link:../rush-components react: 16.13.1 react-dom: 16.13.1_react@16.13.1 react-redux: 8.0.5_6ue7j6tfp4xzdzadarjwzo6kwu @@ -266,6 +268,33 @@ importers: '@types/node': 12.20.24 '@types/semver': 7.3.5 + ../../apps/rush-components: + specifiers: + '@radix-ui/colors': ~0.1.8 + '@radix-ui/react-scroll-area': ~1.0.2 + '@rushstack/eslint-config': workspace:* + '@rushstack/heft': workspace:* + '@rushstack/heft-web-rig': workspace:* + '@types/heft-jest': 1.0.1 + '@types/react': 16.14.23 + '@types/react-dom': 16.9.14 + '@types/webpack-env': 1.13.0 + react: ~16.13.1 + react-dom: ~16.13.1 + dependencies: + react: 16.13.1 + react-dom: 16.13.1_react@16.13.1 + devDependencies: + '@radix-ui/colors': 0.1.8 + '@radix-ui/react-scroll-area': 1.0.2_5owmthsvj5ictknaj3ev736ofq + '@rushstack/eslint-config': link:../../eslint/eslint-config + '@rushstack/heft': link:../heft + '@rushstack/heft-web-rig': link:../../rigs/heft-web-rig + '@types/heft-jest': 1.0.1 + '@types/react': 16.14.23 + '@types/react-dom': 16.9.14 + '@types/webpack-env': 1.13.0 + ../../apps/trace-import: specifiers: '@rushstack/eslint-config': workspace:* @@ -5796,6 +5825,122 @@ packages: resolution: {integrity: sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==} dev: true + /@radix-ui/colors/0.1.8: + resolution: {integrity: sha512-jwRMXYwC0hUo0mv6wGpuw254Pd9p/R6Td5xsRpOmaWkUHlooNWqVcadgyzlRumMq3xfOTXwJReU0Jv+EIy4Jbw==} + dev: true + + /@radix-ui/number/1.0.0: + resolution: {integrity: sha512-Ofwh/1HX69ZfJRiRBMTy7rgjAzHmwe4kW9C9Y99HTRUcYLUuVT0KESFj15rPjRgKJs20GPq8Bm5aEDJ8DuA3vA==} + dependencies: + '@babel/runtime': 7.20.6 + dev: true + + /@radix-ui/primitive/1.0.0: + resolution: {integrity: sha512-3e7rn8FDMin4CgeL7Z/49smCA3rFYY3Ha2rUQ7HRWFadS5iCRw08ZgVT1LaNTCNqgvrUiyczLflrVrF0SRQtNA==} + dependencies: + '@babel/runtime': 7.20.6 + dev: true + + /@radix-ui/react-compose-refs/1.0.0_react@16.13.1: + resolution: {integrity: sha512-0KaSv6sx787/hK3eF53iOkiSLwAGlFMx5lotrqD2pTjB18KbybKoEIgkNZTKC60YECDQTKGTRcDBILwZVqVKvA==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + react: 16.13.1 + dev: true + + /@radix-ui/react-context/1.0.0_react@16.13.1: + resolution: {integrity: sha512-1pVM9RfOQ+n/N5PJK33kRSKsr1glNxomxONs5c49MliinBY6Yw2Q995qfBUUo0/Mbg05B/sGA0gkgPI7kmSHBg==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + react: 16.13.1 + dev: true + + /@radix-ui/react-direction/1.0.0_react@16.13.1: + resolution: {integrity: sha512-2HV05lGUgYcA6xgLQ4BKPDmtL+QbIZYH5fCOTAOOcJ5O0QbWS3i9lKaurLzliYUDhORI2Qr3pyjhJh44lKA3rQ==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + react: 16.13.1 + dev: true + + /@radix-ui/react-presence/1.0.0_5owmthsvj5ictknaj3ev736ofq: + resolution: {integrity: sha512-A+6XEvN01NfVWiKu38ybawfHsBjWum42MRPnEuqPsBZ4eV7e/7K321B5VgYMPv3Xx5An6o1/l9ZuDBgmcmWK3w==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + '@radix-ui/react-compose-refs': 1.0.0_react@16.13.1 + '@radix-ui/react-use-layout-effect': 1.0.0_react@16.13.1 + react: 16.13.1 + react-dom: 16.13.1_react@16.13.1 + dev: true + + /@radix-ui/react-primitive/1.0.1_5owmthsvj5ictknaj3ev736ofq: + resolution: {integrity: sha512-fHbmislWVkZaIdeF6GZxF0A/NH/3BjrGIYj+Ae6eTmTCr7EB0RQAAVEiqsXK6p3/JcRqVSBQoceZroj30Jj3XA==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + '@radix-ui/react-slot': 1.0.1_react@16.13.1 + react: 16.13.1 + react-dom: 16.13.1_react@16.13.1 + dev: true + + /@radix-ui/react-scroll-area/1.0.2_5owmthsvj5ictknaj3ev736ofq: + resolution: {integrity: sha512-k8VseTxI26kcKJaX0HPwkvlNBPTs56JRdYzcZ/vzrNUkDlvXBy8sMc7WvCpYzZkHgb+hd72VW9MqkqecGtuNgg==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + '@radix-ui/number': 1.0.0 + '@radix-ui/primitive': 1.0.0 + '@radix-ui/react-compose-refs': 1.0.0_react@16.13.1 + '@radix-ui/react-context': 1.0.0_react@16.13.1 + '@radix-ui/react-direction': 1.0.0_react@16.13.1 + '@radix-ui/react-presence': 1.0.0_5owmthsvj5ictknaj3ev736ofq + '@radix-ui/react-primitive': 1.0.1_5owmthsvj5ictknaj3ev736ofq + '@radix-ui/react-use-callback-ref': 1.0.0_react@16.13.1 + '@radix-ui/react-use-layout-effect': 1.0.0_react@16.13.1 + react: 16.13.1 + react-dom: 16.13.1_react@16.13.1 + dev: true + + /@radix-ui/react-slot/1.0.1_react@16.13.1: + resolution: {integrity: sha512-avutXAFL1ehGvAXtPquu0YK5oz6ctS474iM3vNGQIkswrVhdrS52e3uoMQBzZhNRAIE0jBnUyXWNmSjGHhCFcw==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + '@radix-ui/react-compose-refs': 1.0.0_react@16.13.1 + react: 16.13.1 + dev: true + + /@radix-ui/react-use-callback-ref/1.0.0_react@16.13.1: + resolution: {integrity: sha512-GZtyzoHz95Rhs6S63D2t/eqvdFCm7I+yHMLVQheKM7nBD8mbZIt+ct1jz4536MDnaOGKIxynJ8eHTkVGVVkoTg==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + react: 16.13.1 + dev: true + + /@radix-ui/react-use-layout-effect/1.0.0_react@16.13.1: + resolution: {integrity: sha512-6Tpkq+R6LOlmQb1R5NNETLG0B4YP0wc+klfXafpUCj6JGyaUc8il7/kUZ7m59rGbXGczE9Bs+iz2qloqsZBduQ==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + react: 16.13.1 + dev: true + /@reduxjs/toolkit/1.8.6_qfynotfwlyrsyq662adyrweaoe: resolution: {integrity: sha512-4Ia/Loc6WLmdSOzi7k5ff7dLK8CgG2b8aqpLsCAJhazAzGdp//YBUSaj0ceW6a3kDBDNRrq5CRwyCS0wBiL1ig==} peerDependencies: diff --git a/common/config/rush/repo-state.json b/common/config/rush/repo-state.json index 9ffc520ad5c..b63f1f0aa7e 100644 --- a/common/config/rush/repo-state.json +++ b/common/config/rush/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "19975bf7cfd9dfef0de7b4b7767ac445a97816a4", + "pnpmShrinkwrapHash": "31a26a24c42ee3618684f9fcaaaf78303d12c6ae", "preferredVersionsHash": "5222ca779ae69ebfd201e39c17f48ce9eaf8c3c2" } diff --git a/rush.json b/rush.json index c6f0e591ab3..490f81bd126 100644 --- a/rush.json +++ b/rush.json @@ -430,6 +430,11 @@ "projectFolder": "apps/lockfile-explorer-web", "reviewCategory": "libraries" }, + { + "packageName": "@rushstack/components", + "projectFolder": "apps/rush-components", + "reviewCategory": "libraries" + }, { "packageName": "@rushstack/rundown", "projectFolder": "apps/rundown", From 5225780d0600728dcd37c346abc88ca3194b5635 Mon Sep 17 00:00:00 2001 From: Will Huang Date: Thu, 22 Dec 2022 14:10:03 -0500 Subject: [PATCH 021/167] feat: add tabs component --- .../src/containers/LockfileViewer/index.tsx | 25 ++++++ apps/rush-components/package.json | 3 +- .../src/components/Tabs/index.tsx | 25 ++++++ .../src/components/Tabs/styles.scss | 68 +++++++++++++++++ apps/rush-components/src/start.ts | 1 + .../rush/browser-approved-packages.json | 4 + common/config/rush/pnpm-lock.yaml | 76 +++++++++++++++++++ common/config/rush/repo-state.json | 2 +- 8 files changed, 202 insertions(+), 2 deletions(-) create mode 100644 apps/rush-components/src/components/Tabs/index.tsx create mode 100644 apps/rush-components/src/components/Tabs/styles.scss diff --git a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx index cfa247ba58c..5b343ac7297 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx @@ -15,6 +15,7 @@ import { } from '../../store/slices/entrySlice'; import { FilterBar } from '../../components/FilterBar'; import { getFilterFromLocalStorage, saveFilterToLocalStorage } from '../../helpers/localStorage'; +import { Tabs } from '@rushstack/components'; interface ILockfileEntryGroup { entryName: string; @@ -166,6 +167,30 @@ export const LockfileViewer = (): JSX.Element | ReactNull => { return (
+ + {getEntriesToShow().map((lockfileEntryGroup) => ( + + ))} +
+ ) + }, + { + header: 'Packages', + body: ( +
+ {getEntriesToShow().map((lockfileEntryGroup) => ( + + ))} +
+ ) + } + ]} + /> ( + + + {items.map((item) => ( + + {item.header} + + ))} + + {items.map((item) => ( + + {item.body}; + + ))} + +); diff --git a/apps/rush-components/src/components/Tabs/styles.scss b/apps/rush-components/src/components/Tabs/styles.scss new file mode 100644 index 00000000000..2b3e738f839 --- /dev/null +++ b/apps/rush-components/src/components/Tabs/styles.scss @@ -0,0 +1,68 @@ +@import '@radix-ui/colors/blackA.css'; +@import '@radix-ui/colors/green.css'; +@import '@radix-ui/colors/mauve.css'; +@import '@radix-ui/colors/violet.css'; + +/* reset */ +button, +fieldset, +input { + all: unset; +} + +.TabsRoot { + display: flex; + flex-direction: column; + width: 300px; + box-shadow: 0 2px 10px var(--blackA4); +} + +.TabsList { + flex-shrink: 0; + display: flex; + border-bottom: 1px solid var(--mauve6); +} + +.TabsTrigger { + font-family: inherit; + background-color: white; + padding: 0 20px; + height: 45px; + flex: 1; + display: flex; + align-items: center; + justify-content: center; + font-size: 15px; + line-height: 1; + color: var(--mauve11); + user-select: none; +} +.TabsTrigger:first-child { + border-top-left-radius: 6px; +} +.TabsTrigger:last-child { + border-top-right-radius: 6px; +} +.TabsTrigger:hover { + color: var(--violet11); +} +.TabsTrigger[data-state='active'] { + color: var(--violet11); + box-shadow: inset 0 -1px 0 0 currentColor, 0 1px 0 0 currentColor; +} +.TabsTrigger:focus { + position: relative; + box-shadow: 0 0 0 2px black; +} + +.TabsContent { + flex-grow: 1; + padding: 20px; + background-color: white; + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; + outline: none; +} +.TabsContent:focus { + box-shadow: 0 0 0 2px black; +} diff --git a/apps/rush-components/src/start.ts b/apps/rush-components/src/start.ts index 96b2be9d808..db9f62b35ac 100644 --- a/apps/rush-components/src/start.ts +++ b/apps/rush-components/src/start.ts @@ -1,2 +1,3 @@ export * from './components/Button'; export * from './components/ScrollArea'; +export * from './components/Tabs'; diff --git a/common/config/rush/browser-approved-packages.json b/common/config/rush/browser-approved-packages.json index 42aabcf3362..52737424ae9 100644 --- a/common/config/rush/browser-approved-packages.json +++ b/common/config/rush/browser-approved-packages.json @@ -10,6 +10,10 @@ "name": "@lifaon/path", "allowedCategories": [ "libraries" ] }, + { + "name": "@radix-ui/colors", + "allowedCategories": [ "libraries" ] + }, { "name": "@radix-ui/react-scroll-area", "allowedCategories": [ "libraries" ] diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index d3c2a89c774..3a646c53813 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -272,6 +272,7 @@ importers: specifiers: '@radix-ui/colors': ~0.1.8 '@radix-ui/react-scroll-area': ~1.0.2 + '@radix-ui/react-tabs': ~1.0.1 '@rushstack/eslint-config': workspace:* '@rushstack/heft': workspace:* '@rushstack/heft-web-rig': workspace:* @@ -287,6 +288,7 @@ importers: devDependencies: '@radix-ui/colors': 0.1.8 '@radix-ui/react-scroll-area': 1.0.2_5owmthsvj5ictknaj3ev736ofq + '@radix-ui/react-tabs': 1.0.1_5owmthsvj5ictknaj3ev736ofq '@rushstack/eslint-config': link:../../eslint/eslint-config '@rushstack/heft': link:../heft '@rushstack/heft-web-rig': link:../../rigs/heft-web-rig @@ -5841,6 +5843,21 @@ packages: '@babel/runtime': 7.20.6 dev: true + /@radix-ui/react-collection/1.0.1_5owmthsvj5ictknaj3ev736ofq: + resolution: {integrity: sha512-uuiFbs+YCKjn3X1DTSx9G7BHApu4GHbi3kgiwsnFUbOKCrwejAJv4eE4Vc8C0Oaxt9T0aV4ox0WCOdx+39Xo+g==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + '@radix-ui/react-compose-refs': 1.0.0_react@16.13.1 + '@radix-ui/react-context': 1.0.0_react@16.13.1 + '@radix-ui/react-primitive': 1.0.1_5owmthsvj5ictknaj3ev736ofq + '@radix-ui/react-slot': 1.0.1_react@16.13.1 + react: 16.13.1 + react-dom: 16.13.1_react@16.13.1 + dev: true + /@radix-ui/react-compose-refs/1.0.0_react@16.13.1: resolution: {integrity: sha512-0KaSv6sx787/hK3eF53iOkiSLwAGlFMx5lotrqD2pTjB18KbybKoEIgkNZTKC60YECDQTKGTRcDBILwZVqVKvA==} peerDependencies: @@ -5868,6 +5885,16 @@ packages: react: 16.13.1 dev: true + /@radix-ui/react-id/1.0.0_react@16.13.1: + resolution: {integrity: sha512-Q6iAB/U7Tq3NTolBBQbHTgclPmGWE3OlktGGqrClPozSw4vkQ1DfQAOtzgRPecKsMdJINE05iaoDUG8tRzCBjw==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + '@radix-ui/react-use-layout-effect': 1.0.0_react@16.13.1 + react: 16.13.1 + dev: true + /@radix-ui/react-presence/1.0.0_5owmthsvj5ictknaj3ev736ofq: resolution: {integrity: sha512-A+6XEvN01NfVWiKu38ybawfHsBjWum42MRPnEuqPsBZ4eV7e/7K321B5VgYMPv3Xx5An6o1/l9ZuDBgmcmWK3w==} peerDependencies: @@ -5893,6 +5920,26 @@ packages: react-dom: 16.13.1_react@16.13.1 dev: true + /@radix-ui/react-roving-focus/1.0.1_5owmthsvj5ictknaj3ev736ofq: + resolution: {integrity: sha512-TB76u5TIxKpqMpUAuYH2VqMhHYKa+4Vs1NHygo/llLvlffN6mLVsFhz0AnSFlSBAvTBYVHYAkHAyEt7x1gPJOA==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + '@radix-ui/primitive': 1.0.0 + '@radix-ui/react-collection': 1.0.1_5owmthsvj5ictknaj3ev736ofq + '@radix-ui/react-compose-refs': 1.0.0_react@16.13.1 + '@radix-ui/react-context': 1.0.0_react@16.13.1 + '@radix-ui/react-direction': 1.0.0_react@16.13.1 + '@radix-ui/react-id': 1.0.0_react@16.13.1 + '@radix-ui/react-primitive': 1.0.1_5owmthsvj5ictknaj3ev736ofq + '@radix-ui/react-use-callback-ref': 1.0.0_react@16.13.1 + '@radix-ui/react-use-controllable-state': 1.0.0_react@16.13.1 + react: 16.13.1 + react-dom: 16.13.1_react@16.13.1 + dev: true + /@radix-ui/react-scroll-area/1.0.2_5owmthsvj5ictknaj3ev736ofq: resolution: {integrity: sha512-k8VseTxI26kcKJaX0HPwkvlNBPTs56JRdYzcZ/vzrNUkDlvXBy8sMc7WvCpYzZkHgb+hd72VW9MqkqecGtuNgg==} peerDependencies: @@ -5923,6 +5970,25 @@ packages: react: 16.13.1 dev: true + /@radix-ui/react-tabs/1.0.1_5owmthsvj5ictknaj3ev736ofq: + resolution: {integrity: sha512-mVNEwHwgjy2G9F7b39f9VY+jF0QUZykTm0Sdv+Uz6KC4KOEIa4HLDiHU8MeEZluRtZE3aqGYDhl93O7QbJDwhg==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + '@radix-ui/primitive': 1.0.0 + '@radix-ui/react-context': 1.0.0_react@16.13.1 + '@radix-ui/react-direction': 1.0.0_react@16.13.1 + '@radix-ui/react-id': 1.0.0_react@16.13.1 + '@radix-ui/react-presence': 1.0.0_5owmthsvj5ictknaj3ev736ofq + '@radix-ui/react-primitive': 1.0.1_5owmthsvj5ictknaj3ev736ofq + '@radix-ui/react-roving-focus': 1.0.1_5owmthsvj5ictknaj3ev736ofq + '@radix-ui/react-use-controllable-state': 1.0.0_react@16.13.1 + react: 16.13.1 + react-dom: 16.13.1_react@16.13.1 + dev: true + /@radix-ui/react-use-callback-ref/1.0.0_react@16.13.1: resolution: {integrity: sha512-GZtyzoHz95Rhs6S63D2t/eqvdFCm7I+yHMLVQheKM7nBD8mbZIt+ct1jz4536MDnaOGKIxynJ8eHTkVGVVkoTg==} peerDependencies: @@ -5932,6 +5998,16 @@ packages: react: 16.13.1 dev: true + /@radix-ui/react-use-controllable-state/1.0.0_react@16.13.1: + resolution: {integrity: sha512-FohDoZvk3mEXh9AWAVyRTYR4Sq7/gavuofglmiXB2g1aKyboUD4YtgWxKj8O5n+Uak52gXQ4wKz5IFST4vtJHg==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + '@radix-ui/react-use-callback-ref': 1.0.0_react@16.13.1 + react: 16.13.1 + dev: true + /@radix-ui/react-use-layout-effect/1.0.0_react@16.13.1: resolution: {integrity: sha512-6Tpkq+R6LOlmQb1R5NNETLG0B4YP0wc+klfXafpUCj6JGyaUc8il7/kUZ7m59rGbXGczE9Bs+iz2qloqsZBduQ==} peerDependencies: diff --git a/common/config/rush/repo-state.json b/common/config/rush/repo-state.json index b63f1f0aa7e..45e82167480 100644 --- a/common/config/rush/repo-state.json +++ b/common/config/rush/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "31a26a24c42ee3618684f9fcaaaf78303d12c6ae", + "pnpmShrinkwrapHash": "453bdd5fae52264d90a61dd77b78f037fc6244ed", "preferredVersionsHash": "5222ca779ae69ebfd201e39c17f48ce9eaf8c3c2" } From 601e75e386c98145be3c4504665c49f2bcdb506f Mon Sep 17 00:00:00 2001 From: Will Huang Date: Thu, 22 Dec 2022 15:34:50 -0500 Subject: [PATCH 022/167] feat: re-write left panel with components --- .../src/containers/LockfileViewer/index.tsx | 127 ++++++++---------- .../src/containers/LockfileViewer/styles.scss | 9 -- apps/rush-components/package.json | 8 +- .../src/components/Checkbox/index.tsx | 33 +++++ .../src/components/Checkbox/styles.scss | 36 +++++ .../src/components/Tabs/index.tsx | 35 +++-- .../src/components/Tabs/styles.scss | 3 +- apps/rush-components/src/start.ts | 1 + .../rush/browser-approved-packages.json | 4 + common/config/rush/pnpm-lock.yaml | 50 +++++++ common/config/rush/repo-state.json | 2 +- 11 files changed, 217 insertions(+), 91 deletions(-) create mode 100644 apps/rush-components/src/components/Checkbox/index.tsx create mode 100644 apps/rush-components/src/components/Checkbox/styles.scss diff --git a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx index 5b343ac7297..7e980a72cc2 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx @@ -15,7 +15,7 @@ import { } from '../../store/slices/entrySlice'; import { FilterBar } from '../../components/FilterBar'; import { getFilterFromLocalStorage, saveFilterToLocalStorage } from '../../helpers/localStorage'; -import { Tabs } from '@rushstack/components'; +import { Tabs, Checkbox } from '@rushstack/components'; interface ILockfileEntryGroup { entryName: string; @@ -115,6 +115,8 @@ export const LockfileViewer = (): JSX.Element | ReactNull => { if (!entries) return ReactNull; const getEntriesToShow = (): ILockfileEntryGroup[] => { + console.log('getting entries: ', activeFilters); + let filteredEntries: LockfileEntry[] = entries; if (projectFilter && activeFilters[LockfileEntryFilter.Project]) { filteredEntries = entries.filter((entry) => entry.entryPackageName.indexOf(projectFilter) !== -1); @@ -167,30 +169,61 @@ export const LockfileViewer = (): JSX.Element | ReactNull => { return (
- - {getEntriesToShow().map((lockfileEntryGroup) => ( - - ))} -
- ) - }, - { - header: 'Packages', - body: ( -
- {getEntriesToShow().map((lockfileEntryGroup) => ( - - ))} -
- ) - } - ]} - /> +
+ { + console.log(val); + togglePackageView(val === 'Projects' ? LockfileEntryFilter.Project : LockfileEntryFilter.Package); + }} + > +
+ +
+
+ {getEntriesToShow().map((lockfileEntryGroup) => ( + + ))} +
+ {activeFilters[LockfileEntryFilter.Package] ? ( +
+
Filters
+ + +
+ ) : null} +
+
{ } ]} /> -
-
- -
-
- {getEntriesToShow().map((lockfileEntryGroup) => ( - - ))} -
- {activeFilters[LockfileEntryFilter.Package] ? ( -
-
Filters
-
- -
Must have side-by-side versions
-
-
- -
Must have doppelgangers
-
-
- ) : null} -
); }; diff --git a/apps/lockfile-explorer-web/src/containers/LockfileViewer/styles.scss b/apps/lockfile-explorer-web/src/containers/LockfileViewer/styles.scss index eef96b23180..e2034c20062 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileViewer/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/LockfileViewer/styles.scss @@ -73,12 +73,3 @@ margin-top: 4px; } } - -.filterOption { - display: flex; - align-items: center; - cursor: pointer; - & > * + * { - margin-left: 4px; - } -} diff --git a/apps/rush-components/package.json b/apps/rush-components/package.json index b0eee736378..514e29b872e 100644 --- a/apps/rush-components/package.json +++ b/apps/rush-components/package.json @@ -22,11 +22,13 @@ "@rushstack/heft-web-rig": "workspace:*", "@rushstack/heft": "workspace:*", "@types/heft-jest": "1.0.1", - "@types/react-dom": "16.9.14", - "@types/react": "16.14.23", + "@types/react-dom": "16.13.1", + "@types/react": "16.13.1", "@types/webpack-env": "1.13.0", "@radix-ui/react-scroll-area": "~1.0.2", "@radix-ui/colors": "~0.1.8", - "@radix-ui/react-tabs": "~1.0.1" + "@radix-ui/react-tabs": "~1.0.1", + "@radix-ui/react-checkbox": "~1.0.1", + "@radix-ui/react-icons": "~1.1.1" } } diff --git a/apps/rush-components/src/components/Checkbox/index.tsx b/apps/rush-components/src/components/Checkbox/index.tsx new file mode 100644 index 00000000000..63319d0e4c3 --- /dev/null +++ b/apps/rush-components/src/components/Checkbox/index.tsx @@ -0,0 +1,33 @@ +import React from 'react'; +import * as RadixCheckbox from '@radix-ui/react-checkbox'; +import { CheckIcon } from '@radix-ui/react-icons'; +import styles from './styles.scss'; + +export const Checkbox = ({ + label, + isChecked, + onChecked +}: { + label: string; + isChecked: boolean; + onChecked: (checked: boolean) => void; +}) => ( +
+
+ + + + + + +
+
+); diff --git a/apps/rush-components/src/components/Checkbox/styles.scss b/apps/rush-components/src/components/Checkbox/styles.scss new file mode 100644 index 00000000000..7d9fd49f756 --- /dev/null +++ b/apps/rush-components/src/components/Checkbox/styles.scss @@ -0,0 +1,36 @@ +@import '@radix-ui/colors/blackA.css'; +@import '@radix-ui/colors/violet.css'; + +/* reset */ +button { + all: unset; +} + +.CheckboxRoot { + background-color: white; + width: 25px; + height: 25px; + border-radius: 4px; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0 2px 10px var(--blackA7); +} +.CheckboxRoot:hover { + background-color: var(--violet3); +} +.CheckboxRoot:focus { + box-shadow: 0 0 0 2px black; +} + +.CheckboxIndicator { + color: var(--violet11); +} + +.Label { + color: white; + padding-left: 15px; + font-size: 15px; + line-height: 1; + user-select: none; +} diff --git a/apps/rush-components/src/components/Tabs/index.tsx b/apps/rush-components/src/components/Tabs/index.tsx index b3f8dbe5275..0e8717d9ecb 100644 --- a/apps/rush-components/src/components/Tabs/index.tsx +++ b/apps/rush-components/src/components/Tabs/index.tsx @@ -4,11 +4,28 @@ import styles from './styles.scss'; type TabsItem = { header: string; - body: any; + body?: any; }; -export const Tabs = ({ items, def }: { items: TabsItem[]; def?: string }) => ( - +export const Tabs = ({ + items, + def, + value, + onChange, + children +}: { + items: TabsItem[]; + def?: string; + value?: string; + onChange?: (value: string) => void; + children?: any; +}) => ( + {items.map((item) => ( @@ -16,10 +33,12 @@ export const Tabs = ({ items, def }: { items: TabsItem[]; def?: string }) => ( ))} - {items.map((item) => ( - - {item.body}; - - ))} + {children + ? children + : items.map((item) => ( + + {item.body} + + ))} ); diff --git a/apps/rush-components/src/components/Tabs/styles.scss b/apps/rush-components/src/components/Tabs/styles.scss index 2b3e738f839..e8675564c0d 100644 --- a/apps/rush-components/src/components/Tabs/styles.scss +++ b/apps/rush-components/src/components/Tabs/styles.scss @@ -13,8 +13,9 @@ input { .TabsRoot { display: flex; flex-direction: column; - width: 300px; + width: 100%; box-shadow: 0 2px 10px var(--blackA4); + overflow-y: scroll; } .TabsList { diff --git a/apps/rush-components/src/start.ts b/apps/rush-components/src/start.ts index db9f62b35ac..b1f55190801 100644 --- a/apps/rush-components/src/start.ts +++ b/apps/rush-components/src/start.ts @@ -1,3 +1,4 @@ export * from './components/Button'; export * from './components/ScrollArea'; export * from './components/Tabs'; +export * from './components/Checkbox'; diff --git a/common/config/rush/browser-approved-packages.json b/common/config/rush/browser-approved-packages.json index 52737424ae9..1922351270a 100644 --- a/common/config/rush/browser-approved-packages.json +++ b/common/config/rush/browser-approved-packages.json @@ -18,6 +18,10 @@ "name": "@radix-ui/react-scroll-area", "allowedCategories": [ "libraries" ] }, + { + "name": "@radix-ui/react-tabs", + "allowedCategories": [ "libraries" ] + }, { "name": "@reduxjs/toolkit", "allowedCategories": [ "libraries" ] diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3a646c53813..04fbaddd497 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -271,6 +271,8 @@ importers: ../../apps/rush-components: specifiers: '@radix-ui/colors': ~0.1.8 + '@radix-ui/react-checkbox': ~1.0.1 + '@radix-ui/react-icons': ~1.1.1 '@radix-ui/react-scroll-area': ~1.0.2 '@radix-ui/react-tabs': ~1.0.1 '@rushstack/eslint-config': workspace:* @@ -287,6 +289,8 @@ importers: react-dom: 16.13.1_react@16.13.1 devDependencies: '@radix-ui/colors': 0.1.8 + '@radix-ui/react-checkbox': 1.0.1_5owmthsvj5ictknaj3ev736ofq + '@radix-ui/react-icons': 1.1.1_react@16.13.1 '@radix-ui/react-scroll-area': 1.0.2_5owmthsvj5ictknaj3ev736ofq '@radix-ui/react-tabs': 1.0.1_5owmthsvj5ictknaj3ev736ofq '@rushstack/eslint-config': link:../../eslint/eslint-config @@ -5843,6 +5847,25 @@ packages: '@babel/runtime': 7.20.6 dev: true + /@radix-ui/react-checkbox/1.0.1_5owmthsvj5ictknaj3ev736ofq: + resolution: {integrity: sha512-TisH0B8hWmYP3ONRduYCyN04rR9yLPIw/Rwyn1RoC1suSoGCa8Wn+YPdSSSarSszeIbcg3p2lBkDp2XXit4sZw==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + '@radix-ui/primitive': 1.0.0 + '@radix-ui/react-compose-refs': 1.0.0_react@16.13.1 + '@radix-ui/react-context': 1.0.0_react@16.13.1 + '@radix-ui/react-presence': 1.0.0_5owmthsvj5ictknaj3ev736ofq + '@radix-ui/react-primitive': 1.0.1_5owmthsvj5ictknaj3ev736ofq + '@radix-ui/react-use-controllable-state': 1.0.0_react@16.13.1 + '@radix-ui/react-use-previous': 1.0.0_react@16.13.1 + '@radix-ui/react-use-size': 1.0.0_react@16.13.1 + react: 16.13.1 + react-dom: 16.13.1_react@16.13.1 + dev: true + /@radix-ui/react-collection/1.0.1_5owmthsvj5ictknaj3ev736ofq: resolution: {integrity: sha512-uuiFbs+YCKjn3X1DTSx9G7BHApu4GHbi3kgiwsnFUbOKCrwejAJv4eE4Vc8C0Oaxt9T0aV4ox0WCOdx+39Xo+g==} peerDependencies: @@ -5885,6 +5908,14 @@ packages: react: 16.13.1 dev: true + /@radix-ui/react-icons/1.1.1_react@16.13.1: + resolution: {integrity: sha512-xc3wQC59rsFylVbSusQCrrM+6695ppF730Q6yqzhRdqDcRNWIm2R6ngpzBoSOQMcwnq4p805F+Gr7xo4fmtN1A==} + peerDependencies: + react: ^16.x || ^17.x || ^18.x + dependencies: + react: 16.13.1 + dev: true + /@radix-ui/react-id/1.0.0_react@16.13.1: resolution: {integrity: sha512-Q6iAB/U7Tq3NTolBBQbHTgclPmGWE3OlktGGqrClPozSw4vkQ1DfQAOtzgRPecKsMdJINE05iaoDUG8tRzCBjw==} peerDependencies: @@ -6017,6 +6048,25 @@ packages: react: 16.13.1 dev: true + /@radix-ui/react-use-previous/1.0.0_react@16.13.1: + resolution: {integrity: sha512-RG2K8z/K7InnOKpq6YLDmT49HGjNmrK+fr82UCVKT2sW0GYfVnYp4wZWBooT/EYfQ5faA9uIjvsuMMhH61rheg==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + react: 16.13.1 + dev: true + + /@radix-ui/react-use-size/1.0.0_react@16.13.1: + resolution: {integrity: sha512-imZ3aYcoYCKhhgNpkNDh/aTiU05qw9hX+HHI1QDBTyIlcFjgeFlKKySNGMwTp7nYFLQg/j0VA2FmCY4WPDDHMg==} + peerDependencies: + react: ^16.8 || ^17.0 || ^18.0 + dependencies: + '@babel/runtime': 7.20.6 + '@radix-ui/react-use-layout-effect': 1.0.0_react@16.13.1 + react: 16.13.1 + dev: true + /@reduxjs/toolkit/1.8.6_qfynotfwlyrsyq662adyrweaoe: resolution: {integrity: sha512-4Ia/Loc6WLmdSOzi7k5ff7dLK8CgG2b8aqpLsCAJhazAzGdp//YBUSaj0ceW6a3kDBDNRrq5CRwyCS0wBiL1ig==} peerDependencies: diff --git a/common/config/rush/repo-state.json b/common/config/rush/repo-state.json index 45e82167480..4ab073e623c 100644 --- a/common/config/rush/repo-state.json +++ b/common/config/rush/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "453bdd5fae52264d90a61dd77b78f037fc6244ed", + "pnpmShrinkwrapHash": "2d4113be0a631885212233ee12084088dd8b09f4", "preferredVersionsHash": "5222ca779ae69ebfd201e39c17f48ce9eaf8c3c2" } From e497d56d94edb9bc2dc7c4a58050679e43036c0e Mon Sep 17 00:00:00 2001 From: Will Huang Date: Thu, 29 Dec 2022 18:34:31 -0500 Subject: [PATCH 023/167] feat: re-write left panel and center panel with components --- apps/lockfile-explorer-web/src/App.tsx | 2 - .../src/components/FilterBar/index.tsx | 27 ----- .../src/components/FilterBar/styles.scss | 20 ---- .../src/containers/LockfileViewer/index.tsx | 98 ++++++++----------- .../src/containers/LockfileViewer/styles.scss | 37 +++---- .../containers/PackageJsonViewer/index.tsx | 26 ++--- .../src/styles/_base.scss | 7 ++ .../src/components/Checkbox/index.tsx | 2 +- .../src/components/Checkbox/styles.scss | 1 - .../src/components/Input/index.tsx | 24 +++++ .../src/components/Input/styles.scss | 5 + .../src/components/ScrollArea/index.tsx | 15 +-- .../src/components/ScrollArea/styles.scss | 21 +--- .../src/components/Tabs/index.tsx | 58 ++++++----- .../src/components/Tabs/styles.scss | 3 - apps/rush-components/src/start.ts | 1 + 16 files changed, 139 insertions(+), 208 deletions(-) delete mode 100644 apps/lockfile-explorer-web/src/components/FilterBar/index.tsx delete mode 100644 apps/lockfile-explorer-web/src/components/FilterBar/styles.scss create mode 100644 apps/lockfile-explorer-web/src/styles/_base.scss create mode 100644 apps/rush-components/src/components/Input/index.tsx create mode 100644 apps/rush-components/src/components/Input/styles.scss diff --git a/apps/lockfile-explorer-web/src/App.tsx b/apps/lockfile-explorer-web/src/App.tsx index 586019aed5c..e0d110a2c62 100644 --- a/apps/lockfile-explorer-web/src/App.tsx +++ b/apps/lockfile-explorer-web/src/App.tsx @@ -13,7 +13,6 @@ import { BookmarksSidebar } from './containers/BookmarksSidebar'; import { SelectedEntryPreview } from './containers/SelectedEntryPreview'; import { LogoPanel } from './containers/LogoPanel'; import { ConnectionModal } from './components/ConnectionModal'; -import { ScrollArea } from '@rushstack/components'; /** * This React component renders the application page. @@ -44,7 +43,6 @@ export const App = (): JSX.Element => { -
diff --git a/apps/lockfile-explorer-web/src/components/FilterBar/index.tsx b/apps/lockfile-explorer-web/src/components/FilterBar/index.tsx deleted file mode 100644 index 97e8c6752b3..00000000000 --- a/apps/lockfile-explorer-web/src/components/FilterBar/index.tsx +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. -// See LICENSE in the project root for license information. - -import React from 'react'; -import styles from './styles.scss'; - -interface IFilterBarOption { - text: string; - active: boolean; - onClick: () => void; -} - -export const FilterBar = ({ options }: { options: IFilterBarOption[] }): JSX.Element => { - return ( -
- {options.map((opt: IFilterBarOption) => ( -
- {opt.text} -
- ))} -
- ); -}; diff --git a/apps/lockfile-explorer-web/src/components/FilterBar/styles.scss b/apps/lockfile-explorer-web/src/components/FilterBar/styles.scss deleted file mode 100644 index bbd2bcd1429..00000000000 --- a/apps/lockfile-explorer-web/src/components/FilterBar/styles.scss +++ /dev/null @@ -1,20 +0,0 @@ -@import 'office-ui-fabric-core/dist/sass/References'; - -.FilterBar { - display: flex; - box-shadow: $ms-depth-shadow-8; - width: fit-content; - & > * + * { - border-left: 1px solid $ms-color-gray20; - } -} - -.FilterItem { - background-color: $ms-color-gray10; - padding: 6px 12px; - cursor: pointer; -} - -.FilterItemActive { - border-bottom: 3px solid #107c10; -} diff --git a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx index 7e980a72cc2..f72f876054e 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx @@ -13,9 +13,8 @@ import { selectFilteredEntries, setFilter as selectFilter } from '../../store/slices/entrySlice'; -import { FilterBar } from '../../components/FilterBar'; import { getFilterFromLocalStorage, saveFilterToLocalStorage } from '../../helpers/localStorage'; -import { Tabs, Checkbox } from '@rushstack/components'; +import { Tabs, Checkbox, ScrollArea, Input } from '@rushstack/components'; interface ILockfileEntryGroup { entryName: string; @@ -115,8 +114,6 @@ export const LockfileViewer = (): JSX.Element | ReactNull => { if (!entries) return ReactNull; const getEntriesToShow = (): ILockfileEntryGroup[] => { - console.log('getting entries: ', activeFilters); - let filteredEntries: LockfileEntry[] = entries; if (projectFilter && activeFilters[LockfileEntryFilter.Project]) { filteredEntries = entries.filter((entry) => entry.entryPackageName.indexOf(projectFilter) !== -1); @@ -155,11 +152,15 @@ export const LockfileViewer = (): JSX.Element | ReactNull => { ); const togglePackageView = useCallback( - (selected: LockfileEntryFilter) => () => { + (selected: LockfileEntryFilter) => { if (selected === LockfileEntryFilter.Project) { + console.log('first'); + dispatch(selectFilter({ filter: LockfileEntryFilter.Project, state: true })); dispatch(selectFilter({ filter: LockfileEntryFilter.Package, state: false })); } else { + console.log('elsing'); + dispatch(selectFilter({ filter: LockfileEntryFilter.Package, state: true })); dispatch(selectFilter({ filter: LockfileEntryFilter.Project, state: false })); } @@ -179,65 +180,48 @@ export const LockfileViewer = (): JSX.Element | ReactNull => { header: 'Packages' } ]} + value={activeFilters[LockfileEntryFilter.Project] ? 'Projects' : 'Packages'} onChange={(val) => { - console.log(val); togglePackageView(val === 'Projects' ? LockfileEntryFilter.Project : LockfileEntryFilter.Package); }} - > -
- + + + {getEntriesToShow().map((lockfileEntryGroup) => ( + + ))} + + {activeFilters[LockfileEntryFilter.Package] ? ( +
+
Filters
+ +
-
- {getEntriesToShow().map((lockfileEntryGroup) => ( - - ))} -
- {activeFilters[LockfileEntryFilter.Package] ? ( -
-
Filters
- - -
- ) : null} - + ) : null}
-
); }; diff --git a/apps/lockfile-explorer-web/src/containers/LockfileViewer/styles.scss b/apps/lockfile-explorer-web/src/containers/LockfileViewer/styles.scss index e2034c20062..52e06968c03 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileViewer/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/LockfileViewer/styles.scss @@ -1,13 +1,20 @@ +@use '../../styles/base'; + .ViewWrapper { - height: calc(100% - 12px); - padding-top: 12px; + height: calc(100% - 24px); + @include base.card; + padding: 0 12px; + margin-top: 12px; } .ViewContents { display: flex; flex-direction: column; - min-height: calc(100% - 70px - 35px); - max-height: calc(100% - 70px - 35px); + min-height: calc(100% - 35px); + max-height: calc(100% - 35px); + & > * + * { + margin-top: 12px; + } } .LockfileEntryListViewWrapper { @@ -20,23 +27,6 @@ } } -.LockfileFilterBar { - display: flex; - align-items: center; - margin-bottom: 12px; - - input { - border: solid 1px #666; - border-radius: 4px; - padding: 0.4em; - width: 100%; - } - - & > * + * { - margin-left: 12px; - } -} - .packageGroup { h5 { margin: 0; @@ -59,11 +49,8 @@ } .lockfileEntriesWrapper { - overflow: scroll; flex: 1; - & > * + * { - margin-top: 12px; - } + height: 100%; } .filterSection { diff --git a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx index dbc733c9b16..40d44aa55d1 100644 --- a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx @@ -9,10 +9,10 @@ import { useAppDispatch, useAppSelector } from '../../store/hooks'; import { selectCurrentEntry } from '../../store/slices/entrySlice'; import { IPackageJson } from '../../types/IPackageJson'; import { compareSpec } from '../../parsing/compareSpec'; -import { FilterBar } from '../../components/FilterBar'; import { loadSpecChanges } from '../../store/slices/workspaceSlice'; import { displaySpecChanges } from '../../helpers/displaySpecChanges'; import { isEntryModified } from '../../helpers/isEntryModified'; +import { Tabs } from '@rushstack/components'; enum PackageView { PACKAGE_JSON, @@ -31,7 +31,8 @@ export const PackageJsonViewer = (): JSX.Element => { const [selection, setSelection] = useState(PackageView.PARSED_PACKAGE_JSON); - const cb = useCallback((s: PackageView) => () => setSelection(s), []); + const cb = useCallback((s: PackageView) => setSelection(s), []); + console.log('selection: ', selection); useEffect(() => { async function loadPnpmFileAsync(): Promise { @@ -196,24 +197,23 @@ export const PackageJsonViewer = (): JSX.Element => { return (
-
{renderFile()}
diff --git a/apps/lockfile-explorer-web/src/styles/_base.scss b/apps/lockfile-explorer-web/src/styles/_base.scss new file mode 100644 index 00000000000..5799704e1e3 --- /dev/null +++ b/apps/lockfile-explorer-web/src/styles/_base.scss @@ -0,0 +1,7 @@ +$shadow: 0 2px 10px hsla(0, 0%, 0%, 0.141); +$background-primary: white; + +@mixin card { + box-shadow: $shadow; + background-color: $background-primary; +} diff --git a/apps/rush-components/src/components/Checkbox/index.tsx b/apps/rush-components/src/components/Checkbox/index.tsx index 63319d0e4c3..ce6c7b60002 100644 --- a/apps/rush-components/src/components/Checkbox/index.tsx +++ b/apps/rush-components/src/components/Checkbox/index.tsx @@ -25,7 +25,7 @@ export const Checkbox = ({ -
diff --git a/apps/rush-components/src/components/Checkbox/styles.scss b/apps/rush-components/src/components/Checkbox/styles.scss index 7d9fd49f756..fc6821b2674 100644 --- a/apps/rush-components/src/components/Checkbox/styles.scss +++ b/apps/rush-components/src/components/Checkbox/styles.scss @@ -28,7 +28,6 @@ button { } .Label { - color: white; padding-left: 15px; font-size: 15px; line-height: 1; diff --git a/apps/rush-components/src/components/Input/index.tsx b/apps/rush-components/src/components/Input/index.tsx new file mode 100644 index 00000000000..a56b6804662 --- /dev/null +++ b/apps/rush-components/src/components/Input/index.tsx @@ -0,0 +1,24 @@ +import React from 'react'; +import styles from './styles.scss'; + +export const Input = ({ + value, + placeholder, + onChange, + type = 'text' +}: { + value: string; + onChange: (e: React.ChangeEvent) => void; + type?: string; + placeholder?: string; +}) => { + return ( + + ); +}; diff --git a/apps/rush-components/src/components/Input/styles.scss b/apps/rush-components/src/components/Input/styles.scss new file mode 100644 index 00000000000..dc7520862af --- /dev/null +++ b/apps/rush-components/src/components/Input/styles.scss @@ -0,0 +1,5 @@ +.InputWrapper { + border: solid 1px #666; + border-radius: 4px; + padding: 0.4em; +} diff --git a/apps/rush-components/src/components/ScrollArea/index.tsx b/apps/rush-components/src/components/ScrollArea/index.tsx index 439b11a8d89..6033ad05825 100644 --- a/apps/rush-components/src/components/ScrollArea/index.tsx +++ b/apps/rush-components/src/components/ScrollArea/index.tsx @@ -2,20 +2,9 @@ import React from 'react'; import * as RadixScrollArea from '@radix-ui/react-scroll-area'; import styles from './styles.scss'; -const TAGS = Array.from({ length: 50 }).map((_, i, a) => `v1.2.0-beta.${a.length - i}`); - -export const ScrollArea = () => ( +export const ScrollArea = ({ children }: { children: any }) => ( - -
-
Tags
- {TAGS.map((tag) => ( -
- {tag} -
- ))} -
-
+ {children} diff --git a/apps/rush-components/src/components/ScrollArea/styles.scss b/apps/rush-components/src/components/ScrollArea/styles.scss index c896d38d7bf..75c99b239c5 100644 --- a/apps/rush-components/src/components/ScrollArea/styles.scss +++ b/apps/rush-components/src/components/ScrollArea/styles.scss @@ -3,13 +3,10 @@ @import '@radix-ui/colors/violet.css'; .ScrollAreaRoot { - width: 200px; - height: 225px; border-radius: 4px; overflow: hidden; - box-shadow: 0 2px 10px var(--blackA7); - background-color: white; --scrollbar-size: 6px; + height: 100vh; } .ScrollAreaViewport { @@ -61,19 +58,3 @@ .ScrollAreaCorner { background: var(--blackA8); } - -.Text { - color: var(--violet11); - font-size: 15px; - line-height: 18px; - font-weight: 500; -} - -.Tag { - color: var(--mauve12); - font-size: 13px; - line-height: 18px; - margin-top: 10px; - border-top: 1px solid var(--mauve6); - padding-top: 10px; -} diff --git a/apps/rush-components/src/components/Tabs/index.tsx b/apps/rush-components/src/components/Tabs/index.tsx index 0e8717d9ecb..e1834c434a7 100644 --- a/apps/rush-components/src/components/Tabs/index.tsx +++ b/apps/rush-components/src/components/Tabs/index.tsx @@ -4,6 +4,7 @@ import styles from './styles.scss'; type TabsItem = { header: string; + value?: string | number; body?: any; }; @@ -12,33 +13,38 @@ export const Tabs = ({ def, value, onChange, - children + renderChildren }: { items: TabsItem[]; def?: string; - value?: string; - onChange?: (value: string) => void; - children?: any; -}) => ( - - - {items.map((item) => ( - - {item.header} - - ))} - - {children - ? children - : items.map((item) => ( - - {item.body} - + value?: string | number; + onChange?: (value: any) => void; + renderChildren?: () => JSX.Element; +}) => { + const getItemValue = (item: TabsItem) => (item.value === undefined ? item.header : item.value); + return ( + + + {items.map((item) => ( + + {item.header} + ))} - -); + + {renderChildren + ? renderChildren() + : items.map((item) => + item.body ? ( + + {item.body} + + ) : null + )} + + ); +}; diff --git a/apps/rush-components/src/components/Tabs/styles.scss b/apps/rush-components/src/components/Tabs/styles.scss index e8675564c0d..af7b25d9928 100644 --- a/apps/rush-components/src/components/Tabs/styles.scss +++ b/apps/rush-components/src/components/Tabs/styles.scss @@ -14,8 +14,6 @@ input { display: flex; flex-direction: column; width: 100%; - box-shadow: 0 2px 10px var(--blackA4); - overflow-y: scroll; } .TabsList { @@ -26,7 +24,6 @@ input { .TabsTrigger { font-family: inherit; - background-color: white; padding: 0 20px; height: 45px; flex: 1; diff --git a/apps/rush-components/src/start.ts b/apps/rush-components/src/start.ts index b1f55190801..523b0c611f1 100644 --- a/apps/rush-components/src/start.ts +++ b/apps/rush-components/src/start.ts @@ -2,3 +2,4 @@ export * from './components/Button'; export * from './components/ScrollArea'; export * from './components/Tabs'; export * from './components/Checkbox'; +export * from './components/Input'; From 79ee887ccd490a01312d392738f04c097c7cffee Mon Sep 17 00:00:00 2001 From: William Huang Date: Wed, 4 Jan 2023 13:49:15 -0500 Subject: [PATCH 024/167] feat: update buttons, update packages --- .../src/containers/BookmarksSidebar/index.tsx | 3 ++- .../containers/SelectedEntryPreview/index.tsx | 17 ++++++++--------- apps/rush-components/package.json | 4 ++-- .../src/components/Button/index.tsx | 15 +++++++++++++-- .../src/components/Button/styles.scss | 11 +++++++++++ apps/rush-components/src/styles/_base.scss | 7 +++++++ .../config/rush/browser-approved-packages.json | 8 ++++++++ 7 files changed, 51 insertions(+), 14 deletions(-) create mode 100644 apps/rush-components/src/components/Button/styles.scss create mode 100644 apps/rush-components/src/styles/_base.scss diff --git a/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx b/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx index a42522c021f..7f0ef49e04c 100644 --- a/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx @@ -7,6 +7,7 @@ import styles from './styles.scss'; import { useAppDispatch, useAppSelector } from '../../store/hooks'; import { LockfileEntry } from '../../parsing/LockfileEntry'; import { clearStackAndPush, removeBookmark } from '../../store/slices/entrySlice'; +import { Button } from '@rushstack/components'; export const BookmarksSidebar = (): JSX.Element => { const bookmarks = useAppSelector((state) => state.entry.bookmarkedEntries); @@ -32,7 +33,7 @@ export const BookmarksSidebar = (): JSX.Element => { {bookmarks.map((bookmarkedEntry) => (

{bookmarkedEntry.displayText}

- +
))}
diff --git a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx index 03f82679e3e..414e446636c 100644 --- a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx @@ -40,20 +40,20 @@ export const SelectedEntryPreview = (): JSX.Element => { const renderButtonRow = (): JSX.Element => { return (
- - + + {isBookmarked ? ( - + ) : ( - + )}
); @@ -65,7 +65,6 @@ export const SelectedEntryPreview = (): JSX.Element => {
No Entry Selected
{renderButtonRow()} -
); diff --git a/apps/rush-components/package.json b/apps/rush-components/package.json index 514e29b872e..ef52d8451ea 100644 --- a/apps/rush-components/package.json +++ b/apps/rush-components/package.json @@ -22,8 +22,8 @@ "@rushstack/heft-web-rig": "workspace:*", "@rushstack/heft": "workspace:*", "@types/heft-jest": "1.0.1", - "@types/react-dom": "16.13.1", - "@types/react": "16.13.1", + "@types/react-dom": "16.9.14", + "@types/react": "16.14.23", "@types/webpack-env": "1.13.0", "@radix-ui/react-scroll-area": "~1.0.2", "@radix-ui/colors": "~0.1.8", diff --git a/apps/rush-components/src/components/Button/index.tsx b/apps/rush-components/src/components/Button/index.tsx index f72ed78f607..8401c7c863c 100644 --- a/apps/rush-components/src/components/Button/index.tsx +++ b/apps/rush-components/src/components/Button/index.tsx @@ -1,5 +1,16 @@ import React from 'react'; +import styles from './styles.scss'; -export const Button = () => { - return ; +type ButtonProps = { + children: JSX.Element | string; + disabled?: boolean; + onClick: () => void; +}; + +export const Button = ({ children, disabled = false }: ButtonProps) => { + return ( + + ); }; diff --git a/apps/rush-components/src/components/Button/styles.scss b/apps/rush-components/src/components/Button/styles.scss new file mode 100644 index 00000000000..08945eebf03 --- /dev/null +++ b/apps/rush-components/src/components/Button/styles.scss @@ -0,0 +1,11 @@ +@use '../../styles/base'; + +.ButtonWrapper { + padding: 4px 8px; + border: 1px solid base.$active-primary; + border-radius: 2px; + &:hover { + cursor: pointer; + background-color: base.$active-background; + } +} diff --git a/apps/rush-components/src/styles/_base.scss b/apps/rush-components/src/styles/_base.scss new file mode 100644 index 00000000000..ff8fa2863e6 --- /dev/null +++ b/apps/rush-components/src/styles/_base.scss @@ -0,0 +1,7 @@ +$shadow: 0 2px 10px hsla(0, 0%, 0%, 0.141); + +$background-primary: white; +$background-secondary: #f3f2f1; + +$active-primary: #107c10; +$active-background: #dff6dd; diff --git a/common/config/rush/browser-approved-packages.json b/common/config/rush/browser-approved-packages.json index 1922351270a..d9e0585a56c 100644 --- a/common/config/rush/browser-approved-packages.json +++ b/common/config/rush/browser-approved-packages.json @@ -14,6 +14,14 @@ "name": "@radix-ui/colors", "allowedCategories": [ "libraries" ] }, + { + "name": "@radix-ui/react-checkbox", + "allowedCategories": [ "libraries" ] + }, + { + "name": "@radix-ui/react-icons", + "allowedCategories": [ "libraries" ] + }, { "name": "@radix-ui/react-scroll-area", "allowedCategories": [ "libraries" ] From aa5eaa7d16629e144cbb497c949957ebee9b9eb3 Mon Sep 17 00:00:00 2001 From: William Huang Date: Fri, 6 Jan 2023 13:56:07 -0500 Subject: [PATCH 025/167] chore: tweak styles --- apps/lockfile-explorer-web/src/App.scss | 11 +++----- .../LockfileEntryDetailsView/styles.scss | 2 +- .../src/containers/LockfileViewer/index.tsx | 1 - .../containers/PackageJsonViewer/index.tsx | 4 +-- .../containers/PackageJsonViewer/styles.scss | 4 +++ .../SelectedEntryPreview/styles.scss | 5 ++-- .../src/components/Button/styles.scss | 6 ++--- .../src/components/Checkbox/styles.scss | 12 ++++----- .../src/components/Input/styles.scss | 4 ++- .../src/components/ScrollArea/styles.scss | 12 ++++----- .../src/components/Tabs/styles.scss | 25 ++++++------------- apps/rush-components/src/styles/_base.scss | 6 ----- apps/rush-components/src/styles/_colors.scss | 10 ++++++++ common/config/rush/repo-state.json | 2 +- 14 files changed, 47 insertions(+), 57 deletions(-) create mode 100644 apps/rush-components/src/styles/_colors.scss diff --git a/apps/lockfile-explorer-web/src/App.scss b/apps/lockfile-explorer-web/src/App.scss index cc5f9906fae..3cf4dce5e1b 100644 --- a/apps/lockfile-explorer-web/src/App.scss +++ b/apps/lockfile-explorer-web/src/App.scss @@ -1,13 +1,8 @@ -@import 'office-ui-fabric-core/dist/sass/References'; - -@mixin card { - box-shadow: $ms-depth-shadow-8; - background-color: $ms-color-gray10; - padding: 24px; -} +@use './styles/base'; .ContainerCard { - @include card; + padding: 24px; + @include base.card; } .AppContainer { diff --git a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/styles.scss b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/styles.scss index 700eb3702fa..3526efbafdb 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/styles.scss @@ -1,4 +1,4 @@ -@import 'office-ui-fabric-core/dist/sass/References'; +@use '../../styles/base'; .LockfileEntryListView { display: flex; diff --git a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx index f72f876054e..fa21040d791 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx @@ -2,7 +2,6 @@ // See LICENSE in the project root for license information. import React, { useCallback, useEffect, useRef, useState } from 'react'; -import appStyles from '../../App.scss'; import styles from './styles.scss'; import { LockfileEntry, LockfileEntryFilter } from '../../parsing/LockfileEntry'; import { ReactNull } from '../../types/ReactNull'; diff --git a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx index 40d44aa55d1..46e4c348af5 100644 --- a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx @@ -215,9 +215,7 @@ export const PackageJsonViewer = (): JSX.Element => { value={selection} onChange={cb} /> -
-
{renderFile()}
-
+
{renderFile()}
); }; diff --git a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/styles.scss b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/styles.scss index 3b8c866609e..662721382f6 100644 --- a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/styles.scss @@ -1,4 +1,7 @@ +@use '../../styles/base'; + .PackageJsonWrapper { + @include base.card; height: 30%; margin-top: 12px; } @@ -6,6 +9,7 @@ .FileContents { height: calc(25vh - 35px); overflow: scroll; + padding: 12px; } @mixin SpecWrapper { diff --git a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/styles.scss b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/styles.scss index b816c5a6770..65cb3dfb722 100644 --- a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/styles.scss @@ -1,9 +1,8 @@ -@import 'office-ui-fabric-core/dist/sass/References'; +@use '../../styles/base'; .SelectedEntryCard { margin-top: 12px; - box-shadow: $ms-depth-shadow-8; - background-color: $ms-color-gray10; + @include base.card; padding: 12px 24px; height: 8%; overflow: scroll; diff --git a/apps/rush-components/src/components/Button/styles.scss b/apps/rush-components/src/components/Button/styles.scss index 08945eebf03..acba5f1a2d4 100644 --- a/apps/rush-components/src/components/Button/styles.scss +++ b/apps/rush-components/src/components/Button/styles.scss @@ -1,11 +1,11 @@ -@use '../../styles/base'; +@use '../../styles/colors'; .ButtonWrapper { padding: 4px 8px; - border: 1px solid base.$active-primary; + border: 1px solid colors.$primary-active; border-radius: 2px; &:hover { cursor: pointer; - background-color: base.$active-background; + background-color: colors.$primary-background; } } diff --git a/apps/rush-components/src/components/Checkbox/styles.scss b/apps/rush-components/src/components/Checkbox/styles.scss index fc6821b2674..ebcc1cafd26 100644 --- a/apps/rush-components/src/components/Checkbox/styles.scss +++ b/apps/rush-components/src/components/Checkbox/styles.scss @@ -1,5 +1,4 @@ -@import '@radix-ui/colors/blackA.css'; -@import '@radix-ui/colors/violet.css'; +@use '../../styles/colors'; /* reset */ button { @@ -14,17 +13,18 @@ button { display: flex; align-items: center; justify-content: center; - box-shadow: 0 2px 10px var(--blackA7); + box-shadow: 0 2px 10px colors.$black; + cursor: pointer; } .CheckboxRoot:hover { - background-color: var(--violet3); + background-color: colors.$primary-background; } .CheckboxRoot:focus { - box-shadow: 0 0 0 2px black; + box-shadow: 0 0 0 2px colors.$primary-active; } .CheckboxIndicator { - color: var(--violet11); + color: colors.$primary-active; } .Label { diff --git a/apps/rush-components/src/components/Input/styles.scss b/apps/rush-components/src/components/Input/styles.scss index dc7520862af..41c05e58483 100644 --- a/apps/rush-components/src/components/Input/styles.scss +++ b/apps/rush-components/src/components/Input/styles.scss @@ -1,5 +1,7 @@ +@use '../../styles/colors'; + .InputWrapper { - border: solid 1px #666; + border: solid 1px colors.$gray; border-radius: 4px; padding: 0.4em; } diff --git a/apps/rush-components/src/components/ScrollArea/styles.scss b/apps/rush-components/src/components/ScrollArea/styles.scss index 75c99b239c5..3c2a13317f1 100644 --- a/apps/rush-components/src/components/ScrollArea/styles.scss +++ b/apps/rush-components/src/components/ScrollArea/styles.scss @@ -1,6 +1,4 @@ -@import '@radix-ui/colors/blackA.css'; -@import '@radix-ui/colors/mauve.css'; -@import '@radix-ui/colors/violet.css'; +@use '../../styles/colors'; .ScrollAreaRoot { border-radius: 4px; @@ -22,11 +20,11 @@ /* disable browser handling of all panning and zooming gestures on touch devices */ touch-action: none; padding: 2px; - background: var(--blackA6); + background: colors.$black; transition: background 160ms ease-out; } .ScrollAreaScrollbar:hover { - background: var(--blackA8); + background: colors.$black; } .ScrollAreaScrollbar[data-orientation='vertical'] { width: var(--scrollbar-size); @@ -38,7 +36,7 @@ .ScrollAreaThumb { flex: 1; - background: var(--mauve10); + background: colors.$primary-active; border-radius: var(--scrollbar-size); position: relative; } @@ -56,5 +54,5 @@ } .ScrollAreaCorner { - background: var(--blackA8); + background: colors.$black; } diff --git a/apps/rush-components/src/components/Tabs/styles.scss b/apps/rush-components/src/components/Tabs/styles.scss index af7b25d9928..5fd7204463e 100644 --- a/apps/rush-components/src/components/Tabs/styles.scss +++ b/apps/rush-components/src/components/Tabs/styles.scss @@ -1,7 +1,4 @@ -@import '@radix-ui/colors/blackA.css'; -@import '@radix-ui/colors/green.css'; -@import '@radix-ui/colors/mauve.css'; -@import '@radix-ui/colors/violet.css'; +@use '../../styles/colors'; /* reset */ button, @@ -19,7 +16,7 @@ input { .TabsList { flex-shrink: 0; display: flex; - border-bottom: 1px solid var(--mauve6); + border-bottom: 1px solid colors.$primary-active; } .TabsTrigger { @@ -32,31 +29,25 @@ input { justify-content: center; font-size: 15px; line-height: 1; - color: var(--mauve11); + color: colors.$black; user-select: none; } -.TabsTrigger:first-child { - border-top-left-radius: 6px; -} -.TabsTrigger:last-child { - border-top-right-radius: 6px; -} .TabsTrigger:hover { - color: var(--violet11); + color: colors.$primary-active; + cursor: pointer; } .TabsTrigger[data-state='active'] { - color: var(--violet11); + color: colors.$primary-active; box-shadow: inset 0 -1px 0 0 currentColor, 0 1px 0 0 currentColor; } .TabsTrigger:focus { position: relative; - box-shadow: 0 0 0 2px black; + box-shadow: 0 0 0 2px colors.$primary-active; } .TabsContent { flex-grow: 1; - padding: 20px; - background-color: white; + padding: 12px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; outline: none; diff --git a/apps/rush-components/src/styles/_base.scss b/apps/rush-components/src/styles/_base.scss index ff8fa2863e6..c8610b0ae5f 100644 --- a/apps/rush-components/src/styles/_base.scss +++ b/apps/rush-components/src/styles/_base.scss @@ -1,7 +1 @@ $shadow: 0 2px 10px hsla(0, 0%, 0%, 0.141); - -$background-primary: white; -$background-secondary: #f3f2f1; - -$active-primary: #107c10; -$active-background: #dff6dd; diff --git a/apps/rush-components/src/styles/_colors.scss b/apps/rush-components/src/styles/_colors.scss new file mode 100644 index 00000000000..e7b9f8273f1 --- /dev/null +++ b/apps/rush-components/src/styles/_colors.scss @@ -0,0 +1,10 @@ +$background-primary: white; +$background-secondary: #f3f2f1; + +$primary-active: #107c10; +$primary-background: #dff6dd; + +$secondary-active: #ab9e8e; + +$black: #000000; +$gray: #666; diff --git a/common/config/rush/repo-state.json b/common/config/rush/repo-state.json index 4ab073e623c..fec1d2b4360 100644 --- a/common/config/rush/repo-state.json +++ b/common/config/rush/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "2d4113be0a631885212233ee12084088dd8b09f4", + "pnpmShrinkwrapHash": "c0a0517f72a77533ef59a0226421b18cfb4c3738", "preferredVersionsHash": "5222ca779ae69ebfd201e39c17f48ce9eaf8c3c2" } From fa052f97819709457e3013ae8f31db09c25afbe3 Mon Sep 17 00:00:00 2001 From: William Huang Date: Mon, 9 Jan 2023 10:26:22 -0500 Subject: [PATCH 026/167] feat: tweak styles to fit scroll area --- apps/lockfile-explorer-web/src/App.scss | 2 +- .../src/containers/BookmarksSidebar/index.tsx | 20 +- .../containers/BookmarksSidebar/styles.scss | 2 +- .../LockfileEntryDetailsView/index.tsx | 177 +++++++++--------- .../LockfileEntryDetailsView/styles.scss | 7 +- .../src/containers/LockfileViewer/styles.scss | 1 + .../containers/PackageJsonViewer/index.tsx | 7 +- .../containers/PackageJsonViewer/styles.scss | 6 +- .../containers/SelectedEntryPreview/index.tsx | 24 +-- .../SelectedEntryPreview/styles.scss | 3 +- .../src/components/Button/index.tsx | 4 +- .../src/components/Checkbox/styles.scss | 5 +- .../src/components/ScrollArea/styles.scss | 11 +- 13 files changed, 141 insertions(+), 128 deletions(-) diff --git a/apps/lockfile-explorer-web/src/App.scss b/apps/lockfile-explorer-web/src/App.scss index 3cf4dce5e1b..01c58049d37 100644 --- a/apps/lockfile-explorer-web/src/App.scss +++ b/apps/lockfile-explorer-web/src/App.scss @@ -1,7 +1,7 @@ @use './styles/base'; .ContainerCard { - padding: 24px; + padding: 12px; @include base.card; } diff --git a/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx b/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx index 7f0ef49e04c..f77266cd947 100644 --- a/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx @@ -7,7 +7,7 @@ import styles from './styles.scss'; import { useAppDispatch, useAppSelector } from '../../store/hooks'; import { LockfileEntry } from '../../parsing/LockfileEntry'; import { clearStackAndPush, removeBookmark } from '../../store/slices/entrySlice'; -import { Button } from '@rushstack/components'; +import { Button, ScrollArea } from '@rushstack/components'; export const BookmarksSidebar = (): JSX.Element => { const bookmarks = useAppSelector((state) => state.entry.bookmarkedEntries); @@ -28,14 +28,16 @@ export const BookmarksSidebar = (): JSX.Element => { return (
-
Bookmarks
-
- {bookmarks.map((bookmarkedEntry) => ( -
-

{bookmarkedEntry.displayText}

- -
- ))} + +
Bookmarks
+
+ {bookmarks.map((bookmarkedEntry) => ( +
+

{bookmarkedEntry.displayText}

+ +
+ ))} +
); }; diff --git a/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/styles.scss b/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/styles.scss index 329508f3696..0e95ded19f2 100644 --- a/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/styles.scss @@ -1,6 +1,6 @@ .BookmarksWrapper { - flex: 1; margin: 12px 0; + height: calc(100vh - 94px - 44px); } .BookmarkEntry { diff --git a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx index 14cbd190e32..4a5abf08884 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx @@ -2,6 +2,7 @@ // See LICENSE in the project root for license information. import React, { useCallback, useEffect, useState } from 'react'; +import { ScrollArea } from '@rushstack/components'; import styles from './styles.scss'; import appStyles from '../../App.scss'; import { IDependencyType, LockfileDependency } from '../../parsing/LockfileDependency'; @@ -132,30 +133,32 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => { } return (
-
-
Selected Dependency:
- - {inspectDependency.name}: {inspectDependency.version} - -
-
-
package.json spec:
- - {inspectDependency.dependencyType === IDependencyType.PEER_DEPENDENCY - ? `"${inspectDependency.peerDependencyMeta.version}" ${ - inspectDependency.peerDependencyMeta.optional ? 'Optional' : 'Required' - } Peer` - : inspectDependency.version} - -
-
-
.pnpmfile.cjs:
- - {specChanges.has(inspectDependency.name) - ? displaySpecChanges(specChanges, inspectDependency.name) - : 'No Effect'} - -
+ +
+
Selected Dependency:
+ + {inspectDependency.name}: {inspectDependency.version} + +
+
+
package.json spec:
+ + {inspectDependency.dependencyType === IDependencyType.PEER_DEPENDENCY + ? `"${inspectDependency.peerDependencyMeta.version}" ${ + inspectDependency.peerDependencyMeta.optional ? 'Optional' : 'Required' + } Peer` + : inspectDependency.version} + +
+
+
.pnpmfile.cjs:
+ + {specChanges.has(inspectDependency.name) + ? displaySpecChanges(specChanges, inspectDependency.name) + : 'No Effect'} + +
+
); }; @@ -185,34 +188,36 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => { return (
-
Determinants:
- {determinants.length ? ( - determinants.map(({ entry }) => ( - - {entry.displayText} - - )) - ) : ( -

(none)

- )} -
Transitive Referencers:
- {transitiveReferrers.length ? ( - transitiveReferrers.map(({ entry }) => ( - - {entry.displayText} - - )) - ) : ( -

(none)

- )} + +
Determinants:
+ {determinants.length ? ( + determinants.map(({ entry }) => ( + + {entry.displayText} + + )) + ) : ( +

(none)

+ )} +
Transitive Referencers:
+ {transitiveReferrers.length ? ( + transitiveReferrers.map(({ entry }) => ( + + {entry.displayText} + + )) + ) : ( +

(none)

+ )} +
); }; @@ -231,45 +236,49 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => {
Direct Referrers
- {selectedEntry.referrers?.map((referrer: LockfileEntry) => ( -
-
Name: {referrer.displayText}
-
-

Entry ID: {referrer.rawEntryId}

+ + {selectedEntry.referrers?.map((referrer: LockfileEntry) => ( +
+
Name: {referrer.displayText}
+
+

Entry ID: {referrer.rawEntryId}

+
-
- ))} + ))} +
Direct Dependencies
- {selectedEntry.dependencies?.map((dependency: LockfileDependency) => ( -
-
- Name: {dependency.name}{' '} - {dependency.dependencyType === IDependencyType.PEER_DEPENDENCY - ? `${ - dependency.peerDependencyMeta.optional ? '(Optional)' : '(Non-optional)' - } Peer Dependency` - : ''} -
-
-

Version: {dependency.version}

-

Entry ID: {dependency.entryId}

+ + {selectedEntry.dependencies?.map((dependency: LockfileDependency) => ( +
+
+ Name: {dependency.name}{' '} + {dependency.dependencyType === IDependencyType.PEER_DEPENDENCY + ? `${ + dependency.peerDependencyMeta.optional ? '(Optional)' : '(Non-optional)' + } Peer Dependency` + : ''} +
+
+

Version: {dependency.version}

+

Entry ID: {dependency.entryId}

+
-
- ))} + ))} +
diff --git a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/styles.scss b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/styles.scss index 3526efbafdb..14a3a3ce406 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/styles.scss @@ -6,7 +6,7 @@ height: 30%; padding-top: 12px; & > * { - width: calc(50% - 48px - 12px); + width: calc(50% - 24px - 12px); } h5 { margin: 0; @@ -15,8 +15,7 @@ .DependencyListWrapper { margin-top: 8px; - height: calc(25vh - 24px); - overflow: scroll; + height: calc(100% - 24px); } .DependencyItem { @@ -41,13 +40,11 @@ .InfluencerList { margin-top: 12px; height: 10%; - overflow: scroll; } .DependencyDetails { margin-top: 12px; height: 4%; - overflow: scroll; } .InfluencerEntry { diff --git a/apps/lockfile-explorer-web/src/containers/LockfileViewer/styles.scss b/apps/lockfile-explorer-web/src/containers/LockfileViewer/styles.scss index 52e06968c03..0267029e7ed 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileViewer/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/LockfileViewer/styles.scss @@ -12,6 +12,7 @@ flex-direction: column; min-height: calc(100% - 35px); max-height: calc(100% - 35px); + height: calc(100% - 35px); & > * + * { margin-top: 12px; } diff --git a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx index 46e4c348af5..5ee30ba28a5 100644 --- a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx @@ -12,7 +12,7 @@ import { compareSpec } from '../../parsing/compareSpec'; import { loadSpecChanges } from '../../store/slices/workspaceSlice'; import { displaySpecChanges } from '../../helpers/displaySpecChanges'; import { isEntryModified } from '../../helpers/isEntryModified'; -import { Tabs } from '@rushstack/components'; +import { ScrollArea, Tabs } from '@rushstack/components'; enum PackageView { PACKAGE_JSON, @@ -215,7 +215,10 @@ export const PackageJsonViewer = (): JSX.Element => { value={selection} onChange={cb} /> -
{renderFile()}
+ +
+ {renderFile()} +
); }; diff --git a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/styles.scss b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/styles.scss index 662721382f6..9936a81c208 100644 --- a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/styles.scss @@ -7,9 +7,9 @@ } .FileContents { - height: calc(25vh - 35px); - overflow: scroll; - padding: 12px; + height: calc(100% - 46px); + padding: 0 12px; + overflow: hidden; } @mixin SpecWrapper { diff --git a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx index 414e446636c..befe2e861b7 100644 --- a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx @@ -11,7 +11,7 @@ import { removeBookmark, selectCurrentEntry } from '../../store/slices/entrySlice'; -import { Button } from '@rushstack/components'; +import { Button, ScrollArea } from '@rushstack/components'; export const SelectedEntryPreview = (): JSX.Element => { const selectedEntry = useAppSelector(selectCurrentEntry); @@ -72,17 +72,19 @@ export const SelectedEntryPreview = (): JSX.Element => { return (
-
-
-
Selected entry:
- {selectedEntry.displayText} + +
+
+
Selected entry:
+ {selectedEntry.displayText} +
+ {renderButtonRow()}
- {renderButtonRow()} -
-
-

Package Entry: {selectedEntry.rawEntryId}

-

Package JSON path: {selectedEntry.packageJsonFolderPath}

-
+
+

Package Entry: {selectedEntry.rawEntryId}

+

Package JSON path: {selectedEntry.packageJsonFolderPath}

+
+
); }; diff --git a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/styles.scss b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/styles.scss index 65cb3dfb722..751a2f7fb09 100644 --- a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/styles.scss @@ -3,9 +3,8 @@ .SelectedEntryCard { margin-top: 12px; @include base.card; - padding: 12px 24px; + padding: 12px; height: 8%; - overflow: scroll; p { font-size: 12px; } diff --git a/apps/rush-components/src/components/Button/index.tsx b/apps/rush-components/src/components/Button/index.tsx index 8401c7c863c..363d423c4dd 100644 --- a/apps/rush-components/src/components/Button/index.tsx +++ b/apps/rush-components/src/components/Button/index.tsx @@ -7,9 +7,9 @@ type ButtonProps = { onClick: () => void; }; -export const Button = ({ children, disabled = false }: ButtonProps) => { +export const Button = ({ children, disabled = false, onClick }: ButtonProps) => { return ( - ); diff --git a/apps/rush-components/src/components/Checkbox/styles.scss b/apps/rush-components/src/components/Checkbox/styles.scss index ebcc1cafd26..b2f05d9dafa 100644 --- a/apps/rush-components/src/components/Checkbox/styles.scss +++ b/apps/rush-components/src/components/Checkbox/styles.scss @@ -13,15 +13,12 @@ button { display: flex; align-items: center; justify-content: center; - box-shadow: 0 2px 10px colors.$black; + border: 1px solid colors.$black; cursor: pointer; } .CheckboxRoot:hover { background-color: colors.$primary-background; } -.CheckboxRoot:focus { - box-shadow: 0 0 0 2px colors.$primary-active; -} .CheckboxIndicator { color: colors.$primary-active; diff --git a/apps/rush-components/src/components/ScrollArea/styles.scss b/apps/rush-components/src/components/ScrollArea/styles.scss index 3c2a13317f1..d20d04d2920 100644 --- a/apps/rush-components/src/components/ScrollArea/styles.scss +++ b/apps/rush-components/src/components/ScrollArea/styles.scss @@ -4,13 +4,16 @@ border-radius: 4px; overflow: hidden; --scrollbar-size: 6px; - height: 100vh; + height: 100%; } .ScrollAreaViewport { width: 100%; height: 100%; border-radius: inherit; + & > * { + padding-right: 8px; + } } .ScrollAreaScrollbar { @@ -20,11 +23,11 @@ /* disable browser handling of all panning and zooming gestures on touch devices */ touch-action: none; padding: 2px; - background: colors.$black; + background: colors.$background-secondary; transition: background 160ms ease-out; } .ScrollAreaScrollbar:hover { - background: colors.$black; + background: colors.$background-secondary; } .ScrollAreaScrollbar[data-orientation='vertical'] { width: var(--scrollbar-size); @@ -54,5 +57,5 @@ } .ScrollAreaCorner { - background: colors.$black; + background: colors.$background-secondary; } From 1eb908870eb213f61db7bd6311658e5cb527dd97 Mon Sep 17 00:00:00 2001 From: William Huang Date: Wed, 11 Jan 2023 13:37:51 -0800 Subject: [PATCH 027/167] feat: Add Text component --- .../src/components/ConnectionModal/index.tsx | 19 +++- .../src/containers/BookmarksSidebar/index.tsx | 8 +- .../containers/BookmarksSidebar/styles.scss | 9 +- .../LockfileEntryDetailsView/index.tsx | 69 +++++++----- .../LockfileEntryDetailsView/styles.scss | 7 -- .../src/containers/LockfileViewer/index.tsx | 20 ++-- .../src/containers/LockfileViewer/styles.scss | 3 - .../containers/PackageJsonViewer/index.tsx | 105 ++++++++++++------ .../containers/SelectedEntryPreview/index.tsx | 14 ++- .../SelectedEntryPreview/styles.scss | 3 - apps/lockfile-explorer-web/src/start.css | 6 - .../src/components/Text/index.tsx | 73 ++++++++++++ .../src/components/Text/styles.scss | 41 +++++++ apps/rush-components/src/start.ts | 1 + 14 files changed, 273 insertions(+), 105 deletions(-) create mode 100644 apps/rush-components/src/components/Text/index.tsx create mode 100644 apps/rush-components/src/components/Text/styles.scss diff --git a/apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx b/apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx index 52aabafa96a..661cbb9af03 100644 --- a/apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx +++ b/apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx @@ -2,6 +2,7 @@ // See LICENSE in the project root for license information. import React, { useCallback, useEffect, useState } from 'react'; +import { Button, Text } from '@rushstack/components'; import styles from './styles.scss'; import appStyles from '../../App.scss'; import { checkAliveAsync } from '../../parsing/getPackageFiles'; @@ -41,17 +42,23 @@ export const ConnectionModal = (): JSX.Element | ReactNull => { return (
-
The server has disconnected!
+ + The server has disconnected! + {manualChecked ? ( -

We were still not able to establish a connection to the server. Are you sure it is running?

+ + We were still not able to establish a connection to the server. Are you sure it is running? + ) : ( -

Please re-start the local development server to continue using this application.

+ + Please re-start the local development server to continue using this application. + )}
- - {checking ?

Checking...

: null} + + {checking ? Checking... : null}
diff --git a/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx b/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx index f77266cd947..749b084ba9e 100644 --- a/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx @@ -7,7 +7,7 @@ import styles from './styles.scss'; import { useAppDispatch, useAppSelector } from '../../store/hooks'; import { LockfileEntry } from '../../parsing/LockfileEntry'; import { clearStackAndPush, removeBookmark } from '../../store/slices/entrySlice'; -import { Button, ScrollArea } from '@rushstack/components'; +import { Button, ScrollArea, Text } from '@rushstack/components'; export const BookmarksSidebar = (): JSX.Element => { const bookmarks = useAppSelector((state) => state.entry.bookmarkedEntries); @@ -29,11 +29,13 @@ export const BookmarksSidebar = (): JSX.Element => { return (
-
Bookmarks
+ Bookmarks
{bookmarks.map((bookmarkedEntry) => (
-

{bookmarkedEntry.displayText}

+
+ {bookmarkedEntry.displayText} +
))} diff --git a/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/styles.scss b/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/styles.scss index 0e95ded19f2..08b03e0a3b4 100644 --- a/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/styles.scss @@ -7,10 +7,13 @@ padding: 4px 0; margin-top: 8px; cursor: pointer; - &:hover { - background: #dff6dd; - } & > * + * { margin-top: 8px; } } + +.BookmarkLabel { + &:hover { + background: #dff6dd; + } +} diff --git a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx index 4a5abf08884..913e906b5b0 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import React, { useCallback, useEffect, useState } from 'react'; -import { ScrollArea } from '@rushstack/components'; +import { ScrollArea, Text } from '@rushstack/components'; import styles from './styles.scss'; import appStyles from '../../App.scss'; import { IDependencyType, LockfileDependency } from '../../parsing/LockfileDependency'; @@ -121,7 +121,6 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => { const selectResolvedReferencer = useCallback( (referrer) => () => { - console.log('going to entry: ', referrer); dispatch(pushToStack(referrer)); }, [selectedEntry] @@ -135,28 +134,34 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => {
-
Selected Dependency:
- + + Selected Dependency:{' '} + + {inspectDependency.name}: {inspectDependency.version} - +
-
package.json spec:
- + + package.json spec:{' '} + + {inspectDependency.dependencyType === IDependencyType.PEER_DEPENDENCY ? `"${inspectDependency.peerDependencyMeta.version}" ${ inspectDependency.peerDependencyMeta.optional ? 'Optional' : 'Required' } Peer` : inspectDependency.version} - +
-
.pnpmfile.cjs:
- + + .pnpmfile.cjs:{' '} + + {specChanges.has(inspectDependency.name) ? displaySpecChanges(specChanges, inspectDependency.name) : 'No Effect'} - +
@@ -171,14 +176,14 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => { if (!peerDeps.length) { return (
-
No peer dependencies.
+ No peer dependencies.
); } if (!inspectDependency || inspectDependency.dependencyType !== IDependencyType.PEER_DEPENDENCY) { return (
-
Select a peer dependency to view its influencers
+ Select a peer dependency to view its influencers
); } @@ -189,7 +194,9 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => { return (
-
Determinants:
+ + Determinants: + {determinants.length ? ( determinants.map(({ entry }) => ( { )) ) : ( -

(none)

+ (none) )} -
Transitive Referencers:
+ + Transitive Referencers: + {transitiveReferrers.length ? ( transitiveReferrers.map(({ entry }) => ( { )) ) : ( -

(none)

+ (none) )}
@@ -225,7 +234,9 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => { if (!selectedEntry) { return (
-
Select an entry to view its details
+ + Select an entry to view its details +
); } @@ -234,7 +245,9 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => { <>
-
Direct Referrers
+ + Direct Referrers +
{selectedEntry.referrers?.map((referrer: LockfileEntry) => ( @@ -243,9 +256,11 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => { key={referrer.rawEntryId} onClick={selectResolvedReferencer(referrer)} > -
Name: {referrer.displayText}
+ + Name: {referrer.displayText} +
-

Entry ID: {referrer.rawEntryId}

+ Entry ID: {referrer.rawEntryId}
))} @@ -253,7 +268,9 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => {
-
Direct Dependencies
+ + Direct Dependencies +
{selectedEntry.dependencies?.map((dependency: LockfileDependency) => ( @@ -264,17 +281,17 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => { key={dependency.entryId || dependency.name} onClick={selectResolvedEntry(dependency)} > -
+ Name: {dependency.name}{' '} {dependency.dependencyType === IDependencyType.PEER_DEPENDENCY ? `${ dependency.peerDependencyMeta.optional ? '(Optional)' : '(Non-optional)' } Peer Dependency` : ''} -
+
-

Version: {dependency.version}

-

Entry ID: {dependency.entryId}

+ Version: {dependency.version} + Entry ID: {dependency.entryId}
))} diff --git a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/styles.scss b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/styles.scss index 14a3a3ce406..c871eabd2c2 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/styles.scss @@ -8,9 +8,6 @@ & > * { width: calc(50% - 24px - 12px); } - h5 { - margin: 0; - } } .DependencyListWrapper { @@ -25,9 +22,6 @@ &:hover { border: 1px solid #107c10; } - p { - margin: 0; - } & > * + * { margin-top: 8px; } @@ -60,7 +54,6 @@ display: flex; align-items: center; span { - font-size: 12px; margin-left: 4px; } } diff --git a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx index fa21040d791..24fec95c688 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx @@ -13,7 +13,7 @@ import { setFilter as selectFilter } from '../../store/slices/entrySlice'; import { getFilterFromLocalStorage, saveFilterToLocalStorage } from '../../helpers/localStorage'; -import { Tabs, Checkbox, ScrollArea, Input } from '@rushstack/components'; +import { Tabs, Checkbox, ScrollArea, Input, Text } from '@rushstack/components'; interface ILockfileEntryGroup { entryName: string; @@ -51,7 +51,7 @@ const LockfileEntryLi = ({ group }: { group: ILockfileEntryGroup }): JSX.Element selectedEntry?.rawEntryId === entry.rawEntryId ? styles.lockfileSelectedEntry : '' }`} > -
{entry.entryPackageName}
+ {entry.entryPackageName}
))}
@@ -60,7 +60,9 @@ const LockfileEntryLi = ({ group }: { group: ILockfileEntryGroup }): JSX.Element return (
-
{group.entryName}
+ + {group.entryName} + {group.versions.map((entry) => (
-

+ {entry.entryPackageVersion} {entry.entrySuffix && `[${entry.entrySuffix}]`} -

+
))}
@@ -153,13 +155,9 @@ export const LockfileViewer = (): JSX.Element | ReactNull => { const togglePackageView = useCallback( (selected: LockfileEntryFilter) => { if (selected === LockfileEntryFilter.Project) { - console.log('first'); - dispatch(selectFilter({ filter: LockfileEntryFilter.Project, state: true })); dispatch(selectFilter({ filter: LockfileEntryFilter.Package, state: false })); } else { - console.log('elsing'); - dispatch(selectFilter({ filter: LockfileEntryFilter.Package, state: true })); dispatch(selectFilter({ filter: LockfileEntryFilter.Project, state: false })); } @@ -201,7 +199,9 @@ export const LockfileViewer = (): JSX.Element | ReactNull => { {activeFilters[LockfileEntryFilter.Package] ? (
-
Filters
+ + Filters + * + * { margin-top: 4px; } diff --git a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx index 5ee30ba28a5..fe479515110 100644 --- a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx @@ -4,7 +4,6 @@ import React, { useCallback, useEffect, useState } from 'react'; import { readPnpmfileAsync, readPackageSpecAsync, readPackageJsonAsync } from '../../parsing/getPackageFiles'; import styles from './styles.scss'; -import appStyles from '../../App.scss'; import { useAppDispatch, useAppSelector } from '../../store/hooks'; import { selectCurrentEntry } from '../../store/slices/entrySlice'; import { IPackageJson } from '../../types/IPackageJson'; @@ -12,7 +11,7 @@ import { compareSpec } from '../../parsing/compareSpec'; import { loadSpecChanges } from '../../store/slices/workspaceSlice'; import { displaySpecChanges } from '../../helpers/displaySpecChanges'; import { isEntryModified } from '../../helpers/isEntryModified'; -import { ScrollArea, Tabs } from '@rushstack/components'; +import { ScrollArea, Tabs, Text } from '@rushstack/components'; enum PackageView { PACKAGE_JSON, @@ -32,7 +31,6 @@ export const PackageJsonViewer = (): JSX.Element => { const [selection, setSelection] = useState(PackageView.PARSED_PACKAGE_JSON); const cb = useCallback((s: PackageView) => setSelection(s), []); - console.log('selection: ', selection); useEffect(() => { async function loadPnpmFileAsync(): Promise { @@ -77,57 +75,73 @@ export const PackageJsonViewer = (): JSX.Element => { case 'add': if (name) { return ( -

+ {dep} -

+ ); } else { return ( -

+ {version} {displaySpecChanges(specChanges, dep)} -

+ ); } case 'diff': if (name) { return ( -

+ {dep} -

+ ); } else { return ( -

+ {version} {displaySpecChanges(specChanges, dep)} -

+ ); } case 'remove': if (name) { return ( -

+ {dep} -

+ ); } else { return ( -

+ {version} {displaySpecChanges(specChanges, dep)} -

+ ); } default: if (name) { - return

{dep}:

; + return ( + + {dep}: + + ); } else { - return

{version}

; + return ( + + {version} + + ); } } } else { if (name) { - return

{dep}:

; + return ( + + {dep}: + + ); } else { - return

{version}

; + return ( + + {version} + + ); } } }; @@ -135,55 +149,80 @@ export const PackageJsonViewer = (): JSX.Element => { const renderFile = (): JSX.Element | null => { switch (selection) { case PackageView.PACKAGE_JSON: - if (!packageJSON) return
Please select a Project or Package to view it's package.json
; + if (!packageJSON) + return ( + + Please select a Project or Package to view it's package.json + + ); return
{JSON.stringify(packageJSON, null, 2)}
; case PackageView.PACKAGE_SPEC: if (!pnpmfile) { return ( -
+ Couldn't load the pnpmfile.cjs file - does it exist in the expected location? (/common/config/rush/.pnpmfile.cjs) -
+ ); } return
{pnpmfile}
; case PackageView.PARSED_PACKAGE_JSON: if (!parsedPackageJSON) - return
Please select a Project or Package to view the parsed package.json
; + return ( + + Please select a Project or Package to view the parsed package.json + + ); return (
-
Package Name:
-

{selectedEntry?.displayText}

+ + Package Name: + + {selectedEntry?.displayText}
-
Version:
-

{selectedEntry?.entryPackageVersion}

+ + Version: + + {selectedEntry?.entryPackageVersion}
-
Dependencies
+ + Dependencies + {parsedPackageJSON.dependencies && Object.entries(parsedPackageJSON.dependencies).map(renderDep(true))} -
Dev Dependencies
+ + Dev Dependencies + {parsedPackageJSON.devDependencies && Object.entries(parsedPackageJSON.devDependencies).map(renderDep(true))} -
Peer Dependencies
+ + Peer Dependencies + {parsedPackageJSON.peerDependencies && Object.entries(parsedPackageJSON.peerDependencies).map(renderDep(true))}
-
 
+ +   + {parsedPackageJSON.dependencies && Object.entries(parsedPackageJSON.dependencies).map(renderDep(false))} -
 
+ +   + {parsedPackageJSON.devDependencies && Object.entries(parsedPackageJSON.devDependencies).map(renderDep(false))} -
 
+ +   + {parsedPackageJSON.peerDependencies && Object.entries(parsedPackageJSON.peerDependencies).map(renderDep(false))}
diff --git a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx index befe2e861b7..c429f13d3f1 100644 --- a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx @@ -11,7 +11,7 @@ import { removeBookmark, selectCurrentEntry } from '../../store/slices/entrySlice'; -import { Button, ScrollArea } from '@rushstack/components'; +import { Button, ScrollArea, Text } from '@rushstack/components'; export const SelectedEntryPreview = (): JSX.Element => { const selectedEntry = useAppSelector(selectCurrentEntry); @@ -63,7 +63,9 @@ export const SelectedEntryPreview = (): JSX.Element => { return (
-
No Entry Selected
+ + No Entry Selected + {renderButtonRow()}
@@ -75,14 +77,16 @@ export const SelectedEntryPreview = (): JSX.Element => {
-
Selected entry:
+ + Selected entry: + {selectedEntry.displayText}
{renderButtonRow()}
-

Package Entry: {selectedEntry.rawEntryId}

-

Package JSON path: {selectedEntry.packageJsonFolderPath}

+ Package Entry: {selectedEntry.rawEntryId} + Package JSON path: {selectedEntry.packageJsonFolderPath}
diff --git a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/styles.scss b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/styles.scss index 751a2f7fb09..7a605fc4d94 100644 --- a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/styles.scss @@ -5,9 +5,6 @@ @include base.card; padding: 12px; height: 8%; - p { - font-size: 12px; - } & > * + * { margin-top: 8px; } diff --git a/apps/lockfile-explorer-web/src/start.css b/apps/lockfile-explorer-web/src/start.css index c7d2f557200..43f0b44e3f4 100644 --- a/apps/lockfile-explorer-web/src/start.css +++ b/apps/lockfile-explorer-web/src/start.css @@ -10,9 +10,3 @@ body { font-family: Tahoma, sans-serif; box-sizing: border-box; } - -h5, -p { - margin: 0; - font-size: 14px; -} diff --git a/apps/rush-components/src/components/Text/index.tsx b/apps/rush-components/src/components/Text/index.tsx new file mode 100644 index 00000000000..29b7f373ac9 --- /dev/null +++ b/apps/rush-components/src/components/Text/index.tsx @@ -0,0 +1,73 @@ +import React from 'react'; +import styles from './styles.scss'; + +export type TextType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span'; + +type TextProps = { + type: TextType; + bold?: boolean; + children: React.ReactNode; + className?: string; +}; +export const Text = ({ type, bold = false, children, className }: TextProps): JSX.Element => { + const generalStyles: { [key in string]: string | number } = { + ['fontWeight']: bold ? 'bold' : 'normal' + }; + + switch (type) { + case 'h1': + return ( +

+ {children} +

+ ); + case 'h2': + return ( +

+ {children} +

+ ); + case 'h3': + return ( +

+ {children} +

+ ); + case 'h4': + return ( +

+ {children} +

+ ); + case 'h5': + return ( + + {children} + + ); + case 'h6': + return ( +
+ {children} +
+ ); + case 'p': + return ( +

+ {children} +

+ ); + case 'span': + return ( + + {children} + + ); + default: + return ( +

+ {children} +

+ ); + } +}; diff --git a/apps/rush-components/src/components/Text/styles.scss b/apps/rush-components/src/components/Text/styles.scss new file mode 100644 index 00000000000..447b18b15ea --- /dev/null +++ b/apps/rush-components/src/components/Text/styles.scss @@ -0,0 +1,41 @@ +@mixin HeadingStyles { + font-weight: bold; + line-height: 1.2; + margin: 0; +} + +.H1 { + @include HeadingStyles; + font-size: 24px; +} +.H2 { + @include HeadingStyles; + font-size: 21px; +} +.H3 { + @include HeadingStyles; + font-size: 19px; +} +.H4 { + @include HeadingStyles; + font-size: 16px; +} +.H5 { + @include HeadingStyles; + font-size: 14px; +} +.H6 { + @include HeadingStyles; + font-size: 12px; +} + +.ParagraphStyles { + margin: 0; + font-weight: normal; + line-height: 1.5; + font-size: 14px; +} + +.SpanStyles { + font-size: 12px; +} diff --git a/apps/rush-components/src/start.ts b/apps/rush-components/src/start.ts index 523b0c611f1..b5fda3a0476 100644 --- a/apps/rush-components/src/start.ts +++ b/apps/rush-components/src/start.ts @@ -3,3 +3,4 @@ export * from './components/ScrollArea'; export * from './components/Tabs'; export * from './components/Checkbox'; export * from './components/Input'; +export * from './components/Text'; From 2c111c5bfaedae63930f7006a30ab08b846579e4 Mon Sep 17 00:00:00 2001 From: William Huang Date: Wed, 11 Jan 2023 15:07:14 -0800 Subject: [PATCH 028/167] chore: fix eslint error --- .../src/containers/LockfileViewer/index.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx index 24fec95c688..7c233021956 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx @@ -153,8 +153,8 @@ export const LockfileViewer = (): JSX.Element | ReactNull => { ); const togglePackageView = useCallback( - (selected: LockfileEntryFilter) => { - if (selected === LockfileEntryFilter.Project) { + (selected: string) => { + if (selected === 'Projects') { dispatch(selectFilter({ filter: LockfileEntryFilter.Project, state: true })); dispatch(selectFilter({ filter: LockfileEntryFilter.Package, state: false })); } else { @@ -178,9 +178,7 @@ export const LockfileViewer = (): JSX.Element | ReactNull => { } ]} value={activeFilters[LockfileEntryFilter.Project] ? 'Projects' : 'Packages'} - onChange={(val) => { - togglePackageView(val === 'Projects' ? LockfileEntryFilter.Project : LockfileEntryFilter.Package); - }} + onChange={togglePackageView} /> Date: Wed, 11 Jan 2023 17:17:39 -0800 Subject: [PATCH 029/167] feat: fix build errors in lockfile explorer --- apps/rush-components/config/jest.config.json | 5 +---- .../src/components/Button/index.tsx | 6 +++--- .../src/components/Checkbox/index.tsx | 2 +- .../rush-components/src/components/Input/index.tsx | 2 +- .../src/components/ScrollArea/index.tsx | 2 +- apps/rush-components/src/components/Tabs/index.tsx | 14 ++++++++------ apps/rush-components/src/components/Text/index.tsx | 10 +++++----- apps/rush-components/tsconfig.json | 3 ++- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/apps/rush-components/config/jest.config.json b/apps/rush-components/config/jest.config.json index 7f2f5dc42b6..7ee087ffe19 100644 --- a/apps/rush-components/config/jest.config.json +++ b/apps/rush-components/config/jest.config.json @@ -1,6 +1,3 @@ { - "extends": "@rushstack/heft-web-rig/profiles/app/config/jest.config.json", - - // Load the initappcontext.js stub when running tests - "setupFiles": ["../lib-commonjs/stub/initappcontext.js"] + "extends": "@rushstack/heft-web-rig/profiles/app/config/jest.config.json" } diff --git a/apps/rush-components/src/components/Button/index.tsx b/apps/rush-components/src/components/Button/index.tsx index 363d423c4dd..7fc50f0350e 100644 --- a/apps/rush-components/src/components/Button/index.tsx +++ b/apps/rush-components/src/components/Button/index.tsx @@ -1,13 +1,13 @@ import React from 'react'; import styles from './styles.scss'; -type ButtonProps = { +interface IButtonProps { children: JSX.Element | string; disabled?: boolean; onClick: () => void; -}; +} -export const Button = ({ children, disabled = false, onClick }: ButtonProps) => { +export const Button = ({ children, disabled = false, onClick }: IButtonProps): JSX.Element => { return ( ); }; diff --git a/apps/rush-components/src/components/Text/index.tsx b/apps/rush-components/src/components/Text/index.tsx index 21a3da12053..a45babcb996 100644 --- a/apps/rush-components/src/components/Text/index.tsx +++ b/apps/rush-components/src/components/Text/index.tsx @@ -8,10 +8,12 @@ interface ITextProps { bold?: boolean; children: React.ReactNode; className?: string; + size?: number; } -export const Text = ({ type, bold = false, children, className }: ITextProps): JSX.Element => { +export const Text = ({ type, bold = false, children, className, size }: ITextProps): JSX.Element => { const generalStyles: { [key in string]: string | number } = { - ['fontWeight']: bold ? 'bold' : 'normal' + ['fontWeight']: bold ? 'bold' : 'normal', + ...(size ? { fontSize: size } : {}) }; switch (type) { diff --git a/apps/rush-components/src/components/Text/styles.scss b/apps/rush-components/src/components/Text/styles.scss index 447b18b15ea..0c3c8369670 100644 --- a/apps/rush-components/src/components/Text/styles.scss +++ b/apps/rush-components/src/components/Text/styles.scss @@ -1,7 +1,13 @@ +@mixin TextStyles { + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, + 'Open Sans', 'Helvetica Neue', sans-serif; +} + @mixin HeadingStyles { font-weight: bold; line-height: 1.2; margin: 0; + @include TextStyles; } .H1 { @@ -30,6 +36,7 @@ } .ParagraphStyles { + @include TextStyles; margin: 0; font-weight: normal; line-height: 1.5; @@ -37,5 +44,6 @@ } .SpanStyles { + @include TextStyles; font-size: 12px; } From c066678bddd9d373fb20b143b8db10e152575fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=A0tekl?= Date: Thu, 12 Jan 2023 14:22:24 +0100 Subject: [PATCH 031/167] Apply suggestions from code review Co-authored-by: Ian Clanton-Thuon --- .../rush/stekycz-git-hooks-exec_2023-01-05-10-36.json | 2 +- libraries/rush-lib/src/logic/base/BaseInstallManager.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/changes/@microsoft/rush/stekycz-git-hooks-exec_2023-01-05-10-36.json b/common/changes/@microsoft/rush/stekycz-git-hooks-exec_2023-01-05-10-36.json index 11653445111..f583b5c77a2 100644 --- a/common/changes/@microsoft/rush/stekycz-git-hooks-exec_2023-01-05-10-36.json +++ b/common/changes/@microsoft/rush/stekycz-git-hooks-exec_2023-01-05-10-36.json @@ -2,7 +2,7 @@ "changes": [ { "packageName": "@microsoft/rush", - "comment": "[rush] Create custom git hooks instead of copy", + "comment": "Generate scripts in the Git hooks folder referring to the actual hook implementations in-place in the Rush `common/git-hooks/` folder instead of copying the scripts to the Git hooks folder.", "type": "none" } ], diff --git a/libraries/rush-lib/src/logic/base/BaseInstallManager.ts b/libraries/rush-lib/src/logic/base/BaseInstallManager.ts index 1dd39d612cf..0f09638079f 100644 --- a/libraries/rush-lib/src/logic/base/BaseInstallManager.ts +++ b/libraries/rush-lib/src/logic/base/BaseInstallManager.ts @@ -462,7 +462,7 @@ SCRIPT_IMPLEMENTATION_PATH="$SCRIPT_DIR/${hookRelativePath}/${filename}" if [[ -f "$SCRIPT_IMPLEMENTATION_PATH" ]]; then exec "$SCRIPT_IMPLEMENTATION_PATH" else - echo "The ${filename} Git hook does not exist in your version of the repo. Either remove the ${filename} hook file (e.g. '.git/hooks/${filename}') in case this feature is not used anymore in main branch. Otherwise, updating your branch to current mainstream will solve the issue." + echo "The ${filename} Git hook no longer exists in your version of the repo. Run 'rush install' or 'rush update' to refresh your installed Git hooks." fi `; // Create the hook file. Important: For Bash scripts, the EOL must not be CRLF. From 8a18dec0ca8c7b815f70e430fda6f3d8f0f9c030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=A0tekl?= Date: Thu, 12 Jan 2023 14:29:41 +0100 Subject: [PATCH 032/167] Redirect the warning message to stderr instead of stdout --- libraries/rush-lib/src/logic/base/BaseInstallManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/rush-lib/src/logic/base/BaseInstallManager.ts b/libraries/rush-lib/src/logic/base/BaseInstallManager.ts index 0f09638079f..da32cdc46d0 100644 --- a/libraries/rush-lib/src/logic/base/BaseInstallManager.ts +++ b/libraries/rush-lib/src/logic/base/BaseInstallManager.ts @@ -462,7 +462,7 @@ SCRIPT_IMPLEMENTATION_PATH="$SCRIPT_DIR/${hookRelativePath}/${filename}" if [[ -f "$SCRIPT_IMPLEMENTATION_PATH" ]]; then exec "$SCRIPT_IMPLEMENTATION_PATH" else - echo "The ${filename} Git hook no longer exists in your version of the repo. Run 'rush install' or 'rush update' to refresh your installed Git hooks." + echo "The ${filename} Git hook no longer exists in your version of the repo. Run 'rush install' or 'rush update' to refresh your installed Git hooks." >&2 fi `; // Create the hook file. Important: For Bash scripts, the EOL must not be CRLF. From f0410f062b3e2d49c39bb293c1eb8c462e3ea92e Mon Sep 17 00:00:00 2001 From: William Huang Date: Thu, 12 Jan 2023 09:48:19 -0800 Subject: [PATCH 033/167] chore: clean up typing in components --- .../src/components/Checkbox/index.tsx | 10 ++++------ .../rush-components/src/components/Input/index.tsx | 11 ++++------- .../src/components/ScrollArea/index.tsx | 7 ++++++- apps/rush-components/src/components/Tabs/index.tsx | 14 +++++--------- apps/rush-components/src/components/Text/index.tsx | 3 ++- 5 files changed, 21 insertions(+), 24 deletions(-) diff --git a/apps/rush-components/src/components/Checkbox/index.tsx b/apps/rush-components/src/components/Checkbox/index.tsx index 84e452f0374..1aac392cba2 100644 --- a/apps/rush-components/src/components/Checkbox/index.tsx +++ b/apps/rush-components/src/components/Checkbox/index.tsx @@ -3,15 +3,13 @@ import * as RadixCheckbox from '@radix-ui/react-checkbox'; import { CheckIcon } from '@radix-ui/react-icons'; import styles from './styles.scss'; -export const Checkbox = ({ - label, - isChecked, - onChecked -}: { +export interface ICheckboxProps { label: string; isChecked: boolean; onChecked: (checked: boolean) => void; -}): JSX.Element => ( +} + +export const Checkbox = ({ label, isChecked, onChecked }: ICheckboxProps): JSX.Element => (
) => void; type?: string; placeholder?: string; -}): JSX.Element => { +} + +export const Input = ({ value, placeholder, onChange, type = 'text' }: IInputProps): JSX.Element => { return ( ( +export interface IScrollAreaProps { + children: React.ReactNode; +} + +// Note: the height of the scroll area's parent must be fixed +export const ScrollArea = ({ children }: IScrollAreaProps): JSX.Element => ( {children} diff --git a/apps/rush-components/src/components/Tabs/index.tsx b/apps/rush-components/src/components/Tabs/index.tsx index ecd70b9a72f..1973d635610 100644 --- a/apps/rush-components/src/components/Tabs/index.tsx +++ b/apps/rush-components/src/components/Tabs/index.tsx @@ -2,26 +2,22 @@ import React from 'react'; import * as RadixTabs from '@radix-ui/react-tabs'; import styles from './styles.scss'; -interface ITabsItem { +export interface ITabsItem { header: string; value?: string | number; body?: React.ReactNode; } -export const Tabs = ({ - items, - def, - value, - onChange, - renderChildren -}: { +export interface ITabsProps { items: ITabsItem[]; def?: string; value?: string | number; // eslint-disable-next-line @typescript-eslint/no-explicit-any onChange?: (value: any) => void; renderChildren?: () => JSX.Element; -}): JSX.Element => { +} + +export const Tabs = ({ items, def, value, onChange, renderChildren }: ITabsProps): JSX.Element => { const getItemValue = (item: ITabsItem): string | number => item.value === undefined ? item.header : item.value; return ( diff --git a/apps/rush-components/src/components/Text/index.tsx b/apps/rush-components/src/components/Text/index.tsx index a45babcb996..a2f3f37a512 100644 --- a/apps/rush-components/src/components/Text/index.tsx +++ b/apps/rush-components/src/components/Text/index.tsx @@ -3,13 +3,14 @@ import styles from './styles.scss'; export type TextType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span'; -interface ITextProps { +export interface ITextProps { type: TextType; bold?: boolean; children: React.ReactNode; className?: string; size?: number; } + export const Text = ({ type, bold = false, children, className, size }: ITextProps): JSX.Element => { const generalStyles: { [key in string]: string | number } = { ['fontWeight']: bold ? 'bold' : 'normal', From cf5dc13fe345e967251115c06e0d57cf5a39870b Mon Sep 17 00:00:00 2001 From: William Huang Date: Thu, 12 Jan 2023 10:09:10 -0800 Subject: [PATCH 034/167] chore: update README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 988e395797c..907fc0a896f 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ These GitHub repositories provide supplementary resources for Rush Stack: | Folder | Description | | ------ | -----------| | [/apps/lockfile-explorer-web](./apps/lockfile-explorer-web/) | Rush Lockfile Explorer: helper project for building the React web application component | +| [/apps/rush-components](./apps/rush-components/) | Rush Component Library: a set of themed components for rush projects | | [/build-tests-samples/heft-node-basic-tutorial](./build-tests-samples/heft-node-basic-tutorial/) | (Copy of sample project) Building this project is a regression test for Heft | | [/build-tests-samples/heft-node-jest-tutorial](./build-tests-samples/heft-node-jest-tutorial/) | (Copy of sample project) Building this project is a regression test for Heft | | [/build-tests-samples/heft-node-rig-tutorial](./build-tests-samples/heft-node-rig-tutorial/) | (Copy of sample project) Building this project is a regression test for Heft | From 1252d7e32ee9049f1fd42aeaa07e32e232a8c538 Mon Sep 17 00:00:00 2001 From: William Huang Date: Thu, 12 Jan 2023 10:49:59 -0800 Subject: [PATCH 035/167] fix: pnpm file is now read correctly --- apps/lockfile-explorer/src/start.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/lockfile-explorer/src/start.ts b/apps/lockfile-explorer/src/start.ts index 4d7e325d888..2a4fcd61b36 100644 --- a/apps/lockfile-explorer/src/start.ts +++ b/apps/lockfile-explorer/src/start.ts @@ -98,9 +98,9 @@ app.post( ); app.get('/api/pnpmfile', async (req: express.Request, res: express.Response) => { - let pnpmLockfile: string; + let pnpmfile: string; try { - pnpmLockfile = await FileSystem.readFileAsync(appState.pnpmLockfileLocation); + pnpmfile = await FileSystem.readFileAsync(appState.pnpmfileLocation); } catch (e) { if (FileSystem.isNotExistError(e)) { return res.status(404).send({ @@ -112,7 +112,7 @@ app.get('/api/pnpmfile', async (req: express.Request, res: express.Response) => } } - res.send(pnpmLockfile); + res.send(pnpmfile); }); app.post( From 65a9c562b97b96719fa0d603678973e8daf31430 Mon Sep 17 00:00:00 2001 From: William Huang Date: Thu, 12 Jan 2023 10:50:43 -0800 Subject: [PATCH 036/167] chore: add change file --- ...-lockfile-explorer-components_2023-01-12-18-50.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@rushstack/lockfile-explorer/will-lockfile-explorer-components_2023-01-12-18-50.json diff --git a/common/changes/@rushstack/lockfile-explorer/will-lockfile-explorer-components_2023-01-12-18-50.json b/common/changes/@rushstack/lockfile-explorer/will-lockfile-explorer-components_2023-01-12-18-50.json new file mode 100644 index 00000000000..7bf2d546151 --- /dev/null +++ b/common/changes/@rushstack/lockfile-explorer/will-lockfile-explorer-components_2023-01-12-18-50.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/lockfile-explorer", + "comment": "Add support for rush components", + "type": "patch" + } + ], + "packageName": "@rushstack/lockfile-explorer" +} \ No newline at end of file From 3ee639b219c52aade7b43f5c72d452df512d25c8 Mon Sep 17 00:00:00 2001 From: William Huang Date: Thu, 12 Jan 2023 14:44:32 -0800 Subject: [PATCH 037/167] chore: remove office ui dependency --- apps/lockfile-explorer-web/package.json | 3 +-- common/config/rush/pnpm-lock.yaml | 6 ------ common/config/rush/repo-state.json | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/apps/lockfile-explorer-web/package.json b/apps/lockfile-explorer-web/package.json index 083e84cf130..24fa4692110 100644 --- a/apps/lockfile-explorer-web/package.json +++ b/apps/lockfile-explorer-web/package.json @@ -28,7 +28,6 @@ "@types/heft-jest": "1.0.1", "@types/react-dom": "16.9.14", "@types/react": "16.14.23", - "@types/webpack-env": "1.13.0", - "office-ui-fabric-core": "~11.0.1" + "@types/webpack-env": "1.13.0" } } diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 04fbaddd497..347f38d9b69 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -194,7 +194,6 @@ importers: '@types/react': 16.14.23 '@types/react-dom': 16.9.14 '@types/webpack-env': 1.13.0 - office-ui-fabric-core: ~11.0.1 react: ~16.13.1 react-dom: ~16.13.1 react-redux: ~8.0.4 @@ -216,7 +215,6 @@ importers: '@types/react': 16.14.23 '@types/react-dom': 16.9.14 '@types/webpack-env': 1.13.0 - office-ui-fabric-core: 11.0.1 ../../apps/rundown: specifiers: @@ -16528,10 +16526,6 @@ packages: /obuf/1.1.2: resolution: {integrity: sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==} - /office-ui-fabric-core/11.0.1: - resolution: {integrity: sha512-jcfycbVOm2aUoI+AGtHW24HvM7nUVFr44hR5NIE56EobK67bVwbNAQL15CJj3vNz5PBrnitsV9ROOB+KOEWn8g==} - dev: true - /on-finished/2.4.1: resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} engines: {node: '>= 0.8'} diff --git a/common/config/rush/repo-state.json b/common/config/rush/repo-state.json index fec1d2b4360..e17b4494b34 100644 --- a/common/config/rush/repo-state.json +++ b/common/config/rush/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "c0a0517f72a77533ef59a0226421b18cfb4c3738", + "pnpmShrinkwrapHash": "e855e70720fd11b2a139811470cd6e5221293693", "preferredVersionsHash": "5222ca779ae69ebfd201e39c17f48ce9eaf8c3c2" } From abb2a24a9d7a12f5739e82f260ea505cf1770fe4 Mon Sep 17 00:00:00 2001 From: William Huang Date: Thu, 12 Jan 2023 14:50:32 -0800 Subject: [PATCH 038/167] chore: add copyright --- .../src/containers/LockfileViewer/styles.scss | 2 -- .../src/containers/PackageJsonViewer/styles.scss | 1 - apps/rush-components/src/components/Button/index.tsx | 3 +++ apps/rush-components/src/components/Checkbox/index.tsx | 3 +++ apps/rush-components/src/components/Input/index.tsx | 3 +++ apps/rush-components/src/components/ScrollArea/index.tsx | 3 +++ apps/rush-components/src/components/Tabs/index.tsx | 3 +++ apps/rush-components/src/components/Text/index.tsx | 3 +++ apps/rush-components/src/start.ts | 3 +++ 9 files changed, 21 insertions(+), 3 deletions(-) diff --git a/apps/lockfile-explorer-web/src/containers/LockfileViewer/styles.scss b/apps/lockfile-explorer-web/src/containers/LockfileViewer/styles.scss index b8775d35c47..51321ffa193 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileViewer/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/LockfileViewer/styles.scss @@ -10,8 +10,6 @@ .ViewContents { display: flex; flex-direction: column; - min-height: calc(100% - 35px); - max-height: calc(100% - 35px); height: calc(100% - 35px); & > * + * { margin-top: 12px; diff --git a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/styles.scss b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/styles.scss index 9936a81c208..817b9052ce8 100644 --- a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/styles.scss @@ -9,7 +9,6 @@ .FileContents { height: calc(100% - 46px); padding: 0 12px; - overflow: hidden; } @mixin SpecWrapper { diff --git a/apps/rush-components/src/components/Button/index.tsx b/apps/rush-components/src/components/Button/index.tsx index 9d987e4f6ca..4561664fa67 100644 --- a/apps/rush-components/src/components/Button/index.tsx +++ b/apps/rush-components/src/components/Button/index.tsx @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + import React from 'react'; import { Text } from '../Text'; import styles from './styles.scss'; diff --git a/apps/rush-components/src/components/Checkbox/index.tsx b/apps/rush-components/src/components/Checkbox/index.tsx index 1aac392cba2..021378e0d71 100644 --- a/apps/rush-components/src/components/Checkbox/index.tsx +++ b/apps/rush-components/src/components/Checkbox/index.tsx @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + import React from 'react'; import * as RadixCheckbox from '@radix-ui/react-checkbox'; import { CheckIcon } from '@radix-ui/react-icons'; diff --git a/apps/rush-components/src/components/Input/index.tsx b/apps/rush-components/src/components/Input/index.tsx index 981e4c4a04f..47c56069053 100644 --- a/apps/rush-components/src/components/Input/index.tsx +++ b/apps/rush-components/src/components/Input/index.tsx @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + import React from 'react'; import styles from './styles.scss'; diff --git a/apps/rush-components/src/components/ScrollArea/index.tsx b/apps/rush-components/src/components/ScrollArea/index.tsx index 8fd754cb449..4aef5767ce5 100644 --- a/apps/rush-components/src/components/ScrollArea/index.tsx +++ b/apps/rush-components/src/components/ScrollArea/index.tsx @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + import React from 'react'; import * as RadixScrollArea from '@radix-ui/react-scroll-area'; import styles from './styles.scss'; diff --git a/apps/rush-components/src/components/Tabs/index.tsx b/apps/rush-components/src/components/Tabs/index.tsx index 1973d635610..0c956236b7f 100644 --- a/apps/rush-components/src/components/Tabs/index.tsx +++ b/apps/rush-components/src/components/Tabs/index.tsx @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + import React from 'react'; import * as RadixTabs from '@radix-ui/react-tabs'; import styles from './styles.scss'; diff --git a/apps/rush-components/src/components/Text/index.tsx b/apps/rush-components/src/components/Text/index.tsx index a2f3f37a512..5dbd7991572 100644 --- a/apps/rush-components/src/components/Text/index.tsx +++ b/apps/rush-components/src/components/Text/index.tsx @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + import React from 'react'; import styles from './styles.scss'; diff --git a/apps/rush-components/src/start.ts b/apps/rush-components/src/start.ts index b5fda3a0476..d0e9617ac72 100644 --- a/apps/rush-components/src/start.ts +++ b/apps/rush-components/src/start.ts @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + export * from './components/Button'; export * from './components/ScrollArea'; export * from './components/Tabs'; From 0a2061c72ad8b9a33a1ab88b8078cd7ea9bf76d3 Mon Sep 17 00:00:00 2001 From: William Huang Date: Thu, 12 Jan 2023 14:58:47 -0800 Subject: [PATCH 039/167] chore: update rush component readme --- apps/rush-components/README.md | 84 ++-------------------------------- 1 file changed, 3 insertions(+), 81 deletions(-) diff --git a/apps/rush-components/README.md b/apps/rush-components/README.md index 1643d5bdd27..f67430bd265 100644 --- a/apps/rush-components/README.md +++ b/apps/rush-components/README.md @@ -1,83 +1,5 @@ -# @rushstack/lockfile-explorer +# @rushstack/components -
-
- - Rush Lockfile Explorer - -

-

+**Rush Components** provides a suite of styled components that can be used in rush applications to ensure a consistent look and feel among all rushstack helper applications. -> 🚨 *EARLY PREVIEW RELEASE* 🚨 -> -> Please provide feedback by commenting on -> the [Design Proposal](https://github.com/microsoft/rushstack/issues/3695) -> or creating a GitHub issue. Thanks! - -**Rush Lockfile Explorer** helps you investigate and solve version conflicts when working -in a [Rush](https://rushjs.io) monorepo using the [PNPM package manager](https://pnpm.io/). - -Typical use cases: - -- After `rush update`, the app is reporting errors caused by duplicate instances of - a singleton object, probably introduced by a - [peer dependency doppelganger](https://rushjs.io/pages/advanced/npm_doppelgangers/) - -- how to find the likely culprits? - -- After `rush update`, the app's bundle size has increased significantly due to - side-by-side versions -- how to find which packages have extra versions? - -- When you identify the problematic package, it is an obscure indirect dependency of - your middleware -- how to work backwards in the dependency graph to determine which - **package.json** files should be patched in **.pnpmfile.cjs**? - -- Your project's installation footprint is unusually large because it has picked up - a lot of extra NPM dependencies that seem unnecessary, however `rush-pnpm why` prints - thousands of lines of output. How to filter this report to see the important - relationships? - - -## Usage - -```bash -# Install the NPM package globally: -npm install -g @rushstack/lockfile-explorer - -# Go to your monorepo folder -cd my-rush-repo - -# Run "rush install" to ensure common/temp/node_modules is up to date -rush install - -# Launch the Lockfile Explorer command line interface (CLI). -# It expects to find a Rush workspace in your shell's current working directory. -lockfile-explorer -``` - -The CLI will start a Node.js service on `http://localhost/` and try to launch your default web browser: - -screenshot
-*Lockfile Explorer main window* - - -## How it works - -The web app will expect to find a Rush workspace in the current working directory where the `lockfile-explorer` -command was invoked. It will read files such as: - -- **common/config/rush/pnpm-lock.yaml** - the PNPM lockfile for your monorepo -- **common/config/rush/.pnpmfile.cjs** - which transforms **package.json** files during installation -- The **package.json** files for your Rush projects -- The **package.json** files for packages installed under - - -## Links - -- [Documentation](https://lfx.rushstack.io/) on the Lockfile Explorer project website -- [CHANGELOG.md]( - https://github.com/microsoft/rushstack/blob/main/apps/lockfile-explorer/CHANGELOG.md) - Find - out what's new in the latest version -- [@rushstack/trace-import](https://www.npmjs.com/package/@rushstack/trace-import) - - a command-line tool for troubleshooting how modules are resolved by `import` and `require()` - -Rush Lockfile Explorer is part of the [Rush Stack](https://rushstack.io/) family of projects. +Rush Components is part of the [Rush Stack](https://rushstack.io/) family of projects. From 0ef4d0ce4862b2b932f6e21eba8af60257a05068 Mon Sep 17 00:00:00 2001 From: William Huang Date: Thu, 12 Jan 2023 15:01:51 -0800 Subject: [PATCH 040/167] feat: move rushstack components to libraries --- .../src/components/ConnectionModal/index.tsx | 2 +- .../src/containers/BookmarksSidebar/index.tsx | 2 +- .../LockfileEntryDetailsView/index.tsx | 2 +- .../src/containers/LockfileViewer/index.tsx | 2 +- .../containers/PackageJsonViewer/index.tsx | 2 +- .../containers/SelectedEntryPreview/index.tsx | 2 +- common/config/rush/pnpm-lock.yaml | 68 +++++++++---------- .../rush-components/.eslintrc.js | 0 .../rush-components/.npmignore | 0 {apps => libraries}/rush-components/LICENSE | 0 {apps => libraries}/rush-components/README.md | 0 .../rush-components/assets/index.html | 0 .../rush-components/config/heft.json | 0 .../rush-components/config/jest.config.json | 0 .../rush-components/config/rig.json | 0 .../rush-components/package.json | 0 .../src/components/Button/index.tsx | 0 .../src/components/Button/styles.scss | 0 .../src/components/Checkbox/index.tsx | 0 .../src/components/Checkbox/styles.scss | 0 .../src/components/Input/index.tsx | 0 .../src/components/Input/styles.scss | 0 .../src/components/ScrollArea/index.tsx | 0 .../src/components/ScrollArea/styles.scss | 0 .../src/components/Tabs/index.tsx | 0 .../src/components/Tabs/styles.scss | 0 .../src/components/Text/index.tsx | 0 .../src/components/Text/styles.scss | 0 .../rush-components/src/start.ts | 0 .../rush-components/src/styles/_base.scss | 0 .../rush-components/src/styles/_colors.scss | 0 .../rush-components/tsconfig.json | 0 .../rush-components/tsconfig.type.json | 0 .../rush-components/webpack.config.js | 0 rush.json | 2 +- 35 files changed, 41 insertions(+), 41 deletions(-) rename {apps => libraries}/rush-components/.eslintrc.js (100%) rename {apps => libraries}/rush-components/.npmignore (100%) rename {apps => libraries}/rush-components/LICENSE (100%) rename {apps => libraries}/rush-components/README.md (100%) rename {apps => libraries}/rush-components/assets/index.html (100%) rename {apps => libraries}/rush-components/config/heft.json (100%) rename {apps => libraries}/rush-components/config/jest.config.json (100%) rename {apps => libraries}/rush-components/config/rig.json (100%) rename {apps => libraries}/rush-components/package.json (100%) rename {apps => libraries}/rush-components/src/components/Button/index.tsx (100%) rename {apps => libraries}/rush-components/src/components/Button/styles.scss (100%) rename {apps => libraries}/rush-components/src/components/Checkbox/index.tsx (100%) rename {apps => libraries}/rush-components/src/components/Checkbox/styles.scss (100%) rename {apps => libraries}/rush-components/src/components/Input/index.tsx (100%) rename {apps => libraries}/rush-components/src/components/Input/styles.scss (100%) rename {apps => libraries}/rush-components/src/components/ScrollArea/index.tsx (100%) rename {apps => libraries}/rush-components/src/components/ScrollArea/styles.scss (100%) rename {apps => libraries}/rush-components/src/components/Tabs/index.tsx (100%) rename {apps => libraries}/rush-components/src/components/Tabs/styles.scss (100%) rename {apps => libraries}/rush-components/src/components/Text/index.tsx (100%) rename {apps => libraries}/rush-components/src/components/Text/styles.scss (100%) rename {apps => libraries}/rush-components/src/start.ts (100%) rename {apps => libraries}/rush-components/src/styles/_base.scss (100%) rename {apps => libraries}/rush-components/src/styles/_colors.scss (100%) rename {apps => libraries}/rush-components/tsconfig.json (100%) rename {apps => libraries}/rush-components/tsconfig.type.json (100%) rename {apps => libraries}/rush-components/webpack.config.js (100%) diff --git a/apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx b/apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx index 661cbb9af03..36c606b624b 100644 --- a/apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx +++ b/apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import React, { useCallback, useEffect, useState } from 'react'; -import { Button, Text } from '@rushstack/components'; +import { Button, Text } from '../../../../../libraries/rush-components/lib/start'; import styles from './styles.scss'; import appStyles from '../../App.scss'; import { checkAliveAsync } from '../../parsing/getPackageFiles'; diff --git a/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx b/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx index 749b084ba9e..66e490682b3 100644 --- a/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx @@ -7,7 +7,7 @@ import styles from './styles.scss'; import { useAppDispatch, useAppSelector } from '../../store/hooks'; import { LockfileEntry } from '../../parsing/LockfileEntry'; import { clearStackAndPush, removeBookmark } from '../../store/slices/entrySlice'; -import { Button, ScrollArea, Text } from '@rushstack/components'; +import { Button, ScrollArea, Text } from '../../../../../libraries/rush-components/lib/start'; export const BookmarksSidebar = (): JSX.Element => { const bookmarks = useAppSelector((state) => state.entry.bookmarkedEntries); diff --git a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx index 913e906b5b0..9b8659eec94 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import React, { useCallback, useEffect, useState } from 'react'; -import { ScrollArea, Text } from '@rushstack/components'; +import { ScrollArea, Text } from '../../../../../libraries/rush-components/lib/start'; import styles from './styles.scss'; import appStyles from '../../App.scss'; import { IDependencyType, LockfileDependency } from '../../parsing/LockfileDependency'; diff --git a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx index 7c233021956..8ed9f415311 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx @@ -13,7 +13,7 @@ import { setFilter as selectFilter } from '../../store/slices/entrySlice'; import { getFilterFromLocalStorage, saveFilterToLocalStorage } from '../../helpers/localStorage'; -import { Tabs, Checkbox, ScrollArea, Input, Text } from '@rushstack/components'; +import { Tabs, Checkbox, ScrollArea, Input, Text } from '../../../../../libraries/rush-components/lib/start'; interface ILockfileEntryGroup { entryName: string; diff --git a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx index fe479515110..f0500159f75 100644 --- a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx @@ -11,7 +11,7 @@ import { compareSpec } from '../../parsing/compareSpec'; import { loadSpecChanges } from '../../store/slices/workspaceSlice'; import { displaySpecChanges } from '../../helpers/displaySpecChanges'; import { isEntryModified } from '../../helpers/isEntryModified'; -import { ScrollArea, Tabs, Text } from '@rushstack/components'; +import { ScrollArea, Tabs, Text } from '../../../../../libraries/rush-components/lib/start'; enum PackageView { PACKAGE_JSON, diff --git a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx index c429f13d3f1..4321b4ba447 100644 --- a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx @@ -11,7 +11,7 @@ import { removeBookmark, selectCurrentEntry } from '../../store/slices/entrySlice'; -import { Button, ScrollArea, Text } from '@rushstack/components'; +import { Button, ScrollArea, Text } from '../../../../../libraries/rush-components/lib/start'; export const SelectedEntryPreview = (): JSX.Element => { const selectedEntry = useAppSelector(selectCurrentEntry); diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 347f38d9b69..b1a070c44d2 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -202,7 +202,7 @@ importers: '@fluentui/react': 8.103.6_tlqvpdqnq63ssdllbmshthdmo4 '@lifaon/path': 2.1.0 '@reduxjs/toolkit': 1.8.6_qfynotfwlyrsyq662adyrweaoe - '@rushstack/components': link:../rush-components + '@rushstack/components': link:../../libraries/rush-components react: 16.13.1 react-dom: 16.13.1_react@16.13.1 react-redux: 8.0.5_6ue7j6tfp4xzdzadarjwzo6kwu @@ -266,39 +266,6 @@ importers: '@types/node': 12.20.24 '@types/semver': 7.3.5 - ../../apps/rush-components: - specifiers: - '@radix-ui/colors': ~0.1.8 - '@radix-ui/react-checkbox': ~1.0.1 - '@radix-ui/react-icons': ~1.1.1 - '@radix-ui/react-scroll-area': ~1.0.2 - '@radix-ui/react-tabs': ~1.0.1 - '@rushstack/eslint-config': workspace:* - '@rushstack/heft': workspace:* - '@rushstack/heft-web-rig': workspace:* - '@types/heft-jest': 1.0.1 - '@types/react': 16.14.23 - '@types/react-dom': 16.9.14 - '@types/webpack-env': 1.13.0 - react: ~16.13.1 - react-dom: ~16.13.1 - dependencies: - react: 16.13.1 - react-dom: 16.13.1_react@16.13.1 - devDependencies: - '@radix-ui/colors': 0.1.8 - '@radix-ui/react-checkbox': 1.0.1_5owmthsvj5ictknaj3ev736ofq - '@radix-ui/react-icons': 1.1.1_react@16.13.1 - '@radix-ui/react-scroll-area': 1.0.2_5owmthsvj5ictknaj3ev736ofq - '@radix-ui/react-tabs': 1.0.1_5owmthsvj5ictknaj3ev736ofq - '@rushstack/eslint-config': link:../../eslint/eslint-config - '@rushstack/heft': link:../heft - '@rushstack/heft-web-rig': link:../../rigs/heft-web-rig - '@types/heft-jest': 1.0.1 - '@types/react': 16.14.23 - '@types/react-dom': 16.9.14 - '@types/webpack-env': 1.13.0 - ../../apps/trace-import: specifiers: '@rushstack/eslint-config': workspace:* @@ -1905,6 +1872,39 @@ importers: '@types/resolve': 1.20.2 ajv: 6.12.6 + ../../libraries/rush-components: + specifiers: + '@radix-ui/colors': ~0.1.8 + '@radix-ui/react-checkbox': ~1.0.1 + '@radix-ui/react-icons': ~1.1.1 + '@radix-ui/react-scroll-area': ~1.0.2 + '@radix-ui/react-tabs': ~1.0.1 + '@rushstack/eslint-config': workspace:* + '@rushstack/heft': workspace:* + '@rushstack/heft-web-rig': workspace:* + '@types/heft-jest': 1.0.1 + '@types/react': 16.14.23 + '@types/react-dom': 16.9.14 + '@types/webpack-env': 1.13.0 + react: ~16.13.1 + react-dom: ~16.13.1 + dependencies: + react: 16.13.1 + react-dom: 16.13.1_react@16.13.1 + devDependencies: + '@radix-ui/colors': 0.1.8 + '@radix-ui/react-checkbox': 1.0.1_5owmthsvj5ictknaj3ev736ofq + '@radix-ui/react-icons': 1.1.1_react@16.13.1 + '@radix-ui/react-scroll-area': 1.0.2_5owmthsvj5ictknaj3ev736ofq + '@radix-ui/react-tabs': 1.0.1_5owmthsvj5ictknaj3ev736ofq + '@rushstack/eslint-config': link:../../eslint/eslint-config + '@rushstack/heft': link:../../apps/heft + '@rushstack/heft-web-rig': link:../../rigs/heft-web-rig + '@types/heft-jest': 1.0.1 + '@types/react': 16.14.23 + '@types/react-dom': 16.9.14 + '@types/webpack-env': 1.13.0 + ../../libraries/rush-lib: specifiers: '@pnpm/link-bins': ~5.3.7 diff --git a/apps/rush-components/.eslintrc.js b/libraries/rush-components/.eslintrc.js similarity index 100% rename from apps/rush-components/.eslintrc.js rename to libraries/rush-components/.eslintrc.js diff --git a/apps/rush-components/.npmignore b/libraries/rush-components/.npmignore similarity index 100% rename from apps/rush-components/.npmignore rename to libraries/rush-components/.npmignore diff --git a/apps/rush-components/LICENSE b/libraries/rush-components/LICENSE similarity index 100% rename from apps/rush-components/LICENSE rename to libraries/rush-components/LICENSE diff --git a/apps/rush-components/README.md b/libraries/rush-components/README.md similarity index 100% rename from apps/rush-components/README.md rename to libraries/rush-components/README.md diff --git a/apps/rush-components/assets/index.html b/libraries/rush-components/assets/index.html similarity index 100% rename from apps/rush-components/assets/index.html rename to libraries/rush-components/assets/index.html diff --git a/apps/rush-components/config/heft.json b/libraries/rush-components/config/heft.json similarity index 100% rename from apps/rush-components/config/heft.json rename to libraries/rush-components/config/heft.json diff --git a/apps/rush-components/config/jest.config.json b/libraries/rush-components/config/jest.config.json similarity index 100% rename from apps/rush-components/config/jest.config.json rename to libraries/rush-components/config/jest.config.json diff --git a/apps/rush-components/config/rig.json b/libraries/rush-components/config/rig.json similarity index 100% rename from apps/rush-components/config/rig.json rename to libraries/rush-components/config/rig.json diff --git a/apps/rush-components/package.json b/libraries/rush-components/package.json similarity index 100% rename from apps/rush-components/package.json rename to libraries/rush-components/package.json diff --git a/apps/rush-components/src/components/Button/index.tsx b/libraries/rush-components/src/components/Button/index.tsx similarity index 100% rename from apps/rush-components/src/components/Button/index.tsx rename to libraries/rush-components/src/components/Button/index.tsx diff --git a/apps/rush-components/src/components/Button/styles.scss b/libraries/rush-components/src/components/Button/styles.scss similarity index 100% rename from apps/rush-components/src/components/Button/styles.scss rename to libraries/rush-components/src/components/Button/styles.scss diff --git a/apps/rush-components/src/components/Checkbox/index.tsx b/libraries/rush-components/src/components/Checkbox/index.tsx similarity index 100% rename from apps/rush-components/src/components/Checkbox/index.tsx rename to libraries/rush-components/src/components/Checkbox/index.tsx diff --git a/apps/rush-components/src/components/Checkbox/styles.scss b/libraries/rush-components/src/components/Checkbox/styles.scss similarity index 100% rename from apps/rush-components/src/components/Checkbox/styles.scss rename to libraries/rush-components/src/components/Checkbox/styles.scss diff --git a/apps/rush-components/src/components/Input/index.tsx b/libraries/rush-components/src/components/Input/index.tsx similarity index 100% rename from apps/rush-components/src/components/Input/index.tsx rename to libraries/rush-components/src/components/Input/index.tsx diff --git a/apps/rush-components/src/components/Input/styles.scss b/libraries/rush-components/src/components/Input/styles.scss similarity index 100% rename from apps/rush-components/src/components/Input/styles.scss rename to libraries/rush-components/src/components/Input/styles.scss diff --git a/apps/rush-components/src/components/ScrollArea/index.tsx b/libraries/rush-components/src/components/ScrollArea/index.tsx similarity index 100% rename from apps/rush-components/src/components/ScrollArea/index.tsx rename to libraries/rush-components/src/components/ScrollArea/index.tsx diff --git a/apps/rush-components/src/components/ScrollArea/styles.scss b/libraries/rush-components/src/components/ScrollArea/styles.scss similarity index 100% rename from apps/rush-components/src/components/ScrollArea/styles.scss rename to libraries/rush-components/src/components/ScrollArea/styles.scss diff --git a/apps/rush-components/src/components/Tabs/index.tsx b/libraries/rush-components/src/components/Tabs/index.tsx similarity index 100% rename from apps/rush-components/src/components/Tabs/index.tsx rename to libraries/rush-components/src/components/Tabs/index.tsx diff --git a/apps/rush-components/src/components/Tabs/styles.scss b/libraries/rush-components/src/components/Tabs/styles.scss similarity index 100% rename from apps/rush-components/src/components/Tabs/styles.scss rename to libraries/rush-components/src/components/Tabs/styles.scss diff --git a/apps/rush-components/src/components/Text/index.tsx b/libraries/rush-components/src/components/Text/index.tsx similarity index 100% rename from apps/rush-components/src/components/Text/index.tsx rename to libraries/rush-components/src/components/Text/index.tsx diff --git a/apps/rush-components/src/components/Text/styles.scss b/libraries/rush-components/src/components/Text/styles.scss similarity index 100% rename from apps/rush-components/src/components/Text/styles.scss rename to libraries/rush-components/src/components/Text/styles.scss diff --git a/apps/rush-components/src/start.ts b/libraries/rush-components/src/start.ts similarity index 100% rename from apps/rush-components/src/start.ts rename to libraries/rush-components/src/start.ts diff --git a/apps/rush-components/src/styles/_base.scss b/libraries/rush-components/src/styles/_base.scss similarity index 100% rename from apps/rush-components/src/styles/_base.scss rename to libraries/rush-components/src/styles/_base.scss diff --git a/apps/rush-components/src/styles/_colors.scss b/libraries/rush-components/src/styles/_colors.scss similarity index 100% rename from apps/rush-components/src/styles/_colors.scss rename to libraries/rush-components/src/styles/_colors.scss diff --git a/apps/rush-components/tsconfig.json b/libraries/rush-components/tsconfig.json similarity index 100% rename from apps/rush-components/tsconfig.json rename to libraries/rush-components/tsconfig.json diff --git a/apps/rush-components/tsconfig.type.json b/libraries/rush-components/tsconfig.type.json similarity index 100% rename from apps/rush-components/tsconfig.type.json rename to libraries/rush-components/tsconfig.type.json diff --git a/apps/rush-components/webpack.config.js b/libraries/rush-components/webpack.config.js similarity index 100% rename from apps/rush-components/webpack.config.js rename to libraries/rush-components/webpack.config.js diff --git a/rush.json b/rush.json index 490f81bd126..56c6fe5bec2 100644 --- a/rush.json +++ b/rush.json @@ -432,7 +432,7 @@ }, { "packageName": "@rushstack/components", - "projectFolder": "apps/rush-components", + "projectFolder": "libraries/rush-components", "reviewCategory": "libraries" }, { From 7127185a5ab463353fea1618b3a321329461dbca Mon Sep 17 00:00:00 2001 From: William Huang Date: Thu, 12 Jan 2023 15:04:03 -0800 Subject: [PATCH 041/167] chore: fix imports --- .../src/components/ConnectionModal/index.tsx | 2 +- .../src/containers/BookmarksSidebar/index.tsx | 2 +- .../src/containers/LockfileEntryDetailsView/index.tsx | 2 +- .../src/containers/LockfileViewer/index.tsx | 2 +- .../src/containers/PackageJsonViewer/index.tsx | 2 +- .../src/containers/SelectedEntryPreview/index.tsx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx b/apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx index 36c606b624b..661cbb9af03 100644 --- a/apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx +++ b/apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import React, { useCallback, useEffect, useState } from 'react'; -import { Button, Text } from '../../../../../libraries/rush-components/lib/start'; +import { Button, Text } from '@rushstack/components'; import styles from './styles.scss'; import appStyles from '../../App.scss'; import { checkAliveAsync } from '../../parsing/getPackageFiles'; diff --git a/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx b/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx index 66e490682b3..749b084ba9e 100644 --- a/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx @@ -7,7 +7,7 @@ import styles from './styles.scss'; import { useAppDispatch, useAppSelector } from '../../store/hooks'; import { LockfileEntry } from '../../parsing/LockfileEntry'; import { clearStackAndPush, removeBookmark } from '../../store/slices/entrySlice'; -import { Button, ScrollArea, Text } from '../../../../../libraries/rush-components/lib/start'; +import { Button, ScrollArea, Text } from '@rushstack/components'; export const BookmarksSidebar = (): JSX.Element => { const bookmarks = useAppSelector((state) => state.entry.bookmarkedEntries); diff --git a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx index 9b8659eec94..913e906b5b0 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import React, { useCallback, useEffect, useState } from 'react'; -import { ScrollArea, Text } from '../../../../../libraries/rush-components/lib/start'; +import { ScrollArea, Text } from '@rushstack/components'; import styles from './styles.scss'; import appStyles from '../../App.scss'; import { IDependencyType, LockfileDependency } from '../../parsing/LockfileDependency'; diff --git a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx index 8ed9f415311..7c233021956 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx @@ -13,7 +13,7 @@ import { setFilter as selectFilter } from '../../store/slices/entrySlice'; import { getFilterFromLocalStorage, saveFilterToLocalStorage } from '../../helpers/localStorage'; -import { Tabs, Checkbox, ScrollArea, Input, Text } from '../../../../../libraries/rush-components/lib/start'; +import { Tabs, Checkbox, ScrollArea, Input, Text } from '@rushstack/components'; interface ILockfileEntryGroup { entryName: string; diff --git a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx index f0500159f75..fe479515110 100644 --- a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx @@ -11,7 +11,7 @@ import { compareSpec } from '../../parsing/compareSpec'; import { loadSpecChanges } from '../../store/slices/workspaceSlice'; import { displaySpecChanges } from '../../helpers/displaySpecChanges'; import { isEntryModified } from '../../helpers/isEntryModified'; -import { ScrollArea, Tabs, Text } from '../../../../../libraries/rush-components/lib/start'; +import { ScrollArea, Tabs, Text } from '@rushstack/components'; enum PackageView { PACKAGE_JSON, diff --git a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx index 4321b4ba447..c429f13d3f1 100644 --- a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx @@ -11,7 +11,7 @@ import { removeBookmark, selectCurrentEntry } from '../../store/slices/entrySlice'; -import { Button, ScrollArea, Text } from '../../../../../libraries/rush-components/lib/start'; +import { Button, ScrollArea, Text } from '@rushstack/components'; export const SelectedEntryPreview = (): JSX.Element => { const selectedEntry = useAppSelector(selectCurrentEntry); From 68a1188555f23bde42e8b9931be601ba933d8af7 Mon Sep 17 00:00:00 2001 From: William Huang Date: Thu, 12 Jan 2023 15:06:01 -0800 Subject: [PATCH 042/167] chore: update rush components license --- libraries/rush-components/LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/rush-components/LICENSE b/libraries/rush-components/LICENSE index e6b6c3080e6..52b5a97c6ff 100644 --- a/libraries/rush-components/LICENSE +++ b/libraries/rush-components/LICENSE @@ -1,4 +1,4 @@ -@rushstack/lockfile-explorer +@rushstack/components Copyright (c) Microsoft Corporation. All rights reserved. From 11eaa7b14bf9b225d78dc4489a54c65a82306504 Mon Sep 17 00:00:00 2001 From: William Huang Date: Thu, 12 Jan 2023 15:24:07 -0800 Subject: [PATCH 043/167] chore: update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 907fc0a896f..2970f83e81f 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,6 @@ These GitHub repositories provide supplementary resources for Rush Stack: | Folder | Description | | ------ | -----------| | [/apps/lockfile-explorer-web](./apps/lockfile-explorer-web/) | Rush Lockfile Explorer: helper project for building the React web application component | -| [/apps/rush-components](./apps/rush-components/) | Rush Component Library: a set of themed components for rush projects | | [/build-tests-samples/heft-node-basic-tutorial](./build-tests-samples/heft-node-basic-tutorial/) | (Copy of sample project) Building this project is a regression test for Heft | | [/build-tests-samples/heft-node-jest-tutorial](./build-tests-samples/heft-node-jest-tutorial/) | (Copy of sample project) Building this project is a regression test for Heft | | [/build-tests-samples/heft-node-rig-tutorial](./build-tests-samples/heft-node-rig-tutorial/) | (Copy of sample project) Building this project is a regression test for Heft | @@ -153,6 +152,7 @@ These GitHub repositories provide supplementary resources for Rush Stack: | [/build-tests/rush-project-change-analyzer-test](./build-tests/rush-project-change-analyzer-test/) | This is an example project that uses rush-lib's ProjectChangeAnalyzer to | | [/build-tests/set-webpack-public-path-plugin-webpack4-test](./build-tests/set-webpack-public-path-plugin-webpack4-test/) | Building this project tests the set-webpack-public-path-plugin using Webpack 4 | | [/build-tests/ts-command-line-test](./build-tests/ts-command-line-test/) | Building this project is a regression test for ts-command-line | +| [/libraries/rush-components](./libraries/rush-components/) | Rush Component Library: a set of themed components for rush projects | | [/libraries/rushell](./libraries/rushell/) | Execute shell commands using a consistent syntax on every platform | | [/repo-scripts/doc-plugin-rush-stack](./repo-scripts/doc-plugin-rush-stack/) | API Documenter plugin used with the rushstack.io website | | [/repo-scripts/generate-api-docs](./repo-scripts/generate-api-docs/) | Used to generate API docs for the rushstack.io website | From b5a64af661b4f9e8f1f1755d05dc91efbbe865fe Mon Sep 17 00:00:00 2001 From: William Huang Date: Fri, 13 Jan 2023 12:16:39 -0800 Subject: [PATCH 044/167] chore: minor style tweaks --- .../src/containers/LockfileEntryDetailsView/index.tsx | 4 ++-- .../src/containers/PackageJsonViewer/index.tsx | 4 +++- .../src/containers/PackageJsonViewer/styles.scss | 4 ++++ .../src/containers/SelectedEntryPreview/styles.scss | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx index 913e906b5b0..ea82093d4e6 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx @@ -245,7 +245,7 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => { <>
- + Direct Referrers
@@ -268,7 +268,7 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => {
- + Direct Dependencies
diff --git a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx index fe479515110..db4e94949a1 100644 --- a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx @@ -256,7 +256,9 @@ export const PackageJsonViewer = (): JSX.Element => { />
- {renderFile()} + +
{renderFile()}
+
); diff --git a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/styles.scss b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/styles.scss index 817b9052ce8..a684d302d98 100644 --- a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/styles.scss @@ -11,6 +11,10 @@ padding: 0 12px; } +.FileInnerContent { + padding-top: 12px; +} + @mixin SpecWrapper { padding: 2px 4px; border-radius: 2px; diff --git a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/styles.scss b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/styles.scss index 7a605fc4d94..8811d0bc86f 100644 --- a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/styles.scss @@ -3,7 +3,7 @@ .SelectedEntryCard { margin-top: 12px; @include base.card; - padding: 12px; + padding: 12px 12px 0; height: 8%; & > * + * { margin-top: 8px; From 4f15a3ce70f2925be93790e3aa2822a832d96bb5 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Mon, 16 Jan 2023 14:38:44 -0800 Subject: [PATCH 045/167] Use ts.getCheckFlags to fix TS 5.0 --- apps/api-extractor/src/analyzer/TypeScriptInternals.ts | 2 +- .../api-extractor/check-flags_2023-01-16-22-41.json | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 common/changes/@microsoft/api-extractor/check-flags_2023-01-16-22-41.json diff --git a/apps/api-extractor/src/analyzer/TypeScriptInternals.ts b/apps/api-extractor/src/analyzer/TypeScriptInternals.ts index 32ab70795bd..e8b74f8844a 100644 --- a/apps/api-extractor/src/analyzer/TypeScriptInternals.ts +++ b/apps/api-extractor/src/analyzer/TypeScriptInternals.ts @@ -48,7 +48,7 @@ export class TypeScriptInternals { if ( // eslint-disable-next-line no-bitwise symbol.flags & ts.SymbolFlags.Transient && - (symbol as any).checkFlags === (ts as any).CheckFlags.Late + (ts as any).getCheckFlags(symbol) === (ts as any).CheckFlags.Late ) { return true; } diff --git a/common/changes/@microsoft/api-extractor/check-flags_2023-01-16-22-41.json b/common/changes/@microsoft/api-extractor/check-flags_2023-01-16-22-41.json new file mode 100644 index 00000000000..917484fe346 --- /dev/null +++ b/common/changes/@microsoft/api-extractor/check-flags_2023-01-16-22-41.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/api-extractor", + "comment": "Use ts.getCheckFlags to fix TS 5.0", + "type": "patch" + } + ], + "packageName": "@microsoft/api-extractor" +} \ No newline at end of file From ab588c5c6e77ba4ca76e4d83d951c6d76fffc6f8 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Wed, 18 Jan 2023 11:27:58 -0800 Subject: [PATCH 046/167] Update JSZip to 3.8.0. --- .../@microsoft/rush/update-jszip_2023-01-18-19-27.json | 10 ++++++++++ common/config/rush/pnpm-lock.yaml | 8 ++++---- common/config/rush/repo-state.json | 2 +- libraries/rush-lib/package.json | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 common/changes/@microsoft/rush/update-jszip_2023-01-18-19-27.json diff --git a/common/changes/@microsoft/rush/update-jszip_2023-01-18-19-27.json b/common/changes/@microsoft/rush/update-jszip_2023-01-18-19-27.json new file mode 100644 index 00000000000..19345bfc2d7 --- /dev/null +++ b/common/changes/@microsoft/rush/update-jszip_2023-01-18-19-27.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Update JSZip to 3.8.0.", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index e080e050100..0cf2d5d6cc9 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1922,7 +1922,7 @@ importers: ignore: ~5.1.6 inquirer: ~7.3.3 js-yaml: ~3.13.1 - jszip: ~3.7.1 + jszip: ~3.8.0 lodash: ~4.17.15 node-fetch: 2.6.7 npm-check: ~6.0.1 @@ -1960,7 +1960,7 @@ importers: ignore: 5.1.9 inquirer: 7.3.3 js-yaml: 3.13.1 - jszip: 3.7.1 + jszip: 3.8.0 lodash: 4.17.21 node-fetch: 2.6.7 npm-check: 6.0.1 @@ -15077,8 +15077,8 @@ packages: pako: 1.0.11 dev: true - /jszip/3.7.1: - resolution: {integrity: sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg==} + /jszip/3.8.0: + resolution: {integrity: sha512-cnpQrXvFSLdsR9KR5/x7zdf6c3m8IhZfZzSblFEHSqBaVwD2nvJ4CuCKLyvKvwBgZm08CgfSoiTBQLm5WW9hGw==} dependencies: lie: 3.3.0 pako: 1.0.11 diff --git a/common/config/rush/repo-state.json b/common/config/rush/repo-state.json index 39d9fca00be..530ff0fc82f 100644 --- a/common/config/rush/repo-state.json +++ b/common/config/rush/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "2de3fb9632c9527e29f02298c4020efa6926157e", + "pnpmShrinkwrapHash": "ccb00fdbe9254645066d7369c7640e6b9c859e5f", "preferredVersionsHash": "5222ca779ae69ebfd201e39c17f48ce9eaf8c3c2" } diff --git a/libraries/rush-lib/package.json b/libraries/rush-lib/package.json index 7a98e331226..807247012cc 100644 --- a/libraries/rush-lib/package.json +++ b/libraries/rush-lib/package.json @@ -43,7 +43,7 @@ "ignore": "~5.1.6", "inquirer": "~7.3.3", "js-yaml": "~3.13.1", - "jszip": "~3.7.1", + "jszip": "~3.8.0", "lodash": "~4.17.15", "node-fetch": "2.6.7", "npm-check": "~6.0.1", From a2fbefe8206d90f91059c52fc0f5a9c2644dbe02 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Wed, 18 Jan 2023 11:47:42 -0800 Subject: [PATCH 047/167] Fix missing create-scripts.js file. --- .../rush/fix-create-scripts_2023-01-18-19-47.json | 10 ++++++++++ libraries/rush-lib/src/logic/deploy/DeployManager.ts | 4 ++-- libraries/rush-lib/src/utilities/PathConstants.ts | 3 ++- libraries/rush-lib/webpack.config.js | 4 ++++ 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 common/changes/@microsoft/rush/fix-create-scripts_2023-01-18-19-47.json diff --git a/common/changes/@microsoft/rush/fix-create-scripts_2023-01-18-19-47.json b/common/changes/@microsoft/rush/fix-create-scripts_2023-01-18-19-47.json new file mode 100644 index 00000000000..ca5afd7d589 --- /dev/null +++ b/common/changes/@microsoft/rush/fix-create-scripts_2023-01-18-19-47.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Fix an issue where `create-scripts.js` does not exist during `rush deploy`.", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file diff --git a/libraries/rush-lib/src/logic/deploy/DeployManager.ts b/libraries/rush-lib/src/logic/deploy/DeployManager.ts index 78175e3f9a8..ce4d392bcef 100644 --- a/libraries/rush-lib/src/logic/deploy/DeployManager.ts +++ b/libraries/rush-lib/src/logic/deploy/DeployManager.ts @@ -31,7 +31,7 @@ import { RushConfigurationProject } from '../../api/RushConfigurationProject'; import { DeployScenarioConfiguration, IDeployScenarioProjectJson } from './DeployScenarioConfiguration'; import { PnpmfileConfiguration } from '../pnpm/PnpmfileConfiguration'; import { matchesWithStar } from './Utils'; -import { scriptsFolderName } from '../../utilities/PathConstants'; +import { createLinksScriptFilename, scriptsFolderPath } from '../../utilities/PathConstants'; // (@types/npm-packlist is missing this API) declare module 'npm-packlist' { @@ -665,7 +665,7 @@ export class DeployManager { if (deployState.scenarioConfiguration.json.linkCreation === 'script') { console.log('Copying create-links.js'); FileSystem.copyFile({ - sourcePath: `${scriptsFolderName}/create-links.js`, + sourcePath: `${scriptsFolderPath}/${createLinksScriptFilename}`, destinationPath: path.join(deployState.targetRootFolder, 'create-links.js'), alreadyExistsBehavior: AlreadyExistsBehavior.Error }); diff --git a/libraries/rush-lib/src/utilities/PathConstants.ts b/libraries/rush-lib/src/utilities/PathConstants.ts index 167bdb8af24..b49e828502b 100644 --- a/libraries/rush-lib/src/utilities/PathConstants.ts +++ b/libraries/rush-lib/src/utilities/PathConstants.ts @@ -16,13 +16,14 @@ export const assetsFolderPath: string = `${rushLibFolderRootPath}/assets`; /** * The folder name ("scripts") where the scripts in rush-lib are built. */ -export const scriptsFolderName: string = 'scripts'; +const scriptsFolderName: string = 'scripts'; export const pnpmfileShimFilename: string = 'PnpmfileShim.js'; export const installRunScriptFilename: string = 'install-run.js'; export const installRunRushScriptFilename: string = 'install-run-rush.js'; export const installRunRushxScriptFilename: string = 'install-run-rushx.js'; export const installRunRushPnpmScriptFilename: string = 'install-run-rush-pnpm.js'; +export const createLinksScriptFilename: string = 'create-links.js'; /** * The path to the scripts folder in rush-lib/dist. diff --git a/libraries/rush-lib/webpack.config.js b/libraries/rush-lib/webpack.config.js index 9857e2de4ea..8b47dcf2478 100644 --- a/libraries/rush-lib/webpack.config.js +++ b/libraries/rush-lib/webpack.config.js @@ -121,6 +121,10 @@ module.exports = () => { [PathConstants.installRunRushPnpmScriptFilename]: { import: `${__dirname}/lib-esnext/scripts/install-run-rush-pnpm.js`, ...SCRIPT_ENTRY_OPTIONS + }, + [PathConstants.createLinksScriptFilename]: { + import: `${__dirname}/lib-esnext/scripts/create-links.js`, + ...SCRIPT_ENTRY_OPTIONS } }) ]; From 103e2362bbc99a07539b0263f50d4a3125a41391 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Wed, 18 Jan 2023 11:53:24 -0800 Subject: [PATCH 048/167] Update version-policies.json --- common/config/rush/version-policies.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config/rush/version-policies.json b/common/config/rush/version-policies.json index 6da61cc0651..d5c0cdd25a8 100644 --- a/common/config/rush/version-policies.json +++ b/common/config/rush/version-policies.json @@ -103,7 +103,7 @@ "policyName": "rush", "definitionName": "lockStepVersion", "version": "5.88.0", - "nextBump": "minor", + "nextBump": "patch", "mainProject": "@microsoft/rush" } ] From 29cde4ce9fd2b5bec7946df7341f64a224d850e4 Mon Sep 17 00:00:00 2001 From: David Michon Date: Wed, 18 Jan 2023 13:53:32 -0800 Subject: [PATCH 049/167] [module-minifier] Update to terser@5.16.1 --- .../bump-terser_2023-01-18-21-53.json | 10 ++++++++++ common/config/rush/pnpm-lock.yaml | 15 +++------------ common/config/rush/repo-state.json | 2 +- libraries/module-minifier/package.json | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 common/changes/@rushstack/module-minifier/bump-terser_2023-01-18-21-53.json diff --git a/common/changes/@rushstack/module-minifier/bump-terser_2023-01-18-21-53.json b/common/changes/@rushstack/module-minifier/bump-terser_2023-01-18-21-53.json new file mode 100644 index 00000000000..9a7a664dbae --- /dev/null +++ b/common/changes/@rushstack/module-minifier/bump-terser_2023-01-18-21-53.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/module-minifier", + "comment": "Update to terser 5.16.1", + "type": "patch" + } + ], + "packageName": "@rushstack/module-minifier" +} \ No newline at end of file diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 0cf2d5d6cc9..e24bf9f247d 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1785,13 +1785,13 @@ importers: '@types/serialize-javascript': 5.0.2 serialize-javascript: 6.0.0 source-map: ~0.7.3 - terser: 5.9.0 + terser: 5.16.1 dependencies: '@rushstack/worker-pool': link:../worker-pool '@types/node': 12.20.24 serialize-javascript: 6.0.0 source-map: 0.7.4 - terser: 5.9.0 + terser: 5.16.1 devDependencies: '@rushstack/eslint-config': link:../../eslint/eslint-config '@rushstack/heft': link:../../apps/heft @@ -19546,7 +19546,7 @@ packages: schema-utils: 3.1.1 serialize-javascript: 5.0.1 source-map: 0.6.1 - terser: 5.9.0 + terser: 5.16.1 webpack: 4.44.2 webpack-sources: 1.4.3 dev: true @@ -19593,15 +19593,6 @@ packages: commander: 2.20.3 source-map-support: 0.5.21 - /terser/5.9.0: - resolution: {integrity: sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==} - engines: {node: '>=10'} - hasBin: true - dependencies: - commander: 2.20.3 - source-map: 0.7.4 - source-map-support: 0.5.21 - /test-exclude/6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} engines: {node: '>=8'} diff --git a/common/config/rush/repo-state.json b/common/config/rush/repo-state.json index 530ff0fc82f..ae39d578b00 100644 --- a/common/config/rush/repo-state.json +++ b/common/config/rush/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "ccb00fdbe9254645066d7369c7640e6b9c859e5f", + "pnpmShrinkwrapHash": "046e9f54bcf081fbaf58b9e157b561be6b89e53d", "preferredVersionsHash": "5222ca779ae69ebfd201e39c17f48ce9eaf8c3c2" } diff --git a/libraries/module-minifier/package.json b/libraries/module-minifier/package.json index b3f4fb3a160..33e4c82caa5 100644 --- a/libraries/module-minifier/package.json +++ b/libraries/module-minifier/package.json @@ -20,7 +20,7 @@ "@rushstack/worker-pool": "workspace:*", "serialize-javascript": "6.0.0", "source-map": "~0.7.3", - "terser": "5.9.0" + "terser": "5.16.1" }, "devDependencies": { "@rushstack/eslint-config": "workspace:*", From 6834905b64779d85bfc2224bf05abb4404d180a7 Mon Sep 17 00:00:00 2001 From: David Michon Date: Fri, 9 Dec 2022 16:44:59 -0800 Subject: [PATCH 050/167] Parallelize getRepoState --- ...po-state-performance_2022-12-10-00-54.json | 10 ++ ...po-state-performance_2022-12-10-00-54.json | 10 ++ common/reviews/api/package-deps-hash.api.md | 3 + common/reviews/api/rush-lib.api.md | 2 +- .../package-deps-hash/src/getRepoState.ts | 154 +++++++++++++++++- libraries/package-deps-hash/src/index.ts | 1 + .../cli/scriptActions/PhasedScriptAction.ts | 2 +- .../cli/test/RushCommandLineParser.test.ts | 69 +++++--- .../src/logic/ProjectChangeAnalyzer.ts | 92 +++++------ .../logic/test/ProjectChangeAnalyzer.test.ts | 8 +- 10 files changed, 267 insertions(+), 84 deletions(-) create mode 100644 common/changes/@microsoft/rush/repo-state-performance_2022-12-10-00-54.json create mode 100644 common/changes/@rushstack/package-deps-hash/repo-state-performance_2022-12-10-00-54.json diff --git a/common/changes/@microsoft/rush/repo-state-performance_2022-12-10-00-54.json b/common/changes/@microsoft/rush/repo-state-performance_2022-12-10-00-54.json new file mode 100644 index 00000000000..3a7fa0e4ba8 --- /dev/null +++ b/common/changes/@microsoft/rush/repo-state-performance_2022-12-10-00-54.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Use getRepoStateAsync to optimize performance of calculating repository state.", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file diff --git a/common/changes/@rushstack/package-deps-hash/repo-state-performance_2022-12-10-00-54.json b/common/changes/@rushstack/package-deps-hash/repo-state-performance_2022-12-10-00-54.json new file mode 100644 index 00000000000..3eb6e0f7a23 --- /dev/null +++ b/common/changes/@rushstack/package-deps-hash/repo-state-performance_2022-12-10-00-54.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/package-deps-hash", + "comment": "Add getRepoStateAsync API for faster repository state calculation.", + "type": "minor" + } + ], + "packageName": "@rushstack/package-deps-hash" +} \ No newline at end of file diff --git a/common/reviews/api/package-deps-hash.api.md b/common/reviews/api/package-deps-hash.api.md index cd2808a61ee..372ad9455f0 100644 --- a/common/reviews/api/package-deps-hash.api.md +++ b/common/reviews/api/package-deps-hash.api.md @@ -22,6 +22,9 @@ export function getRepoRoot(currentWorkingDirectory: string, gitPath?: string): // @beta export function getRepoState(currentWorkingDirectory: string, gitPath?: string): Map; +// @beta +export function getRepoStateAsync(rootDirectory: string, additionalRelativePathsToHash?: string[], gitPath?: string): Promise>; + // @beta export interface IFileDiffStatus { // (undocumented) diff --git a/common/reviews/api/rush-lib.api.md b/common/reviews/api/rush-lib.api.md index 2a0de769dcd..446bd8539f1 100644 --- a/common/reviews/api/rush-lib.api.md +++ b/common/reviews/api/rush-lib.api.md @@ -740,7 +740,7 @@ export class ProjectChangeAnalyzer { // Warning: (ae-forgotten-export) The symbol "IRawRepoState" needs to be exported by the entry point index.d.ts // // @internal (undocumented) - _ensureInitialized(terminal: ITerminal): IRawRepoState | undefined; + _ensureInitializedAsync(terminal: ITerminal): Promise; // (undocumented) _filterProjectDataAsync(project: RushConfigurationProject, unfilteredProjectData: Map, rootDir: string, terminal: ITerminal): Promise>; getChangedProjectsAsync(options: IGetChangedProjectsOptions): Promise>; diff --git a/libraries/package-deps-hash/src/getRepoState.ts b/libraries/package-deps-hash/src/getRepoState.ts index ed316401d65..75c0d81350a 100644 --- a/libraries/package-deps-hash/src/getRepoState.ts +++ b/libraries/package-deps-hash/src/getRepoState.ts @@ -2,7 +2,10 @@ // See LICENSE in the project root for license information. import type * as child_process from 'child_process'; -import { Executable, FileSystem } from '@rushstack/node-core-library'; +import { once } from 'events'; +import { Readable } from 'stream'; + +import { Executable, FileSystem, IExecutableSpawnOptions } from '@rushstack/node-core-library'; export interface IGitVersion { major: number; @@ -190,7 +193,11 @@ export function getRepoRoot(currentWorkingDirectory: string, gitPath?: string): throw new Error(`git rev-parse exited with status ${result.status}: ${result.stderr}`); } - repoRootCache.set(currentWorkingDirectory, (cachedResult = result.stdout.trim())); + cachedResult = result.stdout.trim(); + + repoRootCache.set(currentWorkingDirectory, cachedResult); + // To ensure that calling getRepoRoot on the result is a no-op. + repoRootCache.set(cachedResult, cachedResult); } return cachedResult; @@ -270,6 +277,149 @@ export function applyWorkingTreeState( } } +/** + * Helper function for async process invocation with optional stdin support. + * @param gitPath - Path to the Git executable + * @param args - The process arguments + * @param currentWorkingDirectory - The working directory. Should be the repository root. + * @param stdin - An optional Readable stream to use as stdin to the process. + */ +async function spawnGitAsync( + gitPath: string | undefined, + args: string[], + currentWorkingDirectory: string, + stdin?: Readable +): Promise { + const spawnOptions: IExecutableSpawnOptions = { + currentWorkingDirectory, + stdio: ['pipe', 'pipe', 'pipe'] + }; + + let stdout: string = ''; + let stderr: string = ''; + + const proc: child_process.ChildProcess = Executable.spawn(gitPath || 'git', args, spawnOptions); + proc.stdout!.setEncoding('utf-8'); + proc.stderr!.setEncoding('utf-8'); + + proc.stdout!.on('data', (chunk: string) => { + stdout += chunk.toString(); + }); + proc.stderr!.on('data', (chunk: string) => { + stderr += chunk.toString(); + }); + + if (stdin) { + stdin.pipe(proc.stdin!); + } + + const [status] = await once(proc, 'exit'); + if (status !== 0) { + throw new Error(`git ${args[0]} exited with code ${status}: ${stderr}`); + } + + return stdout; +} + +/** + * Gets the object hashes for all files in the Git repo, combining the current commit with working tree state. + * Uses async operations and runs all primary Git calls in parallel. + * @param rootDirectory - The root directory of the Git repository + * @param additionalRelativePathsToHash - Root-relative file paths to have Git hash and include in the results + * @param gitPath - The path to the Git executable + * @beta + */ +export async function getRepoStateAsync( + rootDirectory: string, + additionalRelativePathsToHash?: string[], + gitPath?: string +): Promise> { + const statePromise: Promise = spawnGitAsync( + gitPath, + ['--no-optional-locks', 'ls-tree', '-r', '-z', '--full-name', 'HEAD', '--'], + rootDirectory + ).then(parseGitLsTree); + const locallyModifiedPromise: Promise> = spawnGitAsync( + gitPath, + ['--no-optional-locks', 'status', '-z', '-u', '--no-renames', '--ignore-submodules', '--'], + rootDirectory + ).then(parseGitStatus); + + const hashPaths: string[] = []; + async function* getFilesToHash(): AsyncIterableIterator { + if (additionalRelativePathsToHash) { + for (const file of additionalRelativePathsToHash) { + hashPaths.push(file); + yield `${file}\n`; + } + } + + const [{ files }, locallyModified] = await Promise.all([statePromise, locallyModifiedPromise]); + + for (const [filePath, exists] of locallyModified) { + if (exists) { + hashPaths.push(filePath); + yield `${filePath}\n`; + } else { + files.delete(filePath); + } + } + } + + const hashObjectPromise: Promise = spawnGitAsync( + gitPath, + ['--no-optional-locks', 'hash-object', '--stdin-paths'], + rootDirectory, + Readable.from(getFilesToHash(), { + encoding: 'utf-8', + objectMode: false, + autoDestroy: true + }) + ); + + const [{ files, submodules }, hashObject] = await Promise.all([ + statePromise, + hashObjectPromise, + locallyModifiedPromise + ]); + + // Existence check for the .gitmodules file + const hasSubmodules: boolean = submodules.size > 0 && FileSystem.exists(`${rootDirectory}/.gitmodules`); + + if (hasSubmodules) { + // Submodules are not the normal critical path. Accept serial performance rather than investing in complexity. + // Can revisit if submodules become more commonly used. + for (const submodulePath of submodules.keys()) { + const submoduleState: Map = await getRepoStateAsync( + `${rootDirectory}/${submodulePath}`, + [], + gitPath + ); + for (const [filePath, hash] of submoduleState) { + files.set(`${submodulePath}/${filePath}`, hash); + } + } + } + + // The result of "git hash-object" will be a list of file hashes delimited by newlines + const hashes: string[] = hashObject.trim().split('\n'); + + if (hashes.length !== hashPaths.length) { + throw new Error( + `Passed ${hashPaths.length} file paths to Git to hash, but received ${hashes.length} hashes.` + ); + } + + const len: number = hashes.length; + for (let i: number = 0; i < len; i++) { + const hash: string = hashes[i]; + const filePath: string = hashPaths[i]; + files.set(filePath, hash); + } + + return files; +} + /** * Gets the object hashes for all files in the Git repo, combining the current commit with working tree state. * @param currentWorkingDirectory - The working directory. Only used to find the repository root. diff --git a/libraries/package-deps-hash/src/index.ts b/libraries/package-deps-hash/src/index.ts index 855573b8589..49aa25f813e 100644 --- a/libraries/package-deps-hash/src/index.ts +++ b/libraries/package-deps-hash/src/index.ts @@ -19,5 +19,6 @@ export { getRepoChanges, getRepoRoot, getRepoState, + getRepoStateAsync, ensureGitMinimumVersion } from './getRepoState'; diff --git a/libraries/rush-lib/src/cli/scriptActions/PhasedScriptAction.ts b/libraries/rush-lib/src/cli/scriptActions/PhasedScriptAction.ts index 7e56d27454d..67c14ff22a5 100644 --- a/libraries/rush-lib/src/cli/scriptActions/PhasedScriptAction.ts +++ b/libraries/rush-lib/src/cli/scriptActions/PhasedScriptAction.ts @@ -353,7 +353,7 @@ export class PhasedScriptAction extends BaseScriptAction { terminal.write('Analyzing repo state... '); const repoStateStopwatch: Stopwatch = new Stopwatch(); repoStateStopwatch.start(); - projectChangeAnalyzer._ensureInitialized(terminal); + await projectChangeAnalyzer._ensureInitializedAsync(terminal); repoStateStopwatch.stop(); terminal.writeLine(`DONE (${repoStateStopwatch.toString()})`); terminal.writeLine(); diff --git a/libraries/rush-lib/src/cli/test/RushCommandLineParser.test.ts b/libraries/rush-lib/src/cli/test/RushCommandLineParser.test.ts index a458406ef6e..2ca62a05d0a 100644 --- a/libraries/rush-lib/src/cli/test/RushCommandLineParser.test.ts +++ b/libraries/rush-lib/src/cli/test/RushCommandLineParser.test.ts @@ -1,11 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. +jest.mock(`@rushstack/package-deps-hash`, () => { + return { + getRepoRoot(dir: string): string { + return dir; + }, + getRepoStateAsync(): ReadonlyMap { + return new Map(); + }, + getRepoChangesAsync(): ReadonlyMap { + return new Map(); + } + }; +}); + import './mockRushCommandLineParser'; import * as path from 'path'; import { FileSystem, JsonFile, Path, PackageJsonLookup } from '@rushstack/node-core-library'; -import { RushCommandLineParser } from '../RushCommandLineParser'; +import type { RushCommandLineParser as RushCommandLineParserType } from '../RushCommandLineParser'; import { LastLinkFlagFactory } from '../../api/LastLinkFlag'; import { Autoinstaller } from '../../logic/Autoinstaller'; import { ITelemetryData } from '../../logic/Telemetry'; @@ -31,7 +45,7 @@ interface IChildProcessModuleMock { * Interface definition for a test instance for the RushCommandLineParser. */ interface IParserTestInstance { - parser: RushCommandLineParser; + parser: RushCommandLineParserType; spawnMock: jest.Mock; } @@ -66,7 +80,10 @@ const __dirnameInLib: string = getDirnameInLib(); /** * Helper to set up a test instance for RushCommandLineParser. */ -function getCommandLineParserInstance(repoName: string, taskName: string): IParserTestInstance { +async function getCommandLineParserInstanceAsync( + repoName: string, + taskName: string +): Promise { // Run these tests in the /lib folder because some of them require compiled output // Point to the test repo folder const startPath: string = `${__dirnameInLib}/${repoName}`; @@ -76,11 +93,13 @@ function getCommandLineParserInstance(repoName: string, taskName: string): IPars FileSystem.deleteFolder(`${startPath}/a/.rush/temp`); FileSystem.deleteFolder(`${startPath}/b/.rush/temp`); + const { RushCommandLineParser } = await import('../RushCommandLineParser'); + // Create a Rush CLI instance. This instance is heavy-weight and relies on setting process.exit // to exit and clear the Rush file lock. So running multiple `it` or `describe` test blocks over the same test // repo will fail due to contention over the same lock which is kept until the test runner process // ends. - const parser: RushCommandLineParser = new RushCommandLineParser({ cwd: startPath }); + const parser: RushCommandLineParserType = new RushCommandLineParser({ cwd: startPath }); // Bulk tasks are hard-coded to expect install to have been completed. So, ensure the last-link.flag // file exists and is valid @@ -104,8 +123,8 @@ function pathEquals(actual: string, expected: string): void { const SPAWN_ARG_ARGS: number = 1; const SPAWN_ARG_OPTIONS: number = 2; -describe(RushCommandLineParser.name, () => { - describe(RushCommandLineParser.prototype.execute.name, () => { +describe('RushCommandLineParser', () => { + describe('execute', () => { afterEach(() => { jest.clearAllMocks(); }); @@ -114,7 +133,7 @@ describe(RushCommandLineParser.name, () => { describe("'build' action", () => { it(`executes the package's 'build' script`, async () => { const repoName: string = 'basicAndRunBuildActionRepo'; - const instance: IParserTestInstance = getCommandLineParserInstance(repoName, 'build'); + const instance: IParserTestInstance = await getCommandLineParserInstanceAsync(repoName, 'build'); await expect(instance.parser.execute()).resolves.toEqual(true); @@ -146,7 +165,7 @@ describe(RushCommandLineParser.name, () => { describe("'rebuild' action", () => { it(`executes the package's 'build' script`, async () => { const repoName: string = 'basicAndRunRebuildActionRepo'; - const instance: IParserTestInstance = getCommandLineParserInstance(repoName, 'rebuild'); + const instance: IParserTestInstance = await getCommandLineParserInstanceAsync(repoName, 'rebuild'); await expect(instance.parser.execute()).resolves.toEqual(true); @@ -180,7 +199,7 @@ describe(RushCommandLineParser.name, () => { describe("'build' action", () => { it(`executes the package's 'build' script`, async () => { const repoName: string = 'overrideRebuildAndRunBuildActionRepo'; - const instance: IParserTestInstance = getCommandLineParserInstance(repoName, 'build'); + const instance: IParserTestInstance = await getCommandLineParserInstanceAsync(repoName, 'build'); await expect(instance.parser.execute()).resolves.toEqual(true); @@ -212,7 +231,7 @@ describe(RushCommandLineParser.name, () => { describe("'rebuild' action", () => { it(`executes the package's 'rebuild' script`, async () => { const repoName: string = 'overrideRebuildAndRunRebuildActionRepo'; - const instance: IParserTestInstance = getCommandLineParserInstance(repoName, 'rebuild'); + const instance: IParserTestInstance = await getCommandLineParserInstanceAsync(repoName, 'rebuild'); await expect(instance.parser.execute()).resolves.toEqual(true); @@ -246,7 +265,7 @@ describe(RushCommandLineParser.name, () => { describe("'build' action", () => { it(`executes the package's 'build' script`, async () => { const repoName: string = 'overrideAndDefaultBuildActionRepo'; - const instance: IParserTestInstance = getCommandLineParserInstance(repoName, 'build'); + const instance: IParserTestInstance = await getCommandLineParserInstanceAsync(repoName, 'build'); await expect(instance.parser.execute()).resolves.toEqual(true); // There should be 1 build per package @@ -278,7 +297,7 @@ describe(RushCommandLineParser.name, () => { it(`executes the package's 'build' script`, async () => { // broken const repoName: string = 'overrideAndDefaultRebuildActionRepo'; - const instance: IParserTestInstance = getCommandLineParserInstance(repoName, 'rebuild'); + const instance: IParserTestInstance = await getCommandLineParserInstanceAsync(repoName, 'rebuild'); await expect(instance.parser.execute()).resolves.toEqual(true); // There should be 1 build per package @@ -311,9 +330,9 @@ describe(RushCommandLineParser.name, () => { it(`throws an error when starting Rush`, async () => { const repoName: string = 'overrideBuildAsGlobalCommandRepo'; - await expect(() => { - getCommandLineParserInstance(repoName, 'doesnt-matter'); - }).toThrowErrorMatchingInlineSnapshot( + await expect(async () => { + await getCommandLineParserInstanceAsync(repoName, 'doesnt-matter'); + }).rejects.toThrowErrorMatchingInlineSnapshot( `"command-line.json defines a command \\"build\\" using the command kind \\"global\\". This command can only be designated as a command kind \\"bulk\\" or \\"phased\\"."` ); }); @@ -323,9 +342,9 @@ describe(RushCommandLineParser.name, () => { it(`throws an error when starting Rush`, async () => { const repoName: string = 'overrideRebuildAsGlobalCommandRepo'; - await expect(() => { - getCommandLineParserInstance(repoName, 'doesnt-matter'); - }).toThrowErrorMatchingInlineSnapshot( + await expect(async () => { + await getCommandLineParserInstanceAsync(repoName, 'doesnt-matter'); + }).rejects.toThrowErrorMatchingInlineSnapshot( `"command-line.json defines a command \\"rebuild\\" using the command kind \\"global\\". This command can only be designated as a command kind \\"bulk\\" or \\"phased\\"."` ); }); @@ -335,9 +354,9 @@ describe(RushCommandLineParser.name, () => { it(`throws an error when starting Rush`, async () => { const repoName: string = 'overrideBuildWithSimultaneousProcessesRepo'; - await expect(() => { - getCommandLineParserInstance(repoName, 'doesnt-matter'); - }).toThrowErrorMatchingInlineSnapshot( + await expect(async () => { + await getCommandLineParserInstanceAsync(repoName, 'doesnt-matter'); + }).rejects.toThrowErrorMatchingInlineSnapshot( `"command-line.json defines a command \\"build\\" using \\"safeForSimultaneousRushProcesses=true\\". This configuration is not supported for \\"build\\"."` ); }); @@ -347,9 +366,9 @@ describe(RushCommandLineParser.name, () => { it(`throws an error when starting Rush`, async () => { const repoName: string = 'overrideRebuildWithSimultaneousProcessesRepo'; - await expect(() => { - getCommandLineParserInstance(repoName, 'doesnt-matter'); - }).toThrowErrorMatchingInlineSnapshot( + await expect(async () => { + await getCommandLineParserInstanceAsync(repoName, 'doesnt-matter'); + }).rejects.toThrowErrorMatchingInlineSnapshot( `"command-line.json defines a command \\"rebuild\\" using \\"safeForSimultaneousRushProcesses=true\\". This configuration is not supported for \\"rebuild\\"."` ); }); @@ -358,7 +377,7 @@ describe(RushCommandLineParser.name, () => { describe('in repo plugin custom flushTelemetry', () => { it('creates a custom telemetry file', async () => { const repoName: string = 'tapFlushTelemetryAndRunBuildActionRepo'; - const instance: IParserTestInstance = getCommandLineParserInstance(repoName, 'build'); + const instance: IParserTestInstance = await getCommandLineParserInstanceAsync(repoName, 'build'); const telemetryFilePath: string = `${instance.parser.rushConfiguration.commonTempFolder}/test-telemetry.json`; FileSystem.deleteFile(telemetryFilePath); diff --git a/libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts b/libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts index da0f2cd2413..d18edcc709d 100644 --- a/libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts +++ b/libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts @@ -8,11 +8,10 @@ import ignore, { Ignore } from 'ignore'; import { getRepoChanges, getRepoRoot, - getRepoState, - getGitHashForFiles, + getRepoStateAsync, IFileDiffStatus } from '@rushstack/package-deps-hash'; -import { Path, InternalError, FileSystem, ITerminal, Async } from '@rushstack/node-core-library'; +import { Path, FileSystem, ITerminal, Async } from '@rushstack/node-core-library'; import { RushConfiguration } from '../api/RushConfiguration'; import { RushProjectConfiguration } from '../api/RushProjectConfiguration'; @@ -93,7 +92,7 @@ export class ProjectChangeAnalyzer { return filteredProjectData; } - const data: IRawRepoState | undefined = this._ensureInitialized(terminal); + const data: IRawRepoState | undefined = await this._ensureInitializedAsync(terminal); if (!data) { return undefined; @@ -124,9 +123,9 @@ export class ProjectChangeAnalyzer { /** * @internal */ - public _ensureInitialized(terminal: ITerminal): IRawRepoState | undefined { + public async _ensureInitializedAsync(terminal: ITerminal): Promise { if (this._data === UNINITIALIZED) { - this._data = this._getData(terminal); + this._data = await this._getDataAsync(terminal); } return this._data; @@ -325,8 +324,8 @@ export class ProjectChangeAnalyzer { return changedProjects; } - private _getData(terminal: ITerminal): IRawRepoState { - const repoState: IGitState | undefined = this._getRepoDeps(terminal); + private async _getDataAsync(terminal: ITerminal): Promise { + const repoState: IGitState | undefined = await this._getRepoDepsAsync(terminal); if (!repoState) { // Mark as resolved, but no data return { @@ -347,44 +346,7 @@ export class ProjectChangeAnalyzer { const { hashes: repoDeps, rootDir } = repoState; // Currently, only pnpm handles project shrinkwraps - if (this._rushConfiguration.packageManager === 'pnpm') { - const projectDependencyManifestPaths: string[] = []; - - for (const project of projectHashDeps.keys()) { - const projectShrinkwrapFilePath: string = BaseProjectShrinkwrapFile.getFilePathForProject(project); - const relativeProjectShrinkwrapFilePath: string = Path.convertToSlashes( - path.relative(rootDir, projectShrinkwrapFilePath) - ); - - if (!FileSystem.exists(projectShrinkwrapFilePath)) { - throw new Error( - `A project dependency file (${relativeProjectShrinkwrapFilePath}) is missing. You may need to run ` + - '"rush install" or "rush update".' - ); - } - - projectDependencyManifestPaths.push(relativeProjectShrinkwrapFilePath); - } - - const gitPath: string = this._git.getGitPathOrThrow(); - const hashes: Map = getGitHashForFiles( - projectDependencyManifestPaths, - rootDir, - gitPath - ); - - let i: number = 0; - for (const projectDeps of projectHashDeps.values()) { - const projectDependencyManifestPath: string = projectDependencyManifestPaths[i]; - const hash: string | undefined = hashes.get(projectDependencyManifestPath); - if (hash === undefined) { - throw new InternalError(`Expected to get a hash for ${projectDependencyManifestPath}`); - } - - projectDeps.set(projectDependencyManifestPath, hash); - i++; - } - } else { + if (this._rushConfiguration.packageManager !== 'pnpm') { // Determine the current variant from the link JSON. const variant: string | undefined = this._rushConfiguration.currentInstalledVariant; @@ -434,13 +396,41 @@ export class ProjectChangeAnalyzer { } } - private _getRepoDeps(terminal: ITerminal): IGitState | undefined { + private async _getRepoDepsAsync(terminal: ITerminal): Promise { try { - if (this._git.isPathUnderGitWorkingTree()) { + const gitPath: string = this._git.getGitPathOrThrow(); + const rootDir: string | undefined = this._git.getGitInfo()?.root; + + if (rootDir) { // Load the package deps hash for the whole repository - const gitPath: string = this._git.getGitPathOrThrow(); - const rootDir: string = getRepoRoot(this._rushConfiguration.rushJsonFolder, gitPath); - const hashes: Map = getRepoState(rootDir, gitPath); + // Include project shrinkwrap files as part of the computation + const additionalFilesToHash: string[] = []; + + if (this._rushConfiguration.packageManager === 'pnpm') { + const absoluteFilePathsToCheck: string[] = []; + + for (const project of this._rushConfiguration.projects) { + const projectShrinkwrapFilePath: string = + BaseProjectShrinkwrapFile.getFilePathForProject(project); + absoluteFilePathsToCheck.push(projectShrinkwrapFilePath); + const relativeProjectShrinkwrapFilePath: string = Path.convertToSlashes( + path.relative(rootDir, projectShrinkwrapFilePath) + ); + + additionalFilesToHash.push(relativeProjectShrinkwrapFilePath); + } + + await Async.forEachAsync(absoluteFilePathsToCheck, async (filePath: string) => { + if (!(await FileSystem.existsAsync(filePath))) { + throw new Error( + `A project dependency file (${filePath}) is missing. You may need to run ` + + '"rush install" or "rush update".' + ); + } + }); + } + + const hashes: Map = await getRepoStateAsync(rootDir, additionalFilesToHash, gitPath); return { gitPath, hashes, diff --git a/libraries/rush-lib/src/logic/test/ProjectChangeAnalyzer.test.ts b/libraries/rush-lib/src/logic/test/ProjectChangeAnalyzer.test.ts index 47a5818cd52..326e1d09006 100644 --- a/libraries/rush-lib/src/logic/test/ProjectChangeAnalyzer.test.ts +++ b/libraries/rush-lib/src/logic/test/ProjectChangeAnalyzer.test.ts @@ -46,12 +46,12 @@ describe(ProjectChangeAnalyzer.name, () => { const subject: ProjectChangeAnalyzer = new ProjectChangeAnalyzer(rushConfiguration); - subject['_getRepoDeps'] = jest.fn(() => { - return { + subject['_getRepoDepsAsync'] = jest.fn(() => { + return Promise.resolve({ gitPath: 'git', hashes: files, rootDir: '' - }; + }); }); return subject; @@ -255,7 +255,7 @@ describe(ProjectChangeAnalyzer.name, () => { expect(await subject._tryGetProjectDependenciesAsync(projects[0], terminal)).toEqual( new Map([['apps/apple/core.js', 'a101']]) ); - expect(subject['_getRepoDeps']).toHaveBeenCalledTimes(1); + expect(subject['_getRepoDepsAsync']).toHaveBeenCalledTimes(1); }); }); From 230a79062cf4496a44ff45b7ca411e433b55ab75 Mon Sep 17 00:00:00 2001 From: David Michon Date: Mon, 12 Dec 2022 14:58:58 -0800 Subject: [PATCH 051/167] Remove synchronous getRepoState --- ...po-state-performance_2022-12-10-00-54.json | 4 +- common/reviews/api/package-deps-hash.api.md | 3 - .../package-deps-hash/src/getRepoState.ts | 173 ++++-------------- libraries/package-deps-hash/src/index.ts | 1 - .../src/test/getRepoDeps.test.ts | 60 ++++-- 5 files changed, 87 insertions(+), 154 deletions(-) diff --git a/common/changes/@rushstack/package-deps-hash/repo-state-performance_2022-12-10-00-54.json b/common/changes/@rushstack/package-deps-hash/repo-state-performance_2022-12-10-00-54.json index 3eb6e0f7a23..0f9b074d244 100644 --- a/common/changes/@rushstack/package-deps-hash/repo-state-performance_2022-12-10-00-54.json +++ b/common/changes/@rushstack/package-deps-hash/repo-state-performance_2022-12-10-00-54.json @@ -2,8 +2,8 @@ "changes": [ { "packageName": "@rushstack/package-deps-hash", - "comment": "Add getRepoStateAsync API for faster repository state calculation.", - "type": "minor" + "comment": "Add getRepoStateAsync API for faster repository state calculation. Remove synchronous getRepoState API.", + "type": "major" } ], "packageName": "@rushstack/package-deps-hash" diff --git a/common/reviews/api/package-deps-hash.api.md b/common/reviews/api/package-deps-hash.api.md index 372ad9455f0..def3204392e 100644 --- a/common/reviews/api/package-deps-hash.api.md +++ b/common/reviews/api/package-deps-hash.api.md @@ -19,9 +19,6 @@ export function getRepoChanges(currentWorkingDirectory: string, revision?: strin // @beta export function getRepoRoot(currentWorkingDirectory: string, gitPath?: string): string; -// @beta -export function getRepoState(currentWorkingDirectory: string, gitPath?: string): Map; - // @beta export function getRepoStateAsync(rootDirectory: string, additionalRelativePathsToHash?: string[], gitPath?: string): Promise>; diff --git a/libraries/package-deps-hash/src/getRepoState.ts b/libraries/package-deps-hash/src/getRepoState.ts index 75c0d81350a..83e59e01406 100644 --- a/libraries/package-deps-hash/src/getRepoState.ts +++ b/libraries/package-deps-hash/src/getRepoState.ts @@ -75,6 +75,40 @@ export function parseGitLsTree(output: string): IGitTreeState { }; } +/** + * Parses the output of `git hash-object` + * yields [filePath, hash] pairs. + * @internal + */ +export function* parseGitHashObject( + output: string, + filePaths: ReadonlyArray +): Iterable<[string, string]> { + output = output.trim(); + + let last: number = 0; + let i: number = 0; + let index: number = output.indexOf('\n', last); + const expected: number = filePaths.length; + for (; i < expected && index > 0; i++) { + const hash: string = output.slice(last, index); + yield [filePaths[i], hash]; + last = index + 1; + index = output.indexOf('\n', last); + } + + // Handle last line + if (index < 0) { + const hash: string = output.slice(last); + yield [filePaths[i], hash]; + i++; + } + + if (i < expected) { + throw new Error(`Expected ${expected} hashes from "git hash-object" but only received ${i}`); + } +} + /** * Information about the changes to a file. * @beta @@ -203,80 +237,6 @@ export function getRepoRoot(currentWorkingDirectory: string, gitPath?: string): return cachedResult; } -/** - * Augments the state value with modifications that are not in the index. - * @param rootDirectory - The root directory of the Git repository - * @param state - The current map of git path -> object hash. Will be mutated. - * @param gitPath - The path to the Git executable - * @internal - */ -export function applyWorkingTreeState( - rootDirectory: string, - state: Map, - gitPath?: string -): void { - const statusResult: child_process.SpawnSyncReturns = Executable.spawnSync( - gitPath || 'git', - ['--no-optional-locks', 'status', '-z', '-u', '--no-renames', '--ignore-submodules', '--'], - { - currentWorkingDirectory: rootDirectory - } - ); - - if (statusResult.status !== 0) { - ensureGitMinimumVersion(gitPath); - - throw new Error(`git status exited with status ${statusResult.status}: ${statusResult.stderr}`); - } - - const locallyModified: Map = parseGitStatus(statusResult.stdout); - - const filesToHash: string[] = []; - for (const [filePath, exists] of locallyModified) { - if (exists) { - filesToHash.push(filePath); - } else { - state.delete(filePath); - } - } - - if (filesToHash.length) { - // Use --stdin-paths arg to pass the list of files to git in order to avoid issues with - // command length - const hashObjectResult: child_process.SpawnSyncReturns = Executable.spawnSync( - gitPath || 'git', - ['hash-object', '--stdin-paths'], - { currentWorkingDirectory: rootDirectory, input: filesToHash.join('\n') } - ); - - if (hashObjectResult.status !== 0) { - ensureGitMinimumVersion(gitPath); - - throw new Error( - `git hash-object exited with status ${hashObjectResult.status}: ${hashObjectResult.stderr}` - ); - } - - const hashStdout: string = hashObjectResult.stdout.trim(); - - // The result of "git hash-object" will be a list of file hashes delimited by newlines - const hashes: string[] = hashStdout.split('\n'); - - if (hashes.length !== filesToHash.length) { - throw new Error( - `Passed ${filesToHash.length} file paths to Git to hash, but received ${hashes.length} hashes.` - ); - } - - const len: number = hashes.length; - for (let i: number = 0; i < len; i++) { - const hash: string = hashes[i]; - const filePath: string = filesToHash[i]; - state.set(filePath, hash); - } - } -} - /** * Helper function for async process invocation with optional stdin support. * @param gitPath - Path to the Git executable @@ -383,6 +343,11 @@ export async function getRepoStateAsync( locallyModifiedPromise ]); + // The result of "git hash-object" will be a list of file hashes delimited by newlines + for (const [filePath, hash] of parseGitHashObject(hashObject, hashPaths)) { + files.set(filePath, hash); + } + // Existence check for the .gitmodules file const hasSubmodules: boolean = submodules.size > 0 && FileSystem.exists(`${rootDirectory}/.gitmodules`); @@ -401,69 +366,9 @@ export async function getRepoStateAsync( } } - // The result of "git hash-object" will be a list of file hashes delimited by newlines - const hashes: string[] = hashObject.trim().split('\n'); - - if (hashes.length !== hashPaths.length) { - throw new Error( - `Passed ${hashPaths.length} file paths to Git to hash, but received ${hashes.length} hashes.` - ); - } - - const len: number = hashes.length; - for (let i: number = 0; i < len; i++) { - const hash: string = hashes[i]; - const filePath: string = hashPaths[i]; - files.set(filePath, hash); - } - return files; } -/** - * Gets the object hashes for all files in the Git repo, combining the current commit with working tree state. - * @param currentWorkingDirectory - The working directory. Only used to find the repository root. - * @param gitPath - The path to the Git executable - * @beta - */ -export function getRepoState(currentWorkingDirectory: string, gitPath?: string): Map { - const rootDirectory: string = getRepoRoot(currentWorkingDirectory, gitPath); - - const lsTreeResult: child_process.SpawnSyncReturns = Executable.spawnSync( - gitPath || 'git', - ['--no-optional-locks', 'ls-tree', '-r', '-z', '--full-name', 'HEAD', '--'], - { - currentWorkingDirectory: rootDirectory - } - ); - - if (lsTreeResult.status !== 0) { - ensureGitMinimumVersion(gitPath); - - throw new Error(`git ls-tree exited with status ${lsTreeResult.status}: ${lsTreeResult.stderr}`); - } - - const { files, submodules } = parseGitLsTree(lsTreeResult.stdout); - - applyWorkingTreeState(rootDirectory, files, gitPath); - - const state: Map = files; - - // Existence check for the .gitmodules file - const hasSubmodules: boolean = submodules.size > 0 && FileSystem.exists(`${rootDirectory}/.gitmodules`); - - if (hasSubmodules) { - for (const submodulePath of submodules.keys()) { - const submoduleState: Map = getRepoState(`${rootDirectory}/${submodulePath}`, gitPath); - for (const [filePath, hash] of submoduleState) { - state.set(`${submodulePath}/${filePath}`, hash); - } - } - } - - return state; -} - /** * Find all changed files tracked by Git, their current hashes, and the nature of the change. Only useful if all changes are staged or committed. * @param currentWorkingDirectory - The working directory. Only used to find the repository root. diff --git a/libraries/package-deps-hash/src/index.ts b/libraries/package-deps-hash/src/index.ts index 49aa25f813e..2135572b5b7 100644 --- a/libraries/package-deps-hash/src/index.ts +++ b/libraries/package-deps-hash/src/index.ts @@ -18,7 +18,6 @@ export { IFileDiffStatus, getRepoChanges, getRepoRoot, - getRepoState, getRepoStateAsync, ensureGitMinimumVersion } from './getRepoState'; diff --git a/libraries/package-deps-hash/src/test/getRepoDeps.test.ts b/libraries/package-deps-hash/src/test/getRepoDeps.test.ts index ffcf20f6141..ad300570af6 100644 --- a/libraries/package-deps-hash/src/test/getRepoDeps.test.ts +++ b/libraries/package-deps-hash/src/test/getRepoDeps.test.ts @@ -4,7 +4,7 @@ import * as path from 'path'; import { execSync } from 'child_process'; -import { getRepoState, parseGitLsTree, getRepoRoot } from '../getRepoState'; +import { getRepoStateAsync, parseGitLsTree, getRepoRoot } from '../getRepoState'; import { FileSystem, FileConstants } from '@rushstack/node-core-library'; @@ -83,9 +83,9 @@ describe(parseGitLsTree.name, () => { }); }); -describe(getRepoState.name, () => { - it('can parse committed files', () => { - const results: Map = getRepoState(__dirname); +describe(getRepoStateAsync.name, () => { + it('can parse committed files', async () => { + const results: Map = await getRepoStateAsync(__dirname); const filteredResults: Map = getRelevantEntries(results); const expectedFiles: Map = new Map( Object.entries({ @@ -104,12 +104,12 @@ describe(getRepoState.name, () => { expect(filteredResults.size).toEqual(expectedFiles.size); }); - it('can handle adding one file', () => { + it('can handle adding one file', async () => { const tempFilePath: string = path.join(TEST_PROJECT_PATH, 'a.txt'); FileSystem.writeFile(tempFilePath, 'a'); - const results: Map = getRepoState(__dirname); + const results: Map = await getRepoStateAsync(__dirname); const filteredResults: Map = getRelevantEntries(results); try { @@ -134,14 +134,14 @@ describe(getRepoState.name, () => { } }); - it('can handle adding two files', () => { + it('can handle adding two files', async () => { const tempFilePath1: string = path.join(TEST_PROJECT_PATH, 'a.txt'); const tempFilePath2: string = path.join(TEST_PROJECT_PATH, 'b.txt'); FileSystem.writeFile(tempFilePath1, 'a'); FileSystem.writeFile(tempFilePath2, 'a'); - const results: Map = getRepoState(__dirname); + const results: Map = await getRepoStateAsync(__dirname); const filteredResults: Map = getRelevantEntries(results); try { @@ -168,12 +168,12 @@ describe(getRepoState.name, () => { } }); - it('can handle removing one file', () => { + it('can handle removing one file', async () => { const testFilePath: string = path.join(TEST_PROJECT_PATH, 'file1.txt'); FileSystem.deleteFile(testFilePath); - const results: Map = getRepoState(__dirname); + const results: Map = await getRepoStateAsync(__dirname); const filteredResults: Map = getRelevantEntries(results); try { @@ -199,12 +199,12 @@ describe(getRepoState.name, () => { } }); - it('can handle changing one file', () => { + it('can handle changing one file', async () => { const testFilePath: string = path.join(TEST_PROJECT_PATH, 'file1.txt'); FileSystem.writeFile(testFilePath, 'abc'); - const results: Map = getRepoState(__dirname); + const results: Map = await getRepoStateAsync(__dirname); const filteredResults: Map = getRelevantEntries(results); try { @@ -231,7 +231,7 @@ describe(getRepoState.name, () => { } }); - it('can handle uncommitted filenames with spaces and non-ASCII characters', () => { + it('can handle uncommitted filenames with spaces and non-ASCII characters', async () => { const tempFilePath1: string = path.join(TEST_PROJECT_PATH, 'a file.txt'); const tempFilePath2: string = path.join(TEST_PROJECT_PATH, 'a file name.txt'); const tempFilePath3: string = path.join(TEST_PROJECT_PATH, 'newFile批把.txt'); @@ -240,7 +240,7 @@ describe(getRepoState.name, () => { FileSystem.writeFile(tempFilePath2, 'a'); FileSystem.writeFile(tempFilePath3, 'a'); - const results: Map = getRepoState(__dirname); + const results: Map = await getRepoStateAsync(__dirname); const filteredResults: Map = getRelevantEntries(results); try { @@ -268,4 +268,36 @@ describe(getRepoState.name, () => { FileSystem.deleteFile(tempFilePath3); } }); + + it('handles requests for additional files', async () => { + const tempFilePath1: string = path.join(TEST_PROJECT_PATH, 'log.log'); + + FileSystem.writeFile(tempFilePath1, 'a'); + + const results: Map = await getRepoStateAsync(__dirname, [ + `${TEST_PREFIX}testProject/log.log` + ]); + const filteredResults: Map = getRelevantEntries(results); + + try { + const expectedFiles: Map = new Map( + Object.entries({ + 'nestedTestProject/src/file 1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', + [`nestedTestProject/${FileConstants.PackageJson}`]: '18a1e415e56220fa5122428a4ef8eb8874756576', + 'testProject/file1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', + 'testProject/file 2.txt': 'a385f754ec4fede884a4864d090064d9aeef8ccb', + 'testProject/file蝴蝶.txt': 'ae814af81e16cb2ae8c57503c77e2cab6b5462ba', + 'testProject/log.log': '2e65efe2a145dda7ee51d1741299f848e5bf752e', + [`testProject/${FileConstants.PackageJson}`]: '18a1e415e56220fa5122428a4ef8eb8874756576' + }) + ); + + for (const [filePath, hash] of expectedFiles) { + expect(filteredResults.get(filePath)).toEqual(hash); + } + expect(filteredResults.size).toEqual(expectedFiles.size); + } finally { + FileSystem.deleteFile(tempFilePath1); + } + }); }); From bcabf3f7051daf1b8162ef0d8d5496594ec8accd Mon Sep 17 00:00:00 2001 From: David Michon Date: Wed, 18 Jan 2023 14:11:31 -0800 Subject: [PATCH 052/167] Fix root directory in unit test --- .../src/test/getRepoDeps.test.ts | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/libraries/package-deps-hash/src/test/getRepoDeps.test.ts b/libraries/package-deps-hash/src/test/getRepoDeps.test.ts index ad300570af6..1c0eb9832ea 100644 --- a/libraries/package-deps-hash/src/test/getRepoDeps.test.ts +++ b/libraries/package-deps-hash/src/test/getRepoDeps.test.ts @@ -85,7 +85,8 @@ describe(parseGitLsTree.name, () => { describe(getRepoStateAsync.name, () => { it('can parse committed files', async () => { - const results: Map = await getRepoStateAsync(__dirname); + const repoRoot: string = getRepoRoot(__dirname); + const results: Map = await getRepoStateAsync(repoRoot); const filteredResults: Map = getRelevantEntries(results); const expectedFiles: Map = new Map( Object.entries({ @@ -109,7 +110,8 @@ describe(getRepoStateAsync.name, () => { FileSystem.writeFile(tempFilePath, 'a'); - const results: Map = await getRepoStateAsync(__dirname); + const repoRoot: string = getRepoRoot(__dirname); + const results: Map = await getRepoStateAsync(repoRoot); const filteredResults: Map = getRelevantEntries(results); try { @@ -141,7 +143,8 @@ describe(getRepoStateAsync.name, () => { FileSystem.writeFile(tempFilePath1, 'a'); FileSystem.writeFile(tempFilePath2, 'a'); - const results: Map = await getRepoStateAsync(__dirname); + const repoRoot: string = getRepoRoot(__dirname); + const results: Map = await getRepoStateAsync(repoRoot); const filteredResults: Map = getRelevantEntries(results); try { @@ -173,7 +176,8 @@ describe(getRepoStateAsync.name, () => { FileSystem.deleteFile(testFilePath); - const results: Map = await getRepoStateAsync(__dirname); + const repoRoot: string = getRepoRoot(__dirname); + const results: Map = await getRepoStateAsync(repoRoot); const filteredResults: Map = getRelevantEntries(results); try { @@ -204,7 +208,8 @@ describe(getRepoStateAsync.name, () => { FileSystem.writeFile(testFilePath, 'abc'); - const results: Map = await getRepoStateAsync(__dirname); + const repoRoot: string = getRepoRoot(__dirname); + const results: Map = await getRepoStateAsync(repoRoot); const filteredResults: Map = getRelevantEntries(results); try { @@ -240,7 +245,8 @@ describe(getRepoStateAsync.name, () => { FileSystem.writeFile(tempFilePath2, 'a'); FileSystem.writeFile(tempFilePath3, 'a'); - const results: Map = await getRepoStateAsync(__dirname); + const repoRoot: string = getRepoRoot(__dirname); + const results: Map = await getRepoStateAsync(repoRoot); const filteredResults: Map = getRelevantEntries(results); try { @@ -274,7 +280,8 @@ describe(getRepoStateAsync.name, () => { FileSystem.writeFile(tempFilePath1, 'a'); - const results: Map = await getRepoStateAsync(__dirname, [ + const repoRoot: string = getRepoRoot(__dirname); + const results: Map = await getRepoStateAsync(repoRoot, [ `${TEST_PREFIX}testProject/log.log` ]); const filteredResults: Map = getRelevantEntries(results); From bfa85fcf5d8134ef23e3bcfb24bc2b26e38538cf Mon Sep 17 00:00:00 2001 From: Rushbot Date: Wed, 18 Jan 2023 22:44:13 +0000 Subject: [PATCH 053/167] Update changelogs [skip ci] --- apps/api-documenter/CHANGELOG.json | 15 +++++++++++ apps/api-documenter/CHANGELOG.md | 7 ++++- apps/api-extractor/CHANGELOG.json | 12 +++++++++ apps/api-extractor/CHANGELOG.md | 9 ++++++- apps/heft/CHANGELOG.json | 12 +++++++++ apps/heft/CHANGELOG.md | 7 ++++- apps/lockfile-explorer/CHANGELOG.json | 15 +++++++++++ apps/lockfile-explorer/CHANGELOG.md | 7 ++++- apps/rundown/CHANGELOG.json | 15 +++++++++++ apps/rundown/CHANGELOG.md | 7 ++++- apps/trace-import/CHANGELOG.json | 15 +++++++++++ apps/trace-import/CHANGELOG.md | 7 ++++- .../check-flags_2023-01-16-22-41.json | 10 ------- .../bump-terser_2023-01-18-21-53.json | 10 ------- .../heft-dev-cert-plugin/CHANGELOG.json | 24 +++++++++++++++++ .../heft-dev-cert-plugin/CHANGELOG.md | 7 ++++- heft-plugins/heft-jest-plugin/CHANGELOG.json | 18 +++++++++++++ heft-plugins/heft-jest-plugin/CHANGELOG.md | 7 ++++- heft-plugins/heft-sass-plugin/CHANGELOG.json | 24 +++++++++++++++++ heft-plugins/heft-sass-plugin/CHANGELOG.md | 7 ++++- .../CHANGELOG.json | 18 +++++++++++++ .../heft-serverless-stack-plugin/CHANGELOG.md | 7 ++++- .../heft-storybook-plugin/CHANGELOG.json | 18 +++++++++++++ .../heft-storybook-plugin/CHANGELOG.md | 7 ++++- .../heft-webpack4-plugin/CHANGELOG.json | 18 +++++++++++++ .../heft-webpack4-plugin/CHANGELOG.md | 7 ++++- .../heft-webpack5-plugin/CHANGELOG.json | 18 +++++++++++++ .../heft-webpack5-plugin/CHANGELOG.md | 7 ++++- .../debug-certificate-manager/CHANGELOG.json | 15 +++++++++++ .../debug-certificate-manager/CHANGELOG.md | 7 ++++- libraries/load-themed-styles/CHANGELOG.json | 15 +++++++++++ libraries/load-themed-styles/CHANGELOG.md | 7 ++++- .../localization-utilities/CHANGELOG.json | 18 +++++++++++++ libraries/localization-utilities/CHANGELOG.md | 7 ++++- libraries/module-minifier/CHANGELOG.json | 23 ++++++++++++++++ libraries/module-minifier/CHANGELOG.md | 9 ++++++- libraries/package-deps-hash/CHANGELOG.json | 15 +++++++++++ libraries/package-deps-hash/CHANGELOG.md | 7 ++++- libraries/stream-collator/CHANGELOG.json | 18 +++++++++++++ libraries/stream-collator/CHANGELOG.md | 7 ++++- libraries/terminal/CHANGELOG.json | 15 +++++++++++ libraries/terminal/CHANGELOG.md | 7 ++++- libraries/typings-generator/CHANGELOG.json | 15 +++++++++++ libraries/typings-generator/CHANGELOG.md | 7 ++++- libraries/worker-pool/CHANGELOG.json | 15 +++++++++++ libraries/worker-pool/CHANGELOG.md | 7 ++++- rigs/heft-node-rig/CHANGELOG.json | 21 +++++++++++++++ rigs/heft-node-rig/CHANGELOG.md | 7 ++++- rigs/heft-web-rig/CHANGELOG.json | 27 +++++++++++++++++++ rigs/heft-web-rig/CHANGELOG.md | 7 ++++- rush-plugins/rush-serve-plugin/CHANGELOG.json | 18 +++++++++++++ rush-plugins/rush-serve-plugin/CHANGELOG.md | 7 ++++- .../hashed-folder-copy-plugin/CHANGELOG.json | 21 +++++++++++++++ .../hashed-folder-copy-plugin/CHANGELOG.md | 7 ++++- .../loader-load-themed-styles/CHANGELOG.json | 21 +++++++++++++++ .../loader-load-themed-styles/CHANGELOG.md | 7 ++++- webpack/loader-raw-script/CHANGELOG.json | 15 +++++++++++ webpack/loader-raw-script/CHANGELOG.md | 7 ++++- .../CHANGELOG.json | 15 +++++++++++ .../CHANGELOG.md | 7 ++++- .../CHANGELOG.json | 21 +++++++++++++++ .../CHANGELOG.md | 7 ++++- .../webpack-plugin-utilities/CHANGELOG.json | 15 +++++++++++ webpack/webpack-plugin-utilities/CHANGELOG.md | 7 ++++- .../CHANGELOG.json | 24 +++++++++++++++++ .../webpack4-localization-plugin/CHANGELOG.md | 7 ++++- .../CHANGELOG.json | 21 +++++++++++++++ .../CHANGELOG.md | 7 ++++- .../CHANGELOG.json | 21 +++++++++++++++ .../CHANGELOG.md | 7 ++++- .../CHANGELOG.json | 18 +++++++++++++ .../webpack5-localization-plugin/CHANGELOG.md | 7 ++++- .../CHANGELOG.json | 24 +++++++++++++++++ .../CHANGELOG.md | 7 ++++- 74 files changed, 873 insertions(+), 56 deletions(-) delete mode 100644 common/changes/@microsoft/api-extractor/check-flags_2023-01-16-22-41.json delete mode 100644 common/changes/@rushstack/module-minifier/bump-terser_2023-01-18-21-53.json diff --git a/apps/api-documenter/CHANGELOG.json b/apps/api-documenter/CHANGELOG.json index 9260ca79cc4..5c9cd718816 100644 --- a/apps/api-documenter/CHANGELOG.json +++ b/apps/api-documenter/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@microsoft/api-documenter", "entries": [ + { + "version": "7.19.28", + "tag": "@microsoft/api-documenter_v7.19.28", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "7.19.27", "tag": "@microsoft/api-documenter_v7.19.27", diff --git a/apps/api-documenter/CHANGELOG.md b/apps/api-documenter/CHANGELOG.md index 8cfe0f04a3f..60b8108497f 100644 --- a/apps/api-documenter/CHANGELOG.md +++ b/apps/api-documenter/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @microsoft/api-documenter -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 7.19.28 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 7.19.27 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/apps/api-extractor/CHANGELOG.json b/apps/api-extractor/CHANGELOG.json index 3679966fc7f..69964670c9c 100644 --- a/apps/api-extractor/CHANGELOG.json +++ b/apps/api-extractor/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@microsoft/api-extractor", "entries": [ + { + "version": "7.33.8", + "tag": "@microsoft/api-extractor_v7.33.8", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "patch": [ + { + "comment": "Use ts.getCheckFlags to fix TS 5.0" + } + ] + } + }, { "version": "7.33.7", "tag": "@microsoft/api-extractor_v7.33.7", diff --git a/apps/api-extractor/CHANGELOG.md b/apps/api-extractor/CHANGELOG.md index 63c4803d815..cc531ba4ef2 100644 --- a/apps/api-extractor/CHANGELOG.md +++ b/apps/api-extractor/CHANGELOG.md @@ -1,6 +1,13 @@ # Change Log - @microsoft/api-extractor -This log was last generated on Fri, 09 Dec 2022 16:18:28 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 7.33.8 +Wed, 18 Jan 2023 22:44:12 GMT + +### Patches + +- Use ts.getCheckFlags to fix TS 5.0 ## 7.33.7 Fri, 09 Dec 2022 16:18:28 GMT diff --git a/apps/heft/CHANGELOG.json b/apps/heft/CHANGELOG.json index 285854c3793..de2976036cb 100644 --- a/apps/heft/CHANGELOG.json +++ b/apps/heft/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@rushstack/heft", "entries": [ + { + "version": "0.49.1", + "tag": "@rushstack/heft_v0.49.1", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.33.8`" + } + ] + } + }, { "version": "0.49.0", "tag": "@rushstack/heft_v0.49.0", diff --git a/apps/heft/CHANGELOG.md b/apps/heft/CHANGELOG.md index 4e52b927b8d..48d9148cb95 100644 --- a/apps/heft/CHANGELOG.md +++ b/apps/heft/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/heft -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.49.1 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.49.0 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/apps/lockfile-explorer/CHANGELOG.json b/apps/lockfile-explorer/CHANGELOG.json index 68b323a757a..de29747386d 100644 --- a/apps/lockfile-explorer/CHANGELOG.json +++ b/apps/lockfile-explorer/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@rushstack/lockfile-explorer", "entries": [ + { + "version": "0.1.8", + "tag": "@rushstack/lockfile-explorer_v0.1.8", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + } + ] + } + }, { "version": "0.1.7", "tag": "@rushstack/lockfile-explorer_v0.1.7", diff --git a/apps/lockfile-explorer/CHANGELOG.md b/apps/lockfile-explorer/CHANGELOG.md index ade516ab586..3157147c98d 100644 --- a/apps/lockfile-explorer/CHANGELOG.md +++ b/apps/lockfile-explorer/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/lockfile-explorer -This log was last generated on Wed, 18 Jan 2023 05:02:16 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.1.8 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.1.7 Wed, 18 Jan 2023 05:02:16 GMT diff --git a/apps/rundown/CHANGELOG.json b/apps/rundown/CHANGELOG.json index 6c4c4e702da..5d1ccf0016e 100644 --- a/apps/rundown/CHANGELOG.json +++ b/apps/rundown/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@rushstack/rundown", "entries": [ + { + "version": "1.0.235", + "tag": "@rushstack/rundown_v1.0.235", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "1.0.234", "tag": "@rushstack/rundown_v1.0.234", diff --git a/apps/rundown/CHANGELOG.md b/apps/rundown/CHANGELOG.md index bd7420f94f5..32a9bd3a1df 100644 --- a/apps/rundown/CHANGELOG.md +++ b/apps/rundown/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/rundown -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 1.0.235 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 1.0.234 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/apps/trace-import/CHANGELOG.json b/apps/trace-import/CHANGELOG.json index b2373c2095d..3de96b3404f 100644 --- a/apps/trace-import/CHANGELOG.json +++ b/apps/trace-import/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@rushstack/trace-import", "entries": [ + { + "version": "0.1.3", + "tag": "@rushstack/trace-import_v0.1.3", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "0.1.2", "tag": "@rushstack/trace-import_v0.1.2", diff --git a/apps/trace-import/CHANGELOG.md b/apps/trace-import/CHANGELOG.md index 994d8bd875b..9ce804f40c6 100644 --- a/apps/trace-import/CHANGELOG.md +++ b/apps/trace-import/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/trace-import -This log was last generated on Tue, 20 Dec 2022 01:18:23 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.1.3 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.1.2 Tue, 20 Dec 2022 01:18:23 GMT diff --git a/common/changes/@microsoft/api-extractor/check-flags_2023-01-16-22-41.json b/common/changes/@microsoft/api-extractor/check-flags_2023-01-16-22-41.json deleted file mode 100644 index 917484fe346..00000000000 --- a/common/changes/@microsoft/api-extractor/check-flags_2023-01-16-22-41.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@microsoft/api-extractor", - "comment": "Use ts.getCheckFlags to fix TS 5.0", - "type": "patch" - } - ], - "packageName": "@microsoft/api-extractor" -} \ No newline at end of file diff --git a/common/changes/@rushstack/module-minifier/bump-terser_2023-01-18-21-53.json b/common/changes/@rushstack/module-minifier/bump-terser_2023-01-18-21-53.json deleted file mode 100644 index 9a7a664dbae..00000000000 --- a/common/changes/@rushstack/module-minifier/bump-terser_2023-01-18-21-53.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@rushstack/module-minifier", - "comment": "Update to terser 5.16.1", - "type": "patch" - } - ], - "packageName": "@rushstack/module-minifier" -} \ No newline at end of file diff --git a/heft-plugins/heft-dev-cert-plugin/CHANGELOG.json b/heft-plugins/heft-dev-cert-plugin/CHANGELOG.json index 0c027eaf816..8acf80f94ca 100644 --- a/heft-plugins/heft-dev-cert-plugin/CHANGELOG.json +++ b/heft-plugins/heft-dev-cert-plugin/CHANGELOG.json @@ -1,6 +1,30 @@ { "name": "@rushstack/heft-dev-cert-plugin", "entries": [ + { + "version": "0.2.10", + "tag": "@rushstack/heft-dev-cert-plugin_v0.2.10", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/debug-certificate-manager\" to `1.2.9`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.33.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.49.0` to `^0.49.1`" + } + ] + } + }, { "version": "0.2.9", "tag": "@rushstack/heft-dev-cert-plugin_v0.2.9", diff --git a/heft-plugins/heft-dev-cert-plugin/CHANGELOG.md b/heft-plugins/heft-dev-cert-plugin/CHANGELOG.md index c46b3d6c57a..817ff6ca076 100644 --- a/heft-plugins/heft-dev-cert-plugin/CHANGELOG.md +++ b/heft-plugins/heft-dev-cert-plugin/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/heft-dev-cert-plugin -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.2.10 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.2.9 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/heft-plugins/heft-jest-plugin/CHANGELOG.json b/heft-plugins/heft-jest-plugin/CHANGELOG.json index a4ff6a13c19..3553217290f 100644 --- a/heft-plugins/heft-jest-plugin/CHANGELOG.json +++ b/heft-plugins/heft-jest-plugin/CHANGELOG.json @@ -1,6 +1,24 @@ { "name": "@rushstack/heft-jest-plugin", "entries": [ + { + "version": "0.4.3", + "tag": "@rushstack/heft-jest-plugin_v0.4.3", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.33.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.49.0` to `^0.49.1`" + } + ] + } + }, { "version": "0.4.2", "tag": "@rushstack/heft-jest-plugin_v0.4.2", diff --git a/heft-plugins/heft-jest-plugin/CHANGELOG.md b/heft-plugins/heft-jest-plugin/CHANGELOG.md index 2312dca96f4..693cb587b9d 100644 --- a/heft-plugins/heft-jest-plugin/CHANGELOG.md +++ b/heft-plugins/heft-jest-plugin/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/heft-jest-plugin -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.4.3 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.4.2 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/heft-plugins/heft-sass-plugin/CHANGELOG.json b/heft-plugins/heft-sass-plugin/CHANGELOG.json index 3d7c63a12a8..984494a049c 100644 --- a/heft-plugins/heft-sass-plugin/CHANGELOG.json +++ b/heft-plugins/heft-sass-plugin/CHANGELOG.json @@ -1,6 +1,30 @@ { "name": "@rushstack/heft-sass-plugin", "entries": [ + { + "version": "0.7.6", + "tag": "@rushstack/heft-sass-plugin_v0.7.6", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.8.15`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.33.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.49.0` to `^0.49.1`" + } + ] + } + }, { "version": "0.7.5", "tag": "@rushstack/heft-sass-plugin_v0.7.5", diff --git a/heft-plugins/heft-sass-plugin/CHANGELOG.md b/heft-plugins/heft-sass-plugin/CHANGELOG.md index 4b8897d9897..77bffca8609 100644 --- a/heft-plugins/heft-sass-plugin/CHANGELOG.md +++ b/heft-plugins/heft-sass-plugin/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/heft-sass-plugin -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.7.6 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.7.5 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/heft-plugins/heft-serverless-stack-plugin/CHANGELOG.json b/heft-plugins/heft-serverless-stack-plugin/CHANGELOG.json index 2465f4bb05e..9dae037a7db 100644 --- a/heft-plugins/heft-serverless-stack-plugin/CHANGELOG.json +++ b/heft-plugins/heft-serverless-stack-plugin/CHANGELOG.json @@ -1,6 +1,24 @@ { "name": "@rushstack/heft-serverless-stack-plugin", "entries": [ + { + "version": "0.1.61", + "tag": "@rushstack/heft-serverless-stack-plugin_v0.1.61", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.49.0` to `^0.49.1`" + } + ] + } + }, { "version": "0.1.60", "tag": "@rushstack/heft-serverless-stack-plugin_v0.1.60", diff --git a/heft-plugins/heft-serverless-stack-plugin/CHANGELOG.md b/heft-plugins/heft-serverless-stack-plugin/CHANGELOG.md index 6bfeeafb037..27c1d5b6b22 100644 --- a/heft-plugins/heft-serverless-stack-plugin/CHANGELOG.md +++ b/heft-plugins/heft-serverless-stack-plugin/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/heft-serverless-stack-plugin -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.1.61 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.1.60 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/heft-plugins/heft-storybook-plugin/CHANGELOG.json b/heft-plugins/heft-storybook-plugin/CHANGELOG.json index 9b3637929f9..7883e31b3b9 100644 --- a/heft-plugins/heft-storybook-plugin/CHANGELOG.json +++ b/heft-plugins/heft-storybook-plugin/CHANGELOG.json @@ -1,6 +1,24 @@ { "name": "@rushstack/heft-storybook-plugin", "entries": [ + { + "version": "0.1.95", + "tag": "@rushstack/heft-storybook-plugin_v0.1.95", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.49.0` to `^0.49.1`" + } + ] + } + }, { "version": "0.1.94", "tag": "@rushstack/heft-storybook-plugin_v0.1.94", diff --git a/heft-plugins/heft-storybook-plugin/CHANGELOG.md b/heft-plugins/heft-storybook-plugin/CHANGELOG.md index 5dbc6750a66..b4102fa1db4 100644 --- a/heft-plugins/heft-storybook-plugin/CHANGELOG.md +++ b/heft-plugins/heft-storybook-plugin/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/heft-storybook-plugin -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.1.95 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.1.94 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/heft-plugins/heft-webpack4-plugin/CHANGELOG.json b/heft-plugins/heft-webpack4-plugin/CHANGELOG.json index 857753e9c1f..4a576b60f7e 100644 --- a/heft-plugins/heft-webpack4-plugin/CHANGELOG.json +++ b/heft-plugins/heft-webpack4-plugin/CHANGELOG.json @@ -1,6 +1,24 @@ { "name": "@rushstack/heft-webpack4-plugin", "entries": [ + { + "version": "0.5.32", + "tag": "@rushstack/heft-webpack4-plugin_v0.5.32", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.49.0` to `^0.49.1`" + } + ] + } + }, { "version": "0.5.31", "tag": "@rushstack/heft-webpack4-plugin_v0.5.31", diff --git a/heft-plugins/heft-webpack4-plugin/CHANGELOG.md b/heft-plugins/heft-webpack4-plugin/CHANGELOG.md index 526036c966f..abe0412e37e 100644 --- a/heft-plugins/heft-webpack4-plugin/CHANGELOG.md +++ b/heft-plugins/heft-webpack4-plugin/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/heft-webpack4-plugin -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.5.32 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.5.31 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/heft-plugins/heft-webpack5-plugin/CHANGELOG.json b/heft-plugins/heft-webpack5-plugin/CHANGELOG.json index 272f48d8f9f..c9e3b51bbcd 100644 --- a/heft-plugins/heft-webpack5-plugin/CHANGELOG.json +++ b/heft-plugins/heft-webpack5-plugin/CHANGELOG.json @@ -1,6 +1,24 @@ { "name": "@rushstack/heft-webpack5-plugin", "entries": [ + { + "version": "0.5.66", + "tag": "@rushstack/heft-webpack5-plugin_v0.5.66", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.49.0` to `^0.49.1`" + } + ] + } + }, { "version": "0.5.65", "tag": "@rushstack/heft-webpack5-plugin_v0.5.65", diff --git a/heft-plugins/heft-webpack5-plugin/CHANGELOG.md b/heft-plugins/heft-webpack5-plugin/CHANGELOG.md index 7972895dd04..f63a9a0c37a 100644 --- a/heft-plugins/heft-webpack5-plugin/CHANGELOG.md +++ b/heft-plugins/heft-webpack5-plugin/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/heft-webpack5-plugin -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.5.66 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.5.65 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/libraries/debug-certificate-manager/CHANGELOG.json b/libraries/debug-certificate-manager/CHANGELOG.json index 96939d4a332..1d55e4ff504 100644 --- a/libraries/debug-certificate-manager/CHANGELOG.json +++ b/libraries/debug-certificate-manager/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@rushstack/debug-certificate-manager", "entries": [ + { + "version": "1.2.9", + "tag": "@rushstack/debug-certificate-manager_v1.2.9", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "1.2.8", "tag": "@rushstack/debug-certificate-manager_v1.2.8", diff --git a/libraries/debug-certificate-manager/CHANGELOG.md b/libraries/debug-certificate-manager/CHANGELOG.md index 38e0e443d03..f857335780b 100644 --- a/libraries/debug-certificate-manager/CHANGELOG.md +++ b/libraries/debug-certificate-manager/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/debug-certificate-manager -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 1.2.9 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 1.2.8 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/libraries/load-themed-styles/CHANGELOG.json b/libraries/load-themed-styles/CHANGELOG.json index 3287617c0f7..0dcc2acd5b9 100644 --- a/libraries/load-themed-styles/CHANGELOG.json +++ b/libraries/load-themed-styles/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@microsoft/load-themed-styles", "entries": [ + { + "version": "2.0.20", + "tag": "@microsoft/load-themed-styles_v2.0.20", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-web-rig\" to `0.12.17`" + } + ] + } + }, { "version": "2.0.19", "tag": "@microsoft/load-themed-styles_v2.0.19", diff --git a/libraries/load-themed-styles/CHANGELOG.md b/libraries/load-themed-styles/CHANGELOG.md index 76ff4762a85..b6b676d7e9d 100644 --- a/libraries/load-themed-styles/CHANGELOG.md +++ b/libraries/load-themed-styles/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @microsoft/load-themed-styles -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 2.0.20 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 2.0.19 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/libraries/localization-utilities/CHANGELOG.json b/libraries/localization-utilities/CHANGELOG.json index 92ed6732347..ac7a2692408 100644 --- a/libraries/localization-utilities/CHANGELOG.json +++ b/libraries/localization-utilities/CHANGELOG.json @@ -1,6 +1,24 @@ { "name": "@rushstack/localization-utilities", "entries": [ + { + "version": "0.8.39", + "tag": "@rushstack/localization-utilities_v0.8.39", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.8.15`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "0.8.38", "tag": "@rushstack/localization-utilities_v0.8.38", diff --git a/libraries/localization-utilities/CHANGELOG.md b/libraries/localization-utilities/CHANGELOG.md index 81bba60d764..2ef3ce010fe 100644 --- a/libraries/localization-utilities/CHANGELOG.md +++ b/libraries/localization-utilities/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/localization-utilities -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.8.39 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.8.38 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/libraries/module-minifier/CHANGELOG.json b/libraries/module-minifier/CHANGELOG.json index d0eabbb98c3..ed9120976f7 100644 --- a/libraries/module-minifier/CHANGELOG.json +++ b/libraries/module-minifier/CHANGELOG.json @@ -1,6 +1,29 @@ { "name": "@rushstack/module-minifier", "entries": [ + { + "version": "0.1.45", + "tag": "@rushstack/module-minifier_v0.1.45", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "patch": [ + { + "comment": "Update to terser 5.16.1" + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.1.45`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "0.1.44", "tag": "@rushstack/module-minifier_v0.1.44", diff --git a/libraries/module-minifier/CHANGELOG.md b/libraries/module-minifier/CHANGELOG.md index c208b81f2dd..4d290ad6007 100644 --- a/libraries/module-minifier/CHANGELOG.md +++ b/libraries/module-minifier/CHANGELOG.md @@ -1,6 +1,13 @@ # Change Log - @rushstack/module-minifier -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.1.45 +Wed, 18 Jan 2023 22:44:12 GMT + +### Patches + +- Update to terser 5.16.1 ## 0.1.44 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/libraries/package-deps-hash/CHANGELOG.json b/libraries/package-deps-hash/CHANGELOG.json index c50d888d71c..6e576041eb0 100644 --- a/libraries/package-deps-hash/CHANGELOG.json +++ b/libraries/package-deps-hash/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@rushstack/package-deps-hash", "entries": [ + { + "version": "3.2.67", + "tag": "@rushstack/package-deps-hash_v3.2.67", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "3.2.66", "tag": "@rushstack/package-deps-hash_v3.2.66", diff --git a/libraries/package-deps-hash/CHANGELOG.md b/libraries/package-deps-hash/CHANGELOG.md index 70ba9b64e80..e33ddd7582d 100644 --- a/libraries/package-deps-hash/CHANGELOG.md +++ b/libraries/package-deps-hash/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/package-deps-hash -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 3.2.67 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 3.2.66 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/libraries/stream-collator/CHANGELOG.json b/libraries/stream-collator/CHANGELOG.json index f2e5592ed5c..df2cb8776b7 100644 --- a/libraries/stream-collator/CHANGELOG.json +++ b/libraries/stream-collator/CHANGELOG.json @@ -1,6 +1,24 @@ { "name": "@rushstack/stream-collator", "entries": [ + { + "version": "4.0.220", + "tag": "@rushstack/stream-collator_v4.0.220", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.3.89`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "4.0.219", "tag": "@rushstack/stream-collator_v4.0.219", diff --git a/libraries/stream-collator/CHANGELOG.md b/libraries/stream-collator/CHANGELOG.md index 1a45d24d6e6..642da910ad9 100644 --- a/libraries/stream-collator/CHANGELOG.md +++ b/libraries/stream-collator/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/stream-collator -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 4.0.220 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 4.0.219 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/libraries/terminal/CHANGELOG.json b/libraries/terminal/CHANGELOG.json index dd514c09bfa..f298085eb37 100644 --- a/libraries/terminal/CHANGELOG.json +++ b/libraries/terminal/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@rushstack/terminal", "entries": [ + { + "version": "0.3.89", + "tag": "@rushstack/terminal_v0.3.89", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "0.3.88", "tag": "@rushstack/terminal_v0.3.88", diff --git a/libraries/terminal/CHANGELOG.md b/libraries/terminal/CHANGELOG.md index 187c8426d09..b343d7f9fe3 100644 --- a/libraries/terminal/CHANGELOG.md +++ b/libraries/terminal/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/terminal -This log was last generated on Tue, 20 Dec 2022 01:18:23 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.3.89 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.3.88 Tue, 20 Dec 2022 01:18:23 GMT diff --git a/libraries/typings-generator/CHANGELOG.json b/libraries/typings-generator/CHANGELOG.json index ed24eecd5d2..5e1c6c098e1 100644 --- a/libraries/typings-generator/CHANGELOG.json +++ b/libraries/typings-generator/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@rushstack/typings-generator", "entries": [ + { + "version": "0.8.15", + "tag": "@rushstack/typings-generator_v0.8.15", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "0.8.14", "tag": "@rushstack/typings-generator_v0.8.14", diff --git a/libraries/typings-generator/CHANGELOG.md b/libraries/typings-generator/CHANGELOG.md index 63424ecfa66..5c17f26fe8e 100644 --- a/libraries/typings-generator/CHANGELOG.md +++ b/libraries/typings-generator/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/typings-generator -This log was last generated on Tue, 20 Dec 2022 01:18:23 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.8.15 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.8.14 Tue, 20 Dec 2022 01:18:23 GMT diff --git a/libraries/worker-pool/CHANGELOG.json b/libraries/worker-pool/CHANGELOG.json index fef2a01dc17..aadd05e9a98 100644 --- a/libraries/worker-pool/CHANGELOG.json +++ b/libraries/worker-pool/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@rushstack/worker-pool", "entries": [ + { + "version": "0.1.45", + "tag": "@rushstack/worker-pool_v0.1.45", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "0.1.44", "tag": "@rushstack/worker-pool_v0.1.44", diff --git a/libraries/worker-pool/CHANGELOG.md b/libraries/worker-pool/CHANGELOG.md index b8048b32f3e..4cbb5b69800 100644 --- a/libraries/worker-pool/CHANGELOG.md +++ b/libraries/worker-pool/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/worker-pool -This log was last generated on Tue, 20 Dec 2022 01:18:23 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.1.45 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.1.44 Tue, 20 Dec 2022 01:18:23 GMT diff --git a/rigs/heft-node-rig/CHANGELOG.json b/rigs/heft-node-rig/CHANGELOG.json index 4a9cc8e7c47..a08cc4a2a7a 100644 --- a/rigs/heft-node-rig/CHANGELOG.json +++ b/rigs/heft-node-rig/CHANGELOG.json @@ -1,6 +1,27 @@ { "name": "@rushstack/heft-node-rig", "entries": [ + { + "version": "1.11.12", + "tag": "@rushstack/heft-node-rig_v1.11.12", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.33.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-jest-plugin\" to `0.4.3`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.49.0` to `^0.49.1`" + } + ] + } + }, { "version": "1.11.11", "tag": "@rushstack/heft-node-rig_v1.11.11", diff --git a/rigs/heft-node-rig/CHANGELOG.md b/rigs/heft-node-rig/CHANGELOG.md index a0f0dcb9f96..7ec10c897f6 100644 --- a/rigs/heft-node-rig/CHANGELOG.md +++ b/rigs/heft-node-rig/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/heft-node-rig -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 1.11.12 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 1.11.11 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/rigs/heft-web-rig/CHANGELOG.json b/rigs/heft-web-rig/CHANGELOG.json index 51cdc028060..d6c8bed900b 100644 --- a/rigs/heft-web-rig/CHANGELOG.json +++ b/rigs/heft-web-rig/CHANGELOG.json @@ -1,6 +1,33 @@ { "name": "@rushstack/heft-web-rig", "entries": [ + { + "version": "0.12.17", + "tag": "@rushstack/heft-web-rig_v0.12.17", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.33.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-jest-plugin\" to `0.4.3`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-sass-plugin\" to `0.7.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.5.66`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.49.0` to `^0.49.1`" + } + ] + } + }, { "version": "0.12.16", "tag": "@rushstack/heft-web-rig_v0.12.16", diff --git a/rigs/heft-web-rig/CHANGELOG.md b/rigs/heft-web-rig/CHANGELOG.md index 849aa158884..eaf7796577a 100644 --- a/rigs/heft-web-rig/CHANGELOG.md +++ b/rigs/heft-web-rig/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/heft-web-rig -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.12.17 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.12.16 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/rush-plugins/rush-serve-plugin/CHANGELOG.json b/rush-plugins/rush-serve-plugin/CHANGELOG.json index 146ac7242a4..a9890ed94a2 100644 --- a/rush-plugins/rush-serve-plugin/CHANGELOG.json +++ b/rush-plugins/rush-serve-plugin/CHANGELOG.json @@ -1,6 +1,24 @@ { "name": "@rushstack/rush-serve-plugin", "entries": [ + { + "version": "0.3.9", + "tag": "@rushstack/rush-serve-plugin_v0.3.9", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/debug-certificate-manager\" to `1.2.9`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "0.3.8", "tag": "@rushstack/rush-serve-plugin_v0.3.8", diff --git a/rush-plugins/rush-serve-plugin/CHANGELOG.md b/rush-plugins/rush-serve-plugin/CHANGELOG.md index 927c86ff357..ae42e7e70df 100644 --- a/rush-plugins/rush-serve-plugin/CHANGELOG.md +++ b/rush-plugins/rush-serve-plugin/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/rush-serve-plugin -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.3.9 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.3.8 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/webpack/hashed-folder-copy-plugin/CHANGELOG.json b/webpack/hashed-folder-copy-plugin/CHANGELOG.json index 46db3868c98..c87656452eb 100644 --- a/webpack/hashed-folder-copy-plugin/CHANGELOG.json +++ b/webpack/hashed-folder-copy-plugin/CHANGELOG.json @@ -1,6 +1,27 @@ { "name": "@rushstack/hashed-folder-copy-plugin", "entries": [ + { + "version": "0.1.53", + "tag": "@rushstack/hashed-folder-copy-plugin_v0.1.53", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/webpack-plugin-utilities\" to `0.1.49`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.5.66`" + } + ] + } + }, { "version": "0.1.52", "tag": "@rushstack/hashed-folder-copy-plugin_v0.1.52", diff --git a/webpack/hashed-folder-copy-plugin/CHANGELOG.md b/webpack/hashed-folder-copy-plugin/CHANGELOG.md index a5371db42bc..838a23cfe37 100644 --- a/webpack/hashed-folder-copy-plugin/CHANGELOG.md +++ b/webpack/hashed-folder-copy-plugin/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/hashed-folder-copy-plugin -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.1.53 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.1.52 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/webpack/loader-load-themed-styles/CHANGELOG.json b/webpack/loader-load-themed-styles/CHANGELOG.json index da85e9ed9af..1f1abcb1cf3 100644 --- a/webpack/loader-load-themed-styles/CHANGELOG.json +++ b/webpack/loader-load-themed-styles/CHANGELOG.json @@ -1,6 +1,27 @@ { "name": "@microsoft/loader-load-themed-styles", "entries": [ + { + "version": "2.0.18", + "tag": "@microsoft/loader-load-themed-styles_v2.0.18", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.0.20`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.0.19` to `^2.0.20`" + } + ] + } + }, { "version": "2.0.17", "tag": "@microsoft/loader-load-themed-styles_v2.0.17", diff --git a/webpack/loader-load-themed-styles/CHANGELOG.md b/webpack/loader-load-themed-styles/CHANGELOG.md index eef9d2d164d..27da63a644d 100644 --- a/webpack/loader-load-themed-styles/CHANGELOG.md +++ b/webpack/loader-load-themed-styles/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @microsoft/loader-load-themed-styles -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 2.0.18 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 2.0.17 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/webpack/loader-raw-script/CHANGELOG.json b/webpack/loader-raw-script/CHANGELOG.json index 45bae0b301f..8a8e7817518 100644 --- a/webpack/loader-raw-script/CHANGELOG.json +++ b/webpack/loader-raw-script/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@rushstack/loader-raw-script", "entries": [ + { + "version": "1.3.274", + "tag": "@rushstack/loader-raw-script_v1.3.274", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "1.3.273", "tag": "@rushstack/loader-raw-script_v1.3.273", diff --git a/webpack/loader-raw-script/CHANGELOG.md b/webpack/loader-raw-script/CHANGELOG.md index 4653ce6e383..cc5e5bc9e23 100644 --- a/webpack/loader-raw-script/CHANGELOG.md +++ b/webpack/loader-raw-script/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/loader-raw-script -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 1.3.274 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 1.3.273 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/webpack/preserve-dynamic-require-plugin/CHANGELOG.json b/webpack/preserve-dynamic-require-plugin/CHANGELOG.json index d14cafbc68b..ca69a8f04f4 100644 --- a/webpack/preserve-dynamic-require-plugin/CHANGELOG.json +++ b/webpack/preserve-dynamic-require-plugin/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@rushstack/webpack-preserve-dynamic-require-plugin", "entries": [ + { + "version": "0.9.49", + "tag": "@rushstack/webpack-preserve-dynamic-require-plugin_v0.9.49", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "0.9.48", "tag": "@rushstack/webpack-preserve-dynamic-require-plugin_v0.9.48", diff --git a/webpack/preserve-dynamic-require-plugin/CHANGELOG.md b/webpack/preserve-dynamic-require-plugin/CHANGELOG.md index e82e1d77169..03cd2625715 100644 --- a/webpack/preserve-dynamic-require-plugin/CHANGELOG.md +++ b/webpack/preserve-dynamic-require-plugin/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/webpack-preserve-dynamic-require-plugin -This log was last generated on Tue, 20 Dec 2022 01:18:23 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.9.49 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.9.48 Tue, 20 Dec 2022 01:18:23 GMT diff --git a/webpack/set-webpack-public-path-plugin/CHANGELOG.json b/webpack/set-webpack-public-path-plugin/CHANGELOG.json index e6bf57cfb7f..392a04cf153 100644 --- a/webpack/set-webpack-public-path-plugin/CHANGELOG.json +++ b/webpack/set-webpack-public-path-plugin/CHANGELOG.json @@ -1,6 +1,27 @@ { "name": "@rushstack/set-webpack-public-path-plugin", "entries": [ + { + "version": "3.3.84", + "tag": "@rushstack/set-webpack-public-path-plugin_v3.3.84", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/webpack-plugin-utilities\" to `0.1.49`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.5.66`" + } + ] + } + }, { "version": "3.3.83", "tag": "@rushstack/set-webpack-public-path-plugin_v3.3.83", diff --git a/webpack/set-webpack-public-path-plugin/CHANGELOG.md b/webpack/set-webpack-public-path-plugin/CHANGELOG.md index 78cc696ace8..edb9c51c190 100644 --- a/webpack/set-webpack-public-path-plugin/CHANGELOG.md +++ b/webpack/set-webpack-public-path-plugin/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/set-webpack-public-path-plugin -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 3.3.84 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 3.3.83 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/webpack/webpack-plugin-utilities/CHANGELOG.json b/webpack/webpack-plugin-utilities/CHANGELOG.json index 8fa46649190..b961cc86ae6 100644 --- a/webpack/webpack-plugin-utilities/CHANGELOG.json +++ b/webpack/webpack-plugin-utilities/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@rushstack/webpack-plugin-utilities", "entries": [ + { + "version": "0.1.49", + "tag": "@rushstack/webpack-plugin-utilities_v0.1.49", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "0.1.48", "tag": "@rushstack/webpack-plugin-utilities_v0.1.48", diff --git a/webpack/webpack-plugin-utilities/CHANGELOG.md b/webpack/webpack-plugin-utilities/CHANGELOG.md index 696e5d7064a..9da7b28bc7f 100644 --- a/webpack/webpack-plugin-utilities/CHANGELOG.md +++ b/webpack/webpack-plugin-utilities/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/webpack-plugin-utilities -This log was last generated on Tue, 20 Dec 2022 01:18:23 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.1.49 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.1.48 Tue, 20 Dec 2022 01:18:23 GMT diff --git a/webpack/webpack4-localization-plugin/CHANGELOG.json b/webpack/webpack4-localization-plugin/CHANGELOG.json index 66a55363c55..f4d3222e491 100644 --- a/webpack/webpack4-localization-plugin/CHANGELOG.json +++ b/webpack/webpack4-localization-plugin/CHANGELOG.json @@ -1,6 +1,30 @@ { "name": "@rushstack/webpack4-localization-plugin", "entries": [ + { + "version": "0.15.42", + "tag": "@rushstack/webpack4-localization-plugin_v0.15.42", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/localization-utilities\" to `0.8.39`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + }, + { + "comment": "Updating dependency \"@rushstack/set-webpack-public-path-plugin\" to `3.3.84`" + }, + { + "comment": "Updating dependency \"@rushstack/set-webpack-public-path-plugin\" from `^3.3.83` to `^3.3.84`" + } + ] + } + }, { "version": "0.15.41", "tag": "@rushstack/webpack4-localization-plugin_v0.15.41", diff --git a/webpack/webpack4-localization-plugin/CHANGELOG.md b/webpack/webpack4-localization-plugin/CHANGELOG.md index 47408537714..c8d8a1dffba 100644 --- a/webpack/webpack4-localization-plugin/CHANGELOG.md +++ b/webpack/webpack4-localization-plugin/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/webpack4-localization-plugin -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.15.42 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.15.41 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/webpack/webpack4-module-minifier-plugin/CHANGELOG.json b/webpack/webpack4-module-minifier-plugin/CHANGELOG.json index 1bcd2a429a6..7bffa1bd330 100644 --- a/webpack/webpack4-module-minifier-plugin/CHANGELOG.json +++ b/webpack/webpack4-module-minifier-plugin/CHANGELOG.json @@ -1,6 +1,27 @@ { "name": "@rushstack/webpack4-module-minifier-plugin", "entries": [ + { + "version": "0.9.44", + "tag": "@rushstack/webpack4-module-minifier-plugin_v0.9.44", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.1.45`" + }, + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.1.45`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "0.9.43", "tag": "@rushstack/webpack4-module-minifier-plugin_v0.9.43", diff --git a/webpack/webpack4-module-minifier-plugin/CHANGELOG.md b/webpack/webpack4-module-minifier-plugin/CHANGELOG.md index e9d2757da01..c8fbad12b10 100644 --- a/webpack/webpack4-module-minifier-plugin/CHANGELOG.md +++ b/webpack/webpack4-module-minifier-plugin/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/webpack4-module-minifier-plugin -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.9.44 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.9.43 Tue, 20 Dec 2022 01:18:22 GMT diff --git a/webpack/webpack5-load-themed-styles-loader/CHANGELOG.json b/webpack/webpack5-load-themed-styles-loader/CHANGELOG.json index d9da6b10a2c..5bb3acc5090 100644 --- a/webpack/webpack5-load-themed-styles-loader/CHANGELOG.json +++ b/webpack/webpack5-load-themed-styles-loader/CHANGELOG.json @@ -1,6 +1,27 @@ { "name": "@microsoft/webpack5-load-themed-styles-loader", "entries": [ + { + "version": "0.1.2", + "tag": "@microsoft/webpack5-load-themed-styles-loader_v0.1.2", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.0.20`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.0.19` to `^2.0.20`" + } + ] + } + }, { "version": "0.1.1", "tag": "@microsoft/webpack5-load-themed-styles-loader_v0.1.1", diff --git a/webpack/webpack5-load-themed-styles-loader/CHANGELOG.md b/webpack/webpack5-load-themed-styles-loader/CHANGELOG.md index a09b04534a4..3efd6b9a5c3 100644 --- a/webpack/webpack5-load-themed-styles-loader/CHANGELOG.md +++ b/webpack/webpack5-load-themed-styles-loader/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @microsoft/webpack5-load-themed-styles-loader -This log was last generated on Wed, 11 Jan 2023 05:17:04 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.1.2 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.1.1 Wed, 11 Jan 2023 05:17:04 GMT diff --git a/webpack/webpack5-localization-plugin/CHANGELOG.json b/webpack/webpack5-localization-plugin/CHANGELOG.json index d5b7cff302b..9e3ebb186d7 100644 --- a/webpack/webpack5-localization-plugin/CHANGELOG.json +++ b/webpack/webpack5-localization-plugin/CHANGELOG.json @@ -1,6 +1,24 @@ { "name": "@rushstack/webpack5-localization-plugin", "entries": [ + { + "version": "0.2.1", + "tag": "@rushstack/webpack5-localization-plugin_v0.2.1", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/localization-utilities\" to `0.8.39`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + } + ] + } + }, { "version": "0.2.0", "tag": "@rushstack/webpack5-localization-plugin_v0.2.0", diff --git a/webpack/webpack5-localization-plugin/CHANGELOG.md b/webpack/webpack5-localization-plugin/CHANGELOG.md index 2c27b22c94f..06a61c8fb67 100644 --- a/webpack/webpack5-localization-plugin/CHANGELOG.md +++ b/webpack/webpack5-localization-plugin/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/webpack5-localization-plugin -This log was last generated on Tue, 20 Dec 2022 21:56:32 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 0.2.1 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 0.2.0 Tue, 20 Dec 2022 21:56:32 GMT diff --git a/webpack/webpack5-module-minifier-plugin/CHANGELOG.json b/webpack/webpack5-module-minifier-plugin/CHANGELOG.json index 2643cf37118..8347fac006d 100644 --- a/webpack/webpack5-module-minifier-plugin/CHANGELOG.json +++ b/webpack/webpack5-module-minifier-plugin/CHANGELOG.json @@ -1,6 +1,30 @@ { "name": "@rushstack/webpack5-module-minifier-plugin", "entries": [ + { + "version": "5.1.45", + "tag": "@rushstack/webpack5-module-minifier-plugin_v5.1.45", + "date": "Wed, 18 Jan 2023 22:44:12 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.1.45`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.49.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-node-rig\" to `1.11.12`" + }, + { + "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.1.45`" + }, + { + "comment": "Updating dependency \"@rushstack/module-minifier\" from `*` to `*`" + } + ] + } + }, { "version": "5.1.44", "tag": "@rushstack/webpack5-module-minifier-plugin_v5.1.44", diff --git a/webpack/webpack5-module-minifier-plugin/CHANGELOG.md b/webpack/webpack5-module-minifier-plugin/CHANGELOG.md index 77e16cc8953..8048f402f6b 100644 --- a/webpack/webpack5-module-minifier-plugin/CHANGELOG.md +++ b/webpack/webpack5-module-minifier-plugin/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/webpack5-module-minifier-plugin -This log was last generated on Tue, 20 Dec 2022 01:18:22 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:12 GMT and should not be manually modified. + +## 5.1.45 +Wed, 18 Jan 2023 22:44:12 GMT + +_Version update only_ ## 5.1.44 Tue, 20 Dec 2022 01:18:22 GMT From 5f78cf57f66cc8e4592049c68e92911f83c1c3f9 Mon Sep 17 00:00:00 2001 From: Rushbot Date: Wed, 18 Jan 2023 22:44:16 +0000 Subject: [PATCH 054/167] Bump versions [skip ci] --- apps/api-documenter/package.json | 2 +- apps/api-extractor/package.json | 2 +- apps/heft/package.json | 2 +- apps/lockfile-explorer/package.json | 2 +- apps/rundown/package.json | 2 +- apps/trace-import/package.json | 2 +- heft-plugins/heft-dev-cert-plugin/package.json | 4 ++-- heft-plugins/heft-jest-plugin/package.json | 4 ++-- heft-plugins/heft-sass-plugin/package.json | 4 ++-- heft-plugins/heft-serverless-stack-plugin/package.json | 4 ++-- heft-plugins/heft-storybook-plugin/package.json | 4 ++-- heft-plugins/heft-webpack4-plugin/package.json | 4 ++-- heft-plugins/heft-webpack5-plugin/package.json | 4 ++-- libraries/debug-certificate-manager/package.json | 2 +- libraries/load-themed-styles/package.json | 2 +- libraries/localization-utilities/package.json | 2 +- libraries/module-minifier/package.json | 2 +- libraries/package-deps-hash/package.json | 2 +- libraries/stream-collator/package.json | 2 +- libraries/terminal/package.json | 2 +- libraries/typings-generator/package.json | 2 +- libraries/worker-pool/package.json | 2 +- rigs/heft-node-rig/package.json | 4 ++-- rigs/heft-web-rig/package.json | 4 ++-- rush-plugins/rush-serve-plugin/package.json | 2 +- webpack/hashed-folder-copy-plugin/package.json | 2 +- webpack/loader-load-themed-styles/package.json | 4 ++-- webpack/loader-raw-script/package.json | 2 +- webpack/preserve-dynamic-require-plugin/package.json | 2 +- webpack/set-webpack-public-path-plugin/package.json | 2 +- webpack/webpack-plugin-utilities/package.json | 2 +- webpack/webpack4-localization-plugin/package.json | 4 ++-- webpack/webpack4-module-minifier-plugin/package.json | 2 +- webpack/webpack5-load-themed-styles-loader/package.json | 4 ++-- webpack/webpack5-localization-plugin/package.json | 2 +- webpack/webpack5-module-minifier-plugin/package.json | 2 +- 36 files changed, 48 insertions(+), 48 deletions(-) diff --git a/apps/api-documenter/package.json b/apps/api-documenter/package.json index d49bdbba493..818f00b2a2c 100644 --- a/apps/api-documenter/package.json +++ b/apps/api-documenter/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/api-documenter", - "version": "7.19.27", + "version": "7.19.28", "description": "Read JSON files from api-extractor, generate documentation pages", "repository": { "type": "git", diff --git a/apps/api-extractor/package.json b/apps/api-extractor/package.json index dbc1372be64..58df9517b0c 100644 --- a/apps/api-extractor/package.json +++ b/apps/api-extractor/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/api-extractor", - "version": "7.33.7", + "version": "7.33.8", "description": "Analyze the exported API for a TypeScript library and generate reviews, documentation, and .d.ts rollups", "keywords": [ "typescript", diff --git a/apps/heft/package.json b/apps/heft/package.json index fda3aae8c08..5e815ee53b8 100644 --- a/apps/heft/package.json +++ b/apps/heft/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft", - "version": "0.49.0", + "version": "0.49.1", "description": "Build all your JavaScript projects the same way: A way that works.", "keywords": [ "toolchain", diff --git a/apps/lockfile-explorer/package.json b/apps/lockfile-explorer/package.json index b6c56d682f6..abfe8910947 100644 --- a/apps/lockfile-explorer/package.json +++ b/apps/lockfile-explorer/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/lockfile-explorer", - "version": "0.1.7", + "version": "0.1.8", "description": "Rush Lockfile Explorer: The UI for solving version conflicts quickly in a large monorepo", "keywords": [ "conflict", diff --git a/apps/rundown/package.json b/apps/rundown/package.json index 55a9e9bebf7..285b90bdcb7 100644 --- a/apps/rundown/package.json +++ b/apps/rundown/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/rundown", - "version": "1.0.234", + "version": "1.0.235", "description": "Detect load time regressions by running an app, tracing require() calls, and generating a deterministic report", "repository": { "type": "git", diff --git a/apps/trace-import/package.json b/apps/trace-import/package.json index de68342d14c..5b94d30bd84 100644 --- a/apps/trace-import/package.json +++ b/apps/trace-import/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/trace-import", - "version": "0.1.2", + "version": "0.1.3", "description": "CLI tool for understanding how require() and \"import\" statements get resolved", "repository": { "type": "git", diff --git a/heft-plugins/heft-dev-cert-plugin/package.json b/heft-plugins/heft-dev-cert-plugin/package.json index 42c4b2b3559..3fb38825f80 100644 --- a/heft-plugins/heft-dev-cert-plugin/package.json +++ b/heft-plugins/heft-dev-cert-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-dev-cert-plugin", - "version": "0.2.9", + "version": "0.2.10", "description": "A Heft plugin for generating and using local development certificates", "repository": { "type": "git", @@ -18,7 +18,7 @@ "_phase:test": "heft test --no-build" }, "peerDependencies": { - "@rushstack/heft": "^0.49.0" + "@rushstack/heft": "^0.49.1" }, "dependencies": { "@rushstack/debug-certificate-manager": "workspace:*", diff --git a/heft-plugins/heft-jest-plugin/package.json b/heft-plugins/heft-jest-plugin/package.json index 88a40c2888a..eefa40e0d9d 100644 --- a/heft-plugins/heft-jest-plugin/package.json +++ b/heft-plugins/heft-jest-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-jest-plugin", - "version": "0.4.2", + "version": "0.4.3", "description": "Heft plugin for Jest", "repository": { "type": "git", @@ -18,7 +18,7 @@ "_phase:test": "heft test --no-build" }, "peerDependencies": { - "@rushstack/heft": "^0.49.0" + "@rushstack/heft": "^0.49.1" }, "dependencies": { "@jest/core": "~27.4.2", diff --git a/heft-plugins/heft-sass-plugin/package.json b/heft-plugins/heft-sass-plugin/package.json index af87978e12c..b87a6eaab61 100644 --- a/heft-plugins/heft-sass-plugin/package.json +++ b/heft-plugins/heft-sass-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-sass-plugin", - "version": "0.7.5", + "version": "0.7.6", "description": "Heft plugin for SASS", "repository": { "type": "git", @@ -18,7 +18,7 @@ "_phase:test": "heft test --no-build" }, "peerDependencies": { - "@rushstack/heft": "^0.49.0" + "@rushstack/heft": "^0.49.1" }, "dependencies": { "@rushstack/heft-config-file": "workspace:*", diff --git a/heft-plugins/heft-serverless-stack-plugin/package.json b/heft-plugins/heft-serverless-stack-plugin/package.json index 1e37d70ad58..6b4de35e12f 100644 --- a/heft-plugins/heft-serverless-stack-plugin/package.json +++ b/heft-plugins/heft-serverless-stack-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-serverless-stack-plugin", - "version": "0.1.60", + "version": "0.1.61", "description": "Heft plugin for building apps using the Serverless Stack (SST) framework", "repository": { "type": "git", @@ -17,7 +17,7 @@ "_phase:test": "heft test --no-build" }, "peerDependencies": { - "@rushstack/heft": "^0.49.0" + "@rushstack/heft": "^0.49.1" }, "dependencies": { "@rushstack/node-core-library": "workspace:*" diff --git a/heft-plugins/heft-storybook-plugin/package.json b/heft-plugins/heft-storybook-plugin/package.json index 4b37ad22474..fae47576a7d 100644 --- a/heft-plugins/heft-storybook-plugin/package.json +++ b/heft-plugins/heft-storybook-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-storybook-plugin", - "version": "0.1.94", + "version": "0.1.95", "description": "Heft plugin for supporting UI development using Storybook", "repository": { "type": "git", @@ -18,7 +18,7 @@ "_phase:test": "heft test --no-build" }, "peerDependencies": { - "@rushstack/heft": "^0.49.0" + "@rushstack/heft": "^0.49.1" }, "dependencies": { "@rushstack/node-core-library": "workspace:*" diff --git a/heft-plugins/heft-webpack4-plugin/package.json b/heft-plugins/heft-webpack4-plugin/package.json index c9ef4d4ad4f..1b447b45981 100644 --- a/heft-plugins/heft-webpack4-plugin/package.json +++ b/heft-plugins/heft-webpack4-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-webpack4-plugin", - "version": "0.5.31", + "version": "0.5.32", "description": "Heft plugin for Webpack 4", "repository": { "type": "git", @@ -23,7 +23,7 @@ } }, "peerDependencies": { - "@rushstack/heft": "^0.49.0", + "@rushstack/heft": "^0.49.1", "@types/webpack": "^4", "webpack": "~4.44.2" }, diff --git a/heft-plugins/heft-webpack5-plugin/package.json b/heft-plugins/heft-webpack5-plugin/package.json index 08838fc974d..169c1020055 100644 --- a/heft-plugins/heft-webpack5-plugin/package.json +++ b/heft-plugins/heft-webpack5-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-webpack5-plugin", - "version": "0.5.65", + "version": "0.5.66", "description": "Heft plugin for Webpack 5", "repository": { "type": "git", @@ -18,7 +18,7 @@ "_phase:test": "heft test --no-build" }, "peerDependencies": { - "@rushstack/heft": "^0.49.0", + "@rushstack/heft": "^0.49.1", "webpack": "~5.68.0" }, "dependencies": { diff --git a/libraries/debug-certificate-manager/package.json b/libraries/debug-certificate-manager/package.json index d484a8d09ed..d58b94ac5a3 100644 --- a/libraries/debug-certificate-manager/package.json +++ b/libraries/debug-certificate-manager/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/debug-certificate-manager", - "version": "1.2.8", + "version": "1.2.9", "description": "Cross-platform functionality to create debug ssl certificates.", "main": "lib/index.js", "typings": "dist/debug-certificate-manager.d.ts", diff --git a/libraries/load-themed-styles/package.json b/libraries/load-themed-styles/package.json index cc53db94db2..9a2b20bcda0 100644 --- a/libraries/load-themed-styles/package.json +++ b/libraries/load-themed-styles/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/load-themed-styles", - "version": "2.0.19", + "version": "2.0.20", "description": "Loads themed styles.", "license": "MIT", "repository": { diff --git a/libraries/localization-utilities/package.json b/libraries/localization-utilities/package.json index bc60904fefa..6c73132651a 100644 --- a/libraries/localization-utilities/package.json +++ b/libraries/localization-utilities/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/localization-utilities", - "version": "0.8.38", + "version": "0.8.39", "description": "This plugin contains some useful functions for localization.", "main": "lib/index.js", "typings": "dist/localization-utilities.d.ts", diff --git a/libraries/module-minifier/package.json b/libraries/module-minifier/package.json index 33e4c82caa5..b777432643d 100644 --- a/libraries/module-minifier/package.json +++ b/libraries/module-minifier/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/module-minifier", - "version": "0.1.44", + "version": "0.1.45", "description": "Wrapper for terser to support bulk parallel minification.", "main": "lib/index.js", "typings": "dist/module-minifier.d.ts", diff --git a/libraries/package-deps-hash/package.json b/libraries/package-deps-hash/package.json index 60ee49d59a0..9591919b501 100644 --- a/libraries/package-deps-hash/package.json +++ b/libraries/package-deps-hash/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/package-deps-hash", - "version": "3.2.66", + "version": "3.2.67", "description": "", "main": "lib/index.js", "typings": "dist/package-deps-hash.d.ts", diff --git a/libraries/stream-collator/package.json b/libraries/stream-collator/package.json index 1116d64f0ec..206c2f3be87 100644 --- a/libraries/stream-collator/package.json +++ b/libraries/stream-collator/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/stream-collator", - "version": "4.0.219", + "version": "4.0.220", "description": "Display intelligible realtime output from concurrent processes", "repository": { "type": "git", diff --git a/libraries/terminal/package.json b/libraries/terminal/package.json index 9090748bf41..badc4a3f374 100644 --- a/libraries/terminal/package.json +++ b/libraries/terminal/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/terminal", - "version": "0.3.88", + "version": "0.3.89", "description": "User interface primitives for console applications", "main": "lib/index.js", "typings": "dist/terminal.d.ts", diff --git a/libraries/typings-generator/package.json b/libraries/typings-generator/package.json index 2b8673ad9db..336ead02789 100644 --- a/libraries/typings-generator/package.json +++ b/libraries/typings-generator/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/typings-generator", - "version": "0.8.14", + "version": "0.8.15", "description": "This library provides functionality for automatically generating typings for non-TS files.", "keywords": [ "dts", diff --git a/libraries/worker-pool/package.json b/libraries/worker-pool/package.json index da9c447af71..54def9ad7be 100644 --- a/libraries/worker-pool/package.json +++ b/libraries/worker-pool/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/worker-pool", - "version": "0.1.44", + "version": "0.1.45", "description": "Lightweight worker pool using NodeJS worker_threads", "main": "lib/index.js", "typings": "dist/worker-pool.d.ts", diff --git a/rigs/heft-node-rig/package.json b/rigs/heft-node-rig/package.json index e9119e10dc4..8ae8eed9abd 100644 --- a/rigs/heft-node-rig/package.json +++ b/rigs/heft-node-rig/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-node-rig", - "version": "1.11.11", + "version": "1.11.12", "description": "A rig package for Node.js projects that build using Heft", "license": "MIT", "scripts": { @@ -13,7 +13,7 @@ "directory": "rigs/heft-node-rig" }, "peerDependencies": { - "@rushstack/heft": "^0.49.0" + "@rushstack/heft": "^0.49.1" }, "dependencies": { "@microsoft/api-extractor": "workspace:*", diff --git a/rigs/heft-web-rig/package.json b/rigs/heft-web-rig/package.json index 672d18bf69e..48893a08d27 100644 --- a/rigs/heft-web-rig/package.json +++ b/rigs/heft-web-rig/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-web-rig", - "version": "0.12.16", + "version": "0.12.17", "description": "A rig package for web browser projects that build using Heft", "license": "MIT", "scripts": { @@ -13,7 +13,7 @@ "directory": "rigs/heft-web-rig" }, "peerDependencies": { - "@rushstack/heft": "^0.49.0" + "@rushstack/heft": "^0.49.1" }, "dependencies": { "@microsoft/api-extractor": "workspace:*", diff --git a/rush-plugins/rush-serve-plugin/package.json b/rush-plugins/rush-serve-plugin/package.json index 7f2be8c1721..1ca325eaa07 100644 --- a/rush-plugins/rush-serve-plugin/package.json +++ b/rush-plugins/rush-serve-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/rush-serve-plugin", - "version": "0.3.8", + "version": "0.3.9", "description": "A Rush plugin that hooks into a rush action and serves output folders from all projects in the repository.", "license": "MIT", "repository": { diff --git a/webpack/hashed-folder-copy-plugin/package.json b/webpack/hashed-folder-copy-plugin/package.json index c1d20c899e2..5c603524e13 100644 --- a/webpack/hashed-folder-copy-plugin/package.json +++ b/webpack/hashed-folder-copy-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/hashed-folder-copy-plugin", - "version": "0.1.52", + "version": "0.1.53", "description": "Webpack plugin for copying a folder to the output directory with a hash in the folder name.", "typings": "dist/hashed-folder-copy-plugin.d.ts", "main": "lib/index.js", diff --git a/webpack/loader-load-themed-styles/package.json b/webpack/loader-load-themed-styles/package.json index 7903c4b0364..ce80cc3a2d7 100644 --- a/webpack/loader-load-themed-styles/package.json +++ b/webpack/loader-load-themed-styles/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/loader-load-themed-styles", - "version": "2.0.17", + "version": "2.0.18", "description": "This simple loader wraps the loading of CSS in script equivalent to `require('load-themed-styles').loadStyles( /* css text */ )`. It is designed to be a replacement for style-loader.", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -22,7 +22,7 @@ }, "peerDependencies": { "@types/webpack": "^4", - "@microsoft/load-themed-styles": "^2.0.19" + "@microsoft/load-themed-styles": "^2.0.20" }, "dependencies": { "loader-utils": "1.4.2" diff --git a/webpack/loader-raw-script/package.json b/webpack/loader-raw-script/package.json index 8ffcd9ab3c3..c51ef456ce8 100644 --- a/webpack/loader-raw-script/package.json +++ b/webpack/loader-raw-script/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/loader-raw-script", - "version": "1.3.273", + "version": "1.3.274", "description": "", "main": "lib/index.js", "typings": "lib/index.d.ts", diff --git a/webpack/preserve-dynamic-require-plugin/package.json b/webpack/preserve-dynamic-require-plugin/package.json index 795317170a6..d8ee99933c3 100644 --- a/webpack/preserve-dynamic-require-plugin/package.json +++ b/webpack/preserve-dynamic-require-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/webpack-preserve-dynamic-require-plugin", - "version": "0.9.48", + "version": "0.9.49", "description": "This plugin tells webpack to leave dynamic calls to \"require\" as-is instead of trying to bundle them.", "main": "lib/index.js", "typings": "dist/webpack-preserve-dynamic-require-plugin.d.ts", diff --git a/webpack/set-webpack-public-path-plugin/package.json b/webpack/set-webpack-public-path-plugin/package.json index 3a15ea44988..ce03174e35f 100644 --- a/webpack/set-webpack-public-path-plugin/package.json +++ b/webpack/set-webpack-public-path-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/set-webpack-public-path-plugin", - "version": "3.3.83", + "version": "3.3.84", "description": "This plugin sets the webpack public path at runtime.", "main": "lib/index.js", "typings": "dist/set-webpack-public-path-plugin.d.ts", diff --git a/webpack/webpack-plugin-utilities/package.json b/webpack/webpack-plugin-utilities/package.json index d0daf23a21d..5ed18a90743 100644 --- a/webpack/webpack-plugin-utilities/package.json +++ b/webpack/webpack-plugin-utilities/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/webpack-plugin-utilities", - "version": "0.1.48", + "version": "0.1.49", "description": "This plugin sets the webpack public path at runtime.", "main": "lib/index.js", "typings": "dist/webpack-plugin-utilities.d.ts", diff --git a/webpack/webpack4-localization-plugin/package.json b/webpack/webpack4-localization-plugin/package.json index 301d80b5dcb..cf10a9c52bb 100644 --- a/webpack/webpack4-localization-plugin/package.json +++ b/webpack/webpack4-localization-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/webpack4-localization-plugin", - "version": "0.15.41", + "version": "0.15.42", "description": "This plugin facilitates localization with Webpack.", "main": "lib/index.js", "typings": "dist/webpack4-localization-plugin.d.ts", @@ -15,7 +15,7 @@ "_phase:build": "heft build --clean" }, "peerDependencies": { - "@rushstack/set-webpack-public-path-plugin": "^3.3.83", + "@rushstack/set-webpack-public-path-plugin": "^3.3.84", "@types/webpack": "^4.39.0", "webpack": "^4.31.0" }, diff --git a/webpack/webpack4-module-minifier-plugin/package.json b/webpack/webpack4-module-minifier-plugin/package.json index 1bd4f6e94a6..5fc4e8fd6cd 100644 --- a/webpack/webpack4-module-minifier-plugin/package.json +++ b/webpack/webpack4-module-minifier-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/webpack4-module-minifier-plugin", - "version": "0.9.43", + "version": "0.9.44", "description": "This plugin splits minification of webpack compilations into smaller units.", "main": "lib/index.js", "typings": "dist/webpack4-module-minifier-plugin.d.ts", diff --git a/webpack/webpack5-load-themed-styles-loader/package.json b/webpack/webpack5-load-themed-styles-loader/package.json index 12aa3e98af0..48898b5faa1 100644 --- a/webpack/webpack5-load-themed-styles-loader/package.json +++ b/webpack/webpack5-load-themed-styles-loader/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/webpack5-load-themed-styles-loader", - "version": "0.1.1", + "version": "0.1.2", "description": "This simple loader wraps the loading of CSS in script equivalent to `require('load-themed-styles').loadStyles( /* css text */ )`. It is designed to be a replacement for style-loader.", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -16,7 +16,7 @@ "_phase:test": "heft test --no-build" }, "peerDependencies": { - "@microsoft/load-themed-styles": "^2.0.19", + "@microsoft/load-themed-styles": "^2.0.20", "webpack": "^5" }, "peerDependenciesMeta": { diff --git a/webpack/webpack5-localization-plugin/package.json b/webpack/webpack5-localization-plugin/package.json index 5e1e268bc51..c7694cb14e2 100644 --- a/webpack/webpack5-localization-plugin/package.json +++ b/webpack/webpack5-localization-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/webpack5-localization-plugin", - "version": "0.2.0", + "version": "0.2.1", "description": "This plugin facilitates localization with Webpack.", "main": "lib/index.js", "typings": "dist/webpack5-localization-plugin.d.ts", diff --git a/webpack/webpack5-module-minifier-plugin/package.json b/webpack/webpack5-module-minifier-plugin/package.json index 647b67372e8..428bc370d83 100644 --- a/webpack/webpack5-module-minifier-plugin/package.json +++ b/webpack/webpack5-module-minifier-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/webpack5-module-minifier-plugin", - "version": "5.1.44", + "version": "5.1.45", "description": "This plugin splits minification of webpack compilations into smaller units.", "main": "lib/index.js", "typings": "dist/webpack5-module-minifier-plugin.d.ts", From 31950c4c82872d27af9c52ea7b2c683023e45691 Mon Sep 17 00:00:00 2001 From: Rushbot Date: Wed, 18 Jan 2023 22:44:31 +0000 Subject: [PATCH 055/167] Update changelogs [skip ci] --- apps/rush/CHANGELOG.json | 18 ++++++++++++++++++ apps/rush/CHANGELOG.md | 11 ++++++++++- .../fix-create-scripts_2023-01-18-19-47.json | 10 ---------- ...install-run-rush-pnpm_2023-01-05-09-13.json | 10 ---------- .../rush/update-jszip_2023-01-18-19-27.json | 10 ---------- 5 files changed, 28 insertions(+), 31 deletions(-) delete mode 100644 common/changes/@microsoft/rush/fix-create-scripts_2023-01-18-19-47.json delete mode 100644 common/changes/@microsoft/rush/stekycz-install-run-rush-pnpm_2023-01-05-09-13.json delete mode 100644 common/changes/@microsoft/rush/update-jszip_2023-01-18-19-27.json diff --git a/apps/rush/CHANGELOG.json b/apps/rush/CHANGELOG.json index 609c16529d3..da624e2e328 100644 --- a/apps/rush/CHANGELOG.json +++ b/apps/rush/CHANGELOG.json @@ -1,6 +1,24 @@ { "name": "@microsoft/rush", "entries": [ + { + "version": "5.88.1", + "tag": "@microsoft/rush_v5.88.1", + "date": "Wed, 18 Jan 2023 22:44:31 GMT", + "comments": { + "none": [ + { + "comment": "Fix an issue where `create-scripts.js` does not exist during `rush deploy`." + }, + { + "comment": "Add install-run-rush-pnpm.js script" + }, + { + "comment": "Update JSZip to 3.8.0." + } + ] + } + }, { "version": "5.88.0", "tag": "@microsoft/rush_v5.88.0", diff --git a/apps/rush/CHANGELOG.md b/apps/rush/CHANGELOG.md index 5ffd7f87b52..1b5a500f33a 100644 --- a/apps/rush/CHANGELOG.md +++ b/apps/rush/CHANGELOG.md @@ -1,6 +1,15 @@ # Change Log - @microsoft/rush -This log was last generated on Thu, 22 Dec 2022 20:11:58 GMT and should not be manually modified. +This log was last generated on Wed, 18 Jan 2023 22:44:31 GMT and should not be manually modified. + +## 5.88.1 +Wed, 18 Jan 2023 22:44:31 GMT + +### Updates + +- Fix an issue where `create-scripts.js` does not exist during `rush deploy`. +- Add install-run-rush-pnpm.js script +- Update JSZip to 3.8.0. ## 5.88.0 Thu, 22 Dec 2022 20:11:58 GMT diff --git a/common/changes/@microsoft/rush/fix-create-scripts_2023-01-18-19-47.json b/common/changes/@microsoft/rush/fix-create-scripts_2023-01-18-19-47.json deleted file mode 100644 index ca5afd7d589..00000000000 --- a/common/changes/@microsoft/rush/fix-create-scripts_2023-01-18-19-47.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@microsoft/rush", - "comment": "Fix an issue where `create-scripts.js` does not exist during `rush deploy`.", - "type": "none" - } - ], - "packageName": "@microsoft/rush" -} \ No newline at end of file diff --git a/common/changes/@microsoft/rush/stekycz-install-run-rush-pnpm_2023-01-05-09-13.json b/common/changes/@microsoft/rush/stekycz-install-run-rush-pnpm_2023-01-05-09-13.json deleted file mode 100644 index d7dbe8fa2bc..00000000000 --- a/common/changes/@microsoft/rush/stekycz-install-run-rush-pnpm_2023-01-05-09-13.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@microsoft/rush", - "comment": "Add install-run-rush-pnpm.js script", - "type": "none" - } - ], - "packageName": "@microsoft/rush" -} \ No newline at end of file diff --git a/common/changes/@microsoft/rush/update-jszip_2023-01-18-19-27.json b/common/changes/@microsoft/rush/update-jszip_2023-01-18-19-27.json deleted file mode 100644 index 19345bfc2d7..00000000000 --- a/common/changes/@microsoft/rush/update-jszip_2023-01-18-19-27.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@microsoft/rush", - "comment": "Update JSZip to 3.8.0.", - "type": "none" - } - ], - "packageName": "@microsoft/rush" -} \ No newline at end of file From 0df203de2236b475c1ff83bf30a0eaf44e77d2a3 Mon Sep 17 00:00:00 2001 From: Rushbot Date: Wed, 18 Jan 2023 22:44:32 +0000 Subject: [PATCH 056/167] Bump versions [skip ci] --- apps/rush/package.json | 2 +- common/config/rush/version-policies.json | 2 +- libraries/rush-lib/package.json | 2 +- libraries/rush-sdk/package.json | 2 +- rush-plugins/rush-amazon-s3-build-cache-plugin/package.json | 2 +- rush-plugins/rush-azure-storage-build-cache-plugin/package.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/rush/package.json b/apps/rush/package.json index a9abc5c5586..f599b3c6022 100644 --- a/apps/rush/package.json +++ b/apps/rush/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/rush", - "version": "5.88.0", + "version": "5.88.1", "description": "A professional solution for consolidating all your JavaScript projects in one Git repo", "keywords": [ "install", diff --git a/common/config/rush/version-policies.json b/common/config/rush/version-policies.json index d5c0cdd25a8..d3c684e9797 100644 --- a/common/config/rush/version-policies.json +++ b/common/config/rush/version-policies.json @@ -102,7 +102,7 @@ { "policyName": "rush", "definitionName": "lockStepVersion", - "version": "5.88.0", + "version": "5.88.1", "nextBump": "patch", "mainProject": "@microsoft/rush" } diff --git a/libraries/rush-lib/package.json b/libraries/rush-lib/package.json index 807247012cc..0667c2ae330 100644 --- a/libraries/rush-lib/package.json +++ b/libraries/rush-lib/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/rush-lib", - "version": "5.88.0", + "version": "5.88.1", "description": "A library for writing scripts that interact with the Rush tool", "repository": { "type": "git", diff --git a/libraries/rush-sdk/package.json b/libraries/rush-sdk/package.json index d278ee443da..bfe3ac0475e 100644 --- a/libraries/rush-sdk/package.json +++ b/libraries/rush-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/rush-sdk", - "version": "5.88.0", + "version": "5.88.1", "description": "An API for interacting with the Rush engine", "repository": { "type": "git", diff --git a/rush-plugins/rush-amazon-s3-build-cache-plugin/package.json b/rush-plugins/rush-amazon-s3-build-cache-plugin/package.json index 54f9920e75d..4d93a66343a 100644 --- a/rush-plugins/rush-amazon-s3-build-cache-plugin/package.json +++ b/rush-plugins/rush-amazon-s3-build-cache-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/rush-amazon-s3-build-cache-plugin", - "version": "5.88.0", + "version": "5.88.1", "description": "Rush plugin for Amazon S3 cloud build cache", "repository": { "type": "git", diff --git a/rush-plugins/rush-azure-storage-build-cache-plugin/package.json b/rush-plugins/rush-azure-storage-build-cache-plugin/package.json index 2e56cf3184a..a1a07c68cdf 100644 --- a/rush-plugins/rush-azure-storage-build-cache-plugin/package.json +++ b/rush-plugins/rush-azure-storage-build-cache-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/rush-azure-storage-build-cache-plugin", - "version": "5.88.0", + "version": "5.88.1", "description": "Rush plugin for Azure storage cloud build cache", "repository": { "type": "git", From ea6716581f4bad81980e3649359aea5273991a3c Mon Sep 17 00:00:00 2001 From: William Huang Date: Wed, 18 Jan 2023 18:00:05 -0800 Subject: [PATCH 057/167] chore: fix minor styling --- .../src/containers/LockfileEntryDetailsView/index.tsx | 2 +- .../src/containers/LockfileEntryDetailsView/styles.scss | 3 +++ libraries/rush-components/src/components/Checkbox/styles.scss | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx index ea82093d4e6..e28020c3e69 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx @@ -131,7 +131,7 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => { return ReactNull; } return ( -
+
diff --git a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/styles.scss b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/styles.scss index c871eabd2c2..052aba67feb 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/styles.scss +++ b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/styles.scss @@ -37,8 +37,11 @@ } .DependencyDetails { + @include base.card; + padding: 0 12px; margin-top: 12px; height: 4%; + min-height: 64px; } .InfluencerEntry { diff --git a/libraries/rush-components/src/components/Checkbox/styles.scss b/libraries/rush-components/src/components/Checkbox/styles.scss index b2f05d9dafa..1d67e3398a8 100644 --- a/libraries/rush-components/src/components/Checkbox/styles.scss +++ b/libraries/rush-components/src/components/Checkbox/styles.scss @@ -8,6 +8,7 @@ button { .CheckboxRoot { background-color: white; width: 25px; + min-width: 25px; height: 25px; border-radius: 4px; display: flex; From 099c5677f9cf3750d8c7d7d89e91e5b0f93f8634 Mon Sep 17 00:00:00 2001 From: William Huang Date: Wed, 18 Jan 2023 18:01:57 -0800 Subject: [PATCH 058/167] chore: update repo state --- common/config/rush/repo-state.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config/rush/repo-state.json b/common/config/rush/repo-state.json index e17b4494b34..e124f953492 100644 --- a/common/config/rush/repo-state.json +++ b/common/config/rush/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "e855e70720fd11b2a139811470cd6e5221293693", + "pnpmShrinkwrapHash": "c8e43d9ff3f6e5aec0e928563ddf4a9cdf02d96b", "preferredVersionsHash": "5222ca779ae69ebfd201e39c17f48ce9eaf8c3c2" } From 06c6089918b2f79020d235297edeb186e56b9734 Mon Sep 17 00:00:00 2001 From: William Huang Date: Wed, 18 Jan 2023 18:03:29 -0800 Subject: [PATCH 059/167] chore: update repo state --- common/config/rush/repo-state.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config/rush/repo-state.json b/common/config/rush/repo-state.json index e124f953492..f8c06135e1a 100644 --- a/common/config/rush/repo-state.json +++ b/common/config/rush/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "c8e43d9ff3f6e5aec0e928563ddf4a9cdf02d96b", + "pnpmShrinkwrapHash": "d5d87294f303d7751845bc9af924afb4e0c73142", "preferredVersionsHash": "5222ca779ae69ebfd201e39c17f48ce9eaf8c3c2" } From a8d8f89d66537f7deac6524cf40d24239a9a42b0 Mon Sep 17 00:00:00 2001 From: Jeremy Meng Date: Thu, 19 Jan 2023 22:03:07 +0000 Subject: [PATCH 060/167] [rush-lib] react to pnpm v7 local install path breaking change In pnpm v7, the format of local installation paths and the hashing algorithm used to shorten paths have been changed. This PR add handling logic for pnpm v7. --- .../rush/browser-approved-packages.json | 4 +++ common/config/rush/pnpm-lock.yaml | 6 ++++ common/config/rush/repo-state.json | 2 +- libraries/rush-lib/package.json | 1 + .../src/logic/pnpm/PnpmLinkManager.ts | 34 +++++++++++++++++-- 5 files changed, 44 insertions(+), 3 deletions(-) diff --git a/common/config/rush/browser-approved-packages.json b/common/config/rush/browser-approved-packages.json index f5946fe8d28..e9b04ef6b92 100644 --- a/common/config/rush/browser-approved-packages.json +++ b/common/config/rush/browser-approved-packages.json @@ -42,6 +42,10 @@ "name": "redux", "allowedCategories": [ "libraries" ] }, + { + "name": "rfc4648", + "allowedCategories": [ "libraries" ] + }, { "name": "rxjs", "allowedCategories": [ "libraries" ] diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index e24bf9f247d..9842a61ce2a 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1930,6 +1930,7 @@ importers: npm-packlist: ~2.1.2 read-package-tree: ~5.1.5 resolve: ~1.22.1 + rfc4648: ^1.5.1 rxjs: ~6.6.7 semver: ~7.3.0 ssri: ~8.0.0 @@ -1968,6 +1969,7 @@ importers: npm-packlist: 2.1.5 read-package-tree: 5.1.6 resolve: 1.22.1 + rfc4648: 1.5.2 rxjs: 6.6.7 semver: 7.3.8 ssri: 8.0.1 @@ -18369,6 +18371,10 @@ packages: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + /rfc4648/1.5.2: + resolution: {integrity: sha512-tLOizhR6YGovrEBLatX1sdcuhoSCXddw3mqNVAcKxGJ+J0hFeJ+SjeWCv5UPA/WU3YzWPPuCVYgXBKZUPGpKtg==} + dev: false + /rfdc/1.3.0: resolution: {integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==} diff --git a/common/config/rush/repo-state.json b/common/config/rush/repo-state.json index ae39d578b00..ca32541cf24 100644 --- a/common/config/rush/repo-state.json +++ b/common/config/rush/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "046e9f54bcf081fbaf58b9e157b561be6b89e53d", + "pnpmShrinkwrapHash": "bded36f65e5bf1cca13f0dd5af44d701697472bf", "preferredVersionsHash": "5222ca779ae69ebfd201e39c17f48ce9eaf8c3c2" } diff --git a/libraries/rush-lib/package.json b/libraries/rush-lib/package.json index 0667c2ae330..529026eb396 100644 --- a/libraries/rush-lib/package.json +++ b/libraries/rush-lib/package.json @@ -51,6 +51,7 @@ "npm-packlist": "~2.1.2", "read-package-tree": "~5.1.5", "resolve": "~1.22.1", + "rfc4648": "^1.5.1", "rxjs": "~6.6.7", "semver": "~7.3.0", "ssri": "~8.0.0", diff --git a/libraries/rush-lib/src/logic/pnpm/PnpmLinkManager.ts b/libraries/rush-lib/src/logic/pnpm/PnpmLinkManager.ts index 273221771be..c63106fafd5 100644 --- a/libraries/rush-lib/src/logic/pnpm/PnpmLinkManager.ts +++ b/libraries/rush-lib/src/logic/pnpm/PnpmLinkManager.ts @@ -6,6 +6,7 @@ import * as crypto from 'crypto'; import uriEncode from 'strict-uri-encode'; import pnpmLinkBins from '@pnpm/link-bins'; import * as semver from 'semver'; +import { base32 } from 'rfc4648'; import colors from 'colors/safe'; import { @@ -217,6 +218,7 @@ export class PnpmLinkManager extends BaseLinkManager { // e.g.: C:\wbt\common\temp\node_modules\.local\C%3A%2Fwbt%2Fcommon%2Ftemp%2Fprojects%2Fapi-documenter.tgz\node_modules const pathToLocalInstallation: string = this._getPathToLocalInstallation( + tarballEntry, absolutePathToTgzFile, folderNameSuffix ); @@ -272,8 +274,12 @@ export class PnpmLinkManager extends BaseLinkManager { }); } - private _getPathToLocalInstallation(absolutePathToTgzFile: string, folderSuffix: string): string { - if (this._pnpmVersion.major >= 6) { + private _getPathToLocalInstallation( + tarballEntry: string, + absolutePathToTgzFile: string, + folderSuffix: string + ): string { + if (this._pnpmVersion.major === 6) { // PNPM 6 changed formatting to replace all ':' and '/' chars with '+'. Additionally, folder names > 120 // are trimmed and hashed. NOTE: PNPM internally uses fs.realpath.native, which will cause additional // issues in environments that do not support long paths. @@ -294,6 +300,26 @@ export class PnpmLinkManager extends BaseLinkManager { .digest('hex')}`; } + return path.join( + this._rushConfiguration.commonTempFolder, + RushConstants.nodeModulesFolderName, + '.pnpm', + folderName, + RushConstants.nodeModulesFolderName + ); + } else if (this._pnpmVersion.major >= 7) { + // PNPM 7 changed the local path format again and the hashing algorithm + // See https://github.com/pnpm/pnpm/releases/tag/v7.0.0 + // e.g.: + // file+projects+presentation-integration-tests.tgz_jsdom@11.12.0 + const specialCharRegex: RegExp = /\/|:/g; + const escapedLocalPath: string = Path.convertToSlashes(tarballEntry).replace(specialCharRegex, '+'); + let folderName: string = `${escapedLocalPath}${folderSuffix}`; + // https://github.com/pnpm/pnpm/blob/v7.0.0/packages/dependency-path/src/index.ts#L136 + if (folderName.length > 120) { + folderName = `${folderName.substring(0, 50)}_${createBase32Hash(folderName)}`; + } + return path.join( this._rushConfiguration.commonTempFolder, RushConstants.nodeModulesFolderName, @@ -377,3 +403,7 @@ export class PnpmLinkManager extends BaseLinkManager { return newLocalPackage; } } + +function createBase32Hash(str: string): string { + return base32.stringify(crypto.createHash('md5').update(str).digest()).replace(/(=+)$/, '').toLowerCase(); +} From cac2db75788037ee6560d6571b13703c8e3b0668 Mon Sep 17 00:00:00 2001 From: Jeremy Meng Date: Thu, 19 Jan 2023 22:07:48 +0000 Subject: [PATCH 061/167] rush change --- .../fix-pnpm-v7-local-path-3652_2023-01-19-22-06.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@microsoft/rush/fix-pnpm-v7-local-path-3652_2023-01-19-22-06.json diff --git a/common/changes/@microsoft/rush/fix-pnpm-v7-local-path-3652_2023-01-19-22-06.json b/common/changes/@microsoft/rush/fix-pnpm-v7-local-path-3652_2023-01-19-22-06.json new file mode 100644 index 00000000000..fbc33f49ffe --- /dev/null +++ b/common/changes/@microsoft/rush/fix-pnpm-v7-local-path-3652_2023-01-19-22-06.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Fix linking error due to PNPM v7 local install path breaking change", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file From d1ebe015c18f6c80ef2216792d749a8db6e3f41a Mon Sep 17 00:00:00 2001 From: David Michon Date: Thu, 19 Jan 2023 16:43:12 -0800 Subject: [PATCH 062/167] Add snapshot --- .../__snapshots__/getRepoDeps.test.ts.snap | 84 +++++++++++++++++++ .../src/test/getRepoDeps.test.ts | 16 ++++ 2 files changed, 100 insertions(+) create mode 100644 libraries/package-deps-hash/src/test/__snapshots__/getRepoDeps.test.ts.snap diff --git a/libraries/package-deps-hash/src/test/__snapshots__/getRepoDeps.test.ts.snap b/libraries/package-deps-hash/src/test/__snapshots__/getRepoDeps.test.ts.snap new file mode 100644 index 00000000000..bd9b31f19cc --- /dev/null +++ b/libraries/package-deps-hash/src/test/__snapshots__/getRepoDeps.test.ts.snap @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`getRepoStateAsync can handle adding one file 1`] = ` +Object { + "nestedTestProject/package.json": "18a1e415e56220fa5122428a4ef8eb8874756576", + "nestedTestProject/src/file 1.txt": "c7b2f707ac99ca522f965210a7b6b0b109863f34", + "testProject/a.txt": "2e65efe2a145dda7ee51d1741299f848e5bf752e", + "testProject/file 2.txt": "a385f754ec4fede884a4864d090064d9aeef8ccb", + "testProject/file1.txt": "c7b2f707ac99ca522f965210a7b6b0b109863f34", + "testProject/file蝴蝶.txt": "ae814af81e16cb2ae8c57503c77e2cab6b5462ba", + "testProject/package.json": "18a1e415e56220fa5122428a4ef8eb8874756576", +} +`; + +exports[`getRepoStateAsync can handle adding two files 1`] = ` +Object { + "nestedTestProject/package.json": "18a1e415e56220fa5122428a4ef8eb8874756576", + "nestedTestProject/src/file 1.txt": "c7b2f707ac99ca522f965210a7b6b0b109863f34", + "testProject/a.txt": "2e65efe2a145dda7ee51d1741299f848e5bf752e", + "testProject/b.txt": "2e65efe2a145dda7ee51d1741299f848e5bf752e", + "testProject/file 2.txt": "a385f754ec4fede884a4864d090064d9aeef8ccb", + "testProject/file1.txt": "c7b2f707ac99ca522f965210a7b6b0b109863f34", + "testProject/file蝴蝶.txt": "ae814af81e16cb2ae8c57503c77e2cab6b5462ba", + "testProject/package.json": "18a1e415e56220fa5122428a4ef8eb8874756576", +} +`; + +exports[`getRepoStateAsync can handle changing one file 1`] = ` +Object { + "nestedTestProject/package.json": "18a1e415e56220fa5122428a4ef8eb8874756576", + "nestedTestProject/src/file 1.txt": "c7b2f707ac99ca522f965210a7b6b0b109863f34", + "testProject/file 2.txt": "a385f754ec4fede884a4864d090064d9aeef8ccb", + "testProject/file1.txt": "f2ba8f84ab5c1bce84a7b441cb1959cfc7093b7f", + "testProject/file蝴蝶.txt": "ae814af81e16cb2ae8c57503c77e2cab6b5462ba", + "testProject/package.json": "18a1e415e56220fa5122428a4ef8eb8874756576", +} +`; + +exports[`getRepoStateAsync can handle removing one file 1`] = ` +Object { + "nestedTestProject/package.json": "18a1e415e56220fa5122428a4ef8eb8874756576", + "nestedTestProject/src/file 1.txt": "c7b2f707ac99ca522f965210a7b6b0b109863f34", + "testProject/file 2.txt": "a385f754ec4fede884a4864d090064d9aeef8ccb", + "testProject/file蝴蝶.txt": "ae814af81e16cb2ae8c57503c77e2cab6b5462ba", + "testProject/package.json": "18a1e415e56220fa5122428a4ef8eb8874756576", +} +`; + +exports[`getRepoStateAsync can handle uncommitted filenames with spaces and non-ASCII characters 1`] = ` +Object { + "nestedTestProject/package.json": "18a1e415e56220fa5122428a4ef8eb8874756576", + "nestedTestProject/src/file 1.txt": "c7b2f707ac99ca522f965210a7b6b0b109863f34", + "testProject/a file name.txt": "2e65efe2a145dda7ee51d1741299f848e5bf752e", + "testProject/a file.txt": "2e65efe2a145dda7ee51d1741299f848e5bf752e", + "testProject/file 2.txt": "a385f754ec4fede884a4864d090064d9aeef8ccb", + "testProject/file1.txt": "c7b2f707ac99ca522f965210a7b6b0b109863f34", + "testProject/file蝴蝶.txt": "ae814af81e16cb2ae8c57503c77e2cab6b5462ba", + "testProject/newFile批把.txt": "2e65efe2a145dda7ee51d1741299f848e5bf752e", + "testProject/package.json": "18a1e415e56220fa5122428a4ef8eb8874756576", +} +`; + +exports[`getRepoStateAsync can parse committed files 1`] = ` +Object { + "nestedTestProject/package.json": "18a1e415e56220fa5122428a4ef8eb8874756576", + "nestedTestProject/src/file 1.txt": "c7b2f707ac99ca522f965210a7b6b0b109863f34", + "testProject/file 2.txt": "a385f754ec4fede884a4864d090064d9aeef8ccb", + "testProject/file1.txt": "c7b2f707ac99ca522f965210a7b6b0b109863f34", + "testProject/file蝴蝶.txt": "ae814af81e16cb2ae8c57503c77e2cab6b5462ba", + "testProject/package.json": "18a1e415e56220fa5122428a4ef8eb8874756576", +} +`; + +exports[`getRepoStateAsync handles requests for additional files 1`] = ` +Object { + "nestedTestProject/package.json": "18a1e415e56220fa5122428a4ef8eb8874756576", + "nestedTestProject/src/file 1.txt": "c7b2f707ac99ca522f965210a7b6b0b109863f34", + "testProject/file 2.txt": "a385f754ec4fede884a4864d090064d9aeef8ccb", + "testProject/file1.txt": "c7b2f707ac99ca522f965210a7b6b0b109863f34", + "testProject/file蝴蝶.txt": "ae814af81e16cb2ae8c57503c77e2cab6b5462ba", + "testProject/log.log": "2e65efe2a145dda7ee51d1741299f848e5bf752e", + "testProject/package.json": "18a1e415e56220fa5122428a4ef8eb8874756576", +} +`; diff --git a/libraries/package-deps-hash/src/test/getRepoDeps.test.ts b/libraries/package-deps-hash/src/test/getRepoDeps.test.ts index 1c0eb9832ea..7005b2f50f3 100644 --- a/libraries/package-deps-hash/src/test/getRepoDeps.test.ts +++ b/libraries/package-deps-hash/src/test/getRepoDeps.test.ts @@ -30,6 +30,14 @@ function getRelevantEntries(results: Map): Map { return relevantResults; } +function checkSnapshot(results: Map): void { + const asObject: Record = {}; + for (const [key, value] of results) { + asObject[key] = value; + } + expect(asObject).toMatchSnapshot(); +} + describe(getRepoRoot.name, () => { it(`returns the correct directory`, () => { const root: string = getRepoRoot(__dirname); @@ -88,6 +96,7 @@ describe(getRepoStateAsync.name, () => { const repoRoot: string = getRepoRoot(__dirname); const results: Map = await getRepoStateAsync(repoRoot); const filteredResults: Map = getRelevantEntries(results); + checkSnapshot(filteredResults); const expectedFiles: Map = new Map( Object.entries({ 'nestedTestProject/src/file 1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', @@ -115,6 +124,7 @@ describe(getRepoStateAsync.name, () => { const filteredResults: Map = getRelevantEntries(results); try { + checkSnapshot(filteredResults); const expectedFiles: Map = new Map( Object.entries({ 'nestedTestProject/src/file 1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', @@ -148,6 +158,7 @@ describe(getRepoStateAsync.name, () => { const filteredResults: Map = getRelevantEntries(results); try { + checkSnapshot(filteredResults); const expectedFiles: Map = new Map( Object.entries({ 'nestedTestProject/src/file 1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', @@ -181,6 +192,7 @@ describe(getRepoStateAsync.name, () => { const filteredResults: Map = getRelevantEntries(results); try { + checkSnapshot(filteredResults); const expectedFiles: Map = new Map( Object.entries({ 'nestedTestProject/src/file 1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', @@ -213,6 +225,7 @@ describe(getRepoStateAsync.name, () => { const filteredResults: Map = getRelevantEntries(results); try { + checkSnapshot(filteredResults); const expectedFiles: Map = new Map( Object.entries({ 'nestedTestProject/src/file 1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', @@ -250,6 +263,8 @@ describe(getRepoStateAsync.name, () => { const filteredResults: Map = getRelevantEntries(results); try { + checkSnapshot(filteredResults); + const expectedFiles: Map = new Map( Object.entries({ 'nestedTestProject/src/file 1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', @@ -287,6 +302,7 @@ describe(getRepoStateAsync.name, () => { const filteredResults: Map = getRelevantEntries(results); try { + checkSnapshot(filteredResults); const expectedFiles: Map = new Map( Object.entries({ 'nestedTestProject/src/file 1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', From b0e0ee082702f1735122115769750b381068cb8d Mon Sep 17 00:00:00 2001 From: William Huang Date: Thu, 19 Jan 2023 17:34:59 -0800 Subject: [PATCH 063/167] chore: rename to rush-themed-ui --- apps/lockfile-explorer-web/package.json | 2 +- .../src/components/ConnectionModal/index.tsx | 2 +- .../src/containers/BookmarksSidebar/index.tsx | 2 +- .../LockfileEntryDetailsView/index.tsx | 2 +- .../src/containers/LockfileViewer/index.tsx | 2 +- .../containers/PackageJsonViewer/index.tsx | 2 +- .../containers/SelectedEntryPreview/index.tsx | 2 +- .../rush/browser-approved-packages.json | 2 +- common/config/rush/pnpm-lock.yaml | 70 +++++++++---------- .../.eslintrc.js | 0 .../.npmignore | 0 .../LICENSE | 2 +- .../README.md | 2 +- .../assets/index.html | 0 .../config/heft.json | 0 .../config/jest.config.json | 0 .../config/rig.json | 0 .../package.json | 2 +- .../src/components/Button/index.tsx | 0 .../src/components/Button/styles.scss | 0 .../src/components/Checkbox/index.tsx | 0 .../src/components/Checkbox/styles.scss | 0 .../src/components/Input/index.tsx | 0 .../src/components/Input/styles.scss | 0 .../src/components/ScrollArea/index.tsx | 0 .../src/components/ScrollArea/styles.scss | 0 .../src/components/Tabs/index.tsx | 0 .../src/components/Tabs/styles.scss | 0 .../src/components/Text/index.tsx | 0 .../src/components/Text/styles.scss | 0 .../src/start.ts | 0 .../src/styles/_base.scss | 0 .../src/styles/_colors.scss | 0 .../tsconfig.json | 0 .../tsconfig.type.json | 0 .../webpack.config.js | 0 rush.json | 4 +- 37 files changed, 48 insertions(+), 48 deletions(-) rename libraries/{rush-components => rush-themed-ui}/.eslintrc.js (100%) rename libraries/{rush-components => rush-themed-ui}/.npmignore (100%) rename libraries/{rush-components => rush-themed-ui}/LICENSE (97%) rename libraries/{rush-components => rush-themed-ui}/README.md (90%) rename libraries/{rush-components => rush-themed-ui}/assets/index.html (100%) rename libraries/{rush-components => rush-themed-ui}/config/heft.json (100%) rename libraries/{rush-components => rush-themed-ui}/config/jest.config.json (100%) rename libraries/{rush-components => rush-themed-ui}/config/rig.json (100%) rename libraries/{rush-components => rush-themed-ui}/package.json (96%) rename libraries/{rush-components => rush-themed-ui}/src/components/Button/index.tsx (100%) rename libraries/{rush-components => rush-themed-ui}/src/components/Button/styles.scss (100%) rename libraries/{rush-components => rush-themed-ui}/src/components/Checkbox/index.tsx (100%) rename libraries/{rush-components => rush-themed-ui}/src/components/Checkbox/styles.scss (100%) rename libraries/{rush-components => rush-themed-ui}/src/components/Input/index.tsx (100%) rename libraries/{rush-components => rush-themed-ui}/src/components/Input/styles.scss (100%) rename libraries/{rush-components => rush-themed-ui}/src/components/ScrollArea/index.tsx (100%) rename libraries/{rush-components => rush-themed-ui}/src/components/ScrollArea/styles.scss (100%) rename libraries/{rush-components => rush-themed-ui}/src/components/Tabs/index.tsx (100%) rename libraries/{rush-components => rush-themed-ui}/src/components/Tabs/styles.scss (100%) rename libraries/{rush-components => rush-themed-ui}/src/components/Text/index.tsx (100%) rename libraries/{rush-components => rush-themed-ui}/src/components/Text/styles.scss (100%) rename libraries/{rush-components => rush-themed-ui}/src/start.ts (100%) rename libraries/{rush-components => rush-themed-ui}/src/styles/_base.scss (100%) rename libraries/{rush-components => rush-themed-ui}/src/styles/_colors.scss (100%) rename libraries/{rush-components => rush-themed-ui}/tsconfig.json (100%) rename libraries/{rush-components => rush-themed-ui}/tsconfig.type.json (100%) rename libraries/{rush-components => rush-themed-ui}/webpack.config.js (100%) diff --git a/apps/lockfile-explorer-web/package.json b/apps/lockfile-explorer-web/package.json index 24fa4692110..435e90fac14 100644 --- a/apps/lockfile-explorer-web/package.json +++ b/apps/lockfile-explorer-web/package.json @@ -19,7 +19,7 @@ "@reduxjs/toolkit": "~1.8.6", "react-redux": "~8.0.4", "redux": "~4.2.0", - "@rushstack/components": "workspace:*" + "@rushstack/rush-themed-ui": "workspace:*" }, "devDependencies": { "@rushstack/eslint-config": "workspace:*", diff --git a/apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx b/apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx index 661cbb9af03..34235d795d9 100644 --- a/apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx +++ b/apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import React, { useCallback, useEffect, useState } from 'react'; -import { Button, Text } from '@rushstack/components'; +import { Button, Text } from '@rushstack/rush-themed-ui'; import styles from './styles.scss'; import appStyles from '../../App.scss'; import { checkAliveAsync } from '../../parsing/getPackageFiles'; diff --git a/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx b/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx index 749b084ba9e..eebd3c54643 100644 --- a/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/BookmarksSidebar/index.tsx @@ -7,7 +7,7 @@ import styles from './styles.scss'; import { useAppDispatch, useAppSelector } from '../../store/hooks'; import { LockfileEntry } from '../../parsing/LockfileEntry'; import { clearStackAndPush, removeBookmark } from '../../store/slices/entrySlice'; -import { Button, ScrollArea, Text } from '@rushstack/components'; +import { Button, ScrollArea, Text } from '@rushstack/rush-themed-ui'; export const BookmarksSidebar = (): JSX.Element => { const bookmarks = useAppSelector((state) => state.entry.bookmarkedEntries); diff --git a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx index e28020c3e69..8eb049e2043 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import React, { useCallback, useEffect, useState } from 'react'; -import { ScrollArea, Text } from '@rushstack/components'; +import { ScrollArea, Text } from '@rushstack/rush-themed-ui'; import styles from './styles.scss'; import appStyles from '../../App.scss'; import { IDependencyType, LockfileDependency } from '../../parsing/LockfileDependency'; diff --git a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx index 7c233021956..e03a47c1f17 100644 --- a/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/LockfileViewer/index.tsx @@ -13,7 +13,7 @@ import { setFilter as selectFilter } from '../../store/slices/entrySlice'; import { getFilterFromLocalStorage, saveFilterToLocalStorage } from '../../helpers/localStorage'; -import { Tabs, Checkbox, ScrollArea, Input, Text } from '@rushstack/components'; +import { Tabs, Checkbox, ScrollArea, Input, Text } from '@rushstack/rush-themed-ui'; interface ILockfileEntryGroup { entryName: string; diff --git a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx index db4e94949a1..d159dd7d342 100644 --- a/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx @@ -11,7 +11,7 @@ import { compareSpec } from '../../parsing/compareSpec'; import { loadSpecChanges } from '../../store/slices/workspaceSlice'; import { displaySpecChanges } from '../../helpers/displaySpecChanges'; import { isEntryModified } from '../../helpers/isEntryModified'; -import { ScrollArea, Tabs, Text } from '@rushstack/components'; +import { ScrollArea, Tabs, Text } from '@rushstack/rush-themed-ui'; enum PackageView { PACKAGE_JSON, diff --git a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx index c429f13d3f1..14c5ca393f9 100644 --- a/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx +++ b/apps/lockfile-explorer-web/src/containers/SelectedEntryPreview/index.tsx @@ -11,7 +11,7 @@ import { removeBookmark, selectCurrentEntry } from '../../store/slices/entrySlice'; -import { Button, ScrollArea, Text } from '@rushstack/components'; +import { Button, ScrollArea, Text } from '@rushstack/rush-themed-ui'; export const SelectedEntryPreview = (): JSX.Element => { const selectedEntry = useAppSelector(selectCurrentEntry); diff --git a/common/config/rush/browser-approved-packages.json b/common/config/rush/browser-approved-packages.json index 9daf9d4a53e..06d244c0c97 100644 --- a/common/config/rush/browser-approved-packages.json +++ b/common/config/rush/browser-approved-packages.json @@ -35,7 +35,7 @@ "allowedCategories": [ "libraries" ] }, { - "name": "@rushstack/components", + "name": "@rushstack/rush-themed-ui", "allowedCategories": [ "libraries" ] }, { diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 7500be3b9bf..41f9ffe1fdf 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -190,10 +190,10 @@ importers: '@fluentui/react': ^8.96.1 '@lifaon/path': ~2.1.0 '@reduxjs/toolkit': ~1.8.6 - '@rushstack/components': workspace:* '@rushstack/eslint-config': workspace:* '@rushstack/heft': workspace:* '@rushstack/heft-web-rig': workspace:* + '@rushstack/rush-themed-ui': workspace:* '@types/heft-jest': 1.0.1 '@types/react': 16.14.23 '@types/react-dom': 16.9.14 @@ -206,7 +206,7 @@ importers: '@fluentui/react': 8.103.6_tlqvpdqnq63ssdllbmshthdmo4 '@lifaon/path': 2.1.0 '@reduxjs/toolkit': 1.8.6_qfynotfwlyrsyq662adyrweaoe - '@rushstack/components': link:../../libraries/rush-components + '@rushstack/rush-themed-ui': link:../../libraries/rush-themed-ui react: 16.13.1 react-dom: 16.13.1_react@16.13.1 react-redux: 8.0.5_6ue7j6tfp4xzdzadarjwzo6kwu @@ -1876,39 +1876,6 @@ importers: '@types/resolve': 1.20.2 ajv: 6.12.6 - ../../libraries/rush-components: - specifiers: - '@radix-ui/colors': ~0.1.8 - '@radix-ui/react-checkbox': ~1.0.1 - '@radix-ui/react-icons': ~1.1.1 - '@radix-ui/react-scroll-area': ~1.0.2 - '@radix-ui/react-tabs': ~1.0.1 - '@rushstack/eslint-config': workspace:* - '@rushstack/heft': workspace:* - '@rushstack/heft-web-rig': workspace:* - '@types/heft-jest': 1.0.1 - '@types/react': 16.14.23 - '@types/react-dom': 16.9.14 - '@types/webpack-env': 1.13.0 - react: ~16.13.1 - react-dom: ~16.13.1 - dependencies: - react: 16.13.1 - react-dom: 16.13.1_react@16.13.1 - devDependencies: - '@radix-ui/colors': 0.1.8 - '@radix-ui/react-checkbox': 1.0.1_5owmthsvj5ictknaj3ev736ofq - '@radix-ui/react-icons': 1.1.1_react@16.13.1 - '@radix-ui/react-scroll-area': 1.0.2_5owmthsvj5ictknaj3ev736ofq - '@radix-ui/react-tabs': 1.0.1_5owmthsvj5ictknaj3ev736ofq - '@rushstack/eslint-config': link:../../eslint/eslint-config - '@rushstack/heft': link:../../apps/heft - '@rushstack/heft-web-rig': link:../../rigs/heft-web-rig - '@types/heft-jest': 1.0.1 - '@types/react': 16.14.23 - '@types/react-dom': 16.9.14 - '@types/webpack-env': 1.13.0 - ../../libraries/rush-lib: specifiers: '@pnpm/link-bins': ~5.3.7 @@ -2065,6 +2032,39 @@ importers: '@types/semver': 7.3.5 '@types/webpack-env': 1.13.0 + ../../libraries/rush-themed-ui: + specifiers: + '@radix-ui/colors': ~0.1.8 + '@radix-ui/react-checkbox': ~1.0.1 + '@radix-ui/react-icons': ~1.1.1 + '@radix-ui/react-scroll-area': ~1.0.2 + '@radix-ui/react-tabs': ~1.0.1 + '@rushstack/eslint-config': workspace:* + '@rushstack/heft': workspace:* + '@rushstack/heft-web-rig': workspace:* + '@types/heft-jest': 1.0.1 + '@types/react': 16.14.23 + '@types/react-dom': 16.9.14 + '@types/webpack-env': 1.13.0 + react: ~16.13.1 + react-dom: ~16.13.1 + dependencies: + react: 16.13.1 + react-dom: 16.13.1_react@16.13.1 + devDependencies: + '@radix-ui/colors': 0.1.8 + '@radix-ui/react-checkbox': 1.0.1_5owmthsvj5ictknaj3ev736ofq + '@radix-ui/react-icons': 1.1.1_react@16.13.1 + '@radix-ui/react-scroll-area': 1.0.2_5owmthsvj5ictknaj3ev736ofq + '@radix-ui/react-tabs': 1.0.1_5owmthsvj5ictknaj3ev736ofq + '@rushstack/eslint-config': link:../../eslint/eslint-config + '@rushstack/heft': link:../../apps/heft + '@rushstack/heft-web-rig': link:../../rigs/heft-web-rig + '@types/heft-jest': 1.0.1 + '@types/react': 16.14.23 + '@types/react-dom': 16.9.14 + '@types/webpack-env': 1.13.0 + ../../libraries/rushell: specifiers: '@rushstack/eslint-config': workspace:* diff --git a/libraries/rush-components/.eslintrc.js b/libraries/rush-themed-ui/.eslintrc.js similarity index 100% rename from libraries/rush-components/.eslintrc.js rename to libraries/rush-themed-ui/.eslintrc.js diff --git a/libraries/rush-components/.npmignore b/libraries/rush-themed-ui/.npmignore similarity index 100% rename from libraries/rush-components/.npmignore rename to libraries/rush-themed-ui/.npmignore diff --git a/libraries/rush-components/LICENSE b/libraries/rush-themed-ui/LICENSE similarity index 97% rename from libraries/rush-components/LICENSE rename to libraries/rush-themed-ui/LICENSE index 52b5a97c6ff..e08fddbd337 100644 --- a/libraries/rush-components/LICENSE +++ b/libraries/rush-themed-ui/LICENSE @@ -1,4 +1,4 @@ -@rushstack/components +@rushstack/rush-themed-ui Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/libraries/rush-components/README.md b/libraries/rush-themed-ui/README.md similarity index 90% rename from libraries/rush-components/README.md rename to libraries/rush-themed-ui/README.md index f67430bd265..9681cf99c86 100644 --- a/libraries/rush-components/README.md +++ b/libraries/rush-themed-ui/README.md @@ -1,4 +1,4 @@ -# @rushstack/components +# @rushstack/rush-themed-ui **Rush Components** provides a suite of styled components that can be used in rush applications to ensure a consistent look and feel among all rushstack helper applications. diff --git a/libraries/rush-components/assets/index.html b/libraries/rush-themed-ui/assets/index.html similarity index 100% rename from libraries/rush-components/assets/index.html rename to libraries/rush-themed-ui/assets/index.html diff --git a/libraries/rush-components/config/heft.json b/libraries/rush-themed-ui/config/heft.json similarity index 100% rename from libraries/rush-components/config/heft.json rename to libraries/rush-themed-ui/config/heft.json diff --git a/libraries/rush-components/config/jest.config.json b/libraries/rush-themed-ui/config/jest.config.json similarity index 100% rename from libraries/rush-components/config/jest.config.json rename to libraries/rush-themed-ui/config/jest.config.json diff --git a/libraries/rush-components/config/rig.json b/libraries/rush-themed-ui/config/rig.json similarity index 100% rename from libraries/rush-components/config/rig.json rename to libraries/rush-themed-ui/config/rig.json diff --git a/libraries/rush-components/package.json b/libraries/rush-themed-ui/package.json similarity index 96% rename from libraries/rush-components/package.json rename to libraries/rush-themed-ui/package.json index ef52d8451ea..14056910b5d 100644 --- a/libraries/rush-components/package.json +++ b/libraries/rush-themed-ui/package.json @@ -1,5 +1,5 @@ { - "name": "@rushstack/components", + "name": "@rushstack/rush-themed-ui", "description": "Rush Component Library: a set of themed components for rush projects", "version": "0.0.0", "private": true, diff --git a/libraries/rush-components/src/components/Button/index.tsx b/libraries/rush-themed-ui/src/components/Button/index.tsx similarity index 100% rename from libraries/rush-components/src/components/Button/index.tsx rename to libraries/rush-themed-ui/src/components/Button/index.tsx diff --git a/libraries/rush-components/src/components/Button/styles.scss b/libraries/rush-themed-ui/src/components/Button/styles.scss similarity index 100% rename from libraries/rush-components/src/components/Button/styles.scss rename to libraries/rush-themed-ui/src/components/Button/styles.scss diff --git a/libraries/rush-components/src/components/Checkbox/index.tsx b/libraries/rush-themed-ui/src/components/Checkbox/index.tsx similarity index 100% rename from libraries/rush-components/src/components/Checkbox/index.tsx rename to libraries/rush-themed-ui/src/components/Checkbox/index.tsx diff --git a/libraries/rush-components/src/components/Checkbox/styles.scss b/libraries/rush-themed-ui/src/components/Checkbox/styles.scss similarity index 100% rename from libraries/rush-components/src/components/Checkbox/styles.scss rename to libraries/rush-themed-ui/src/components/Checkbox/styles.scss diff --git a/libraries/rush-components/src/components/Input/index.tsx b/libraries/rush-themed-ui/src/components/Input/index.tsx similarity index 100% rename from libraries/rush-components/src/components/Input/index.tsx rename to libraries/rush-themed-ui/src/components/Input/index.tsx diff --git a/libraries/rush-components/src/components/Input/styles.scss b/libraries/rush-themed-ui/src/components/Input/styles.scss similarity index 100% rename from libraries/rush-components/src/components/Input/styles.scss rename to libraries/rush-themed-ui/src/components/Input/styles.scss diff --git a/libraries/rush-components/src/components/ScrollArea/index.tsx b/libraries/rush-themed-ui/src/components/ScrollArea/index.tsx similarity index 100% rename from libraries/rush-components/src/components/ScrollArea/index.tsx rename to libraries/rush-themed-ui/src/components/ScrollArea/index.tsx diff --git a/libraries/rush-components/src/components/ScrollArea/styles.scss b/libraries/rush-themed-ui/src/components/ScrollArea/styles.scss similarity index 100% rename from libraries/rush-components/src/components/ScrollArea/styles.scss rename to libraries/rush-themed-ui/src/components/ScrollArea/styles.scss diff --git a/libraries/rush-components/src/components/Tabs/index.tsx b/libraries/rush-themed-ui/src/components/Tabs/index.tsx similarity index 100% rename from libraries/rush-components/src/components/Tabs/index.tsx rename to libraries/rush-themed-ui/src/components/Tabs/index.tsx diff --git a/libraries/rush-components/src/components/Tabs/styles.scss b/libraries/rush-themed-ui/src/components/Tabs/styles.scss similarity index 100% rename from libraries/rush-components/src/components/Tabs/styles.scss rename to libraries/rush-themed-ui/src/components/Tabs/styles.scss diff --git a/libraries/rush-components/src/components/Text/index.tsx b/libraries/rush-themed-ui/src/components/Text/index.tsx similarity index 100% rename from libraries/rush-components/src/components/Text/index.tsx rename to libraries/rush-themed-ui/src/components/Text/index.tsx diff --git a/libraries/rush-components/src/components/Text/styles.scss b/libraries/rush-themed-ui/src/components/Text/styles.scss similarity index 100% rename from libraries/rush-components/src/components/Text/styles.scss rename to libraries/rush-themed-ui/src/components/Text/styles.scss diff --git a/libraries/rush-components/src/start.ts b/libraries/rush-themed-ui/src/start.ts similarity index 100% rename from libraries/rush-components/src/start.ts rename to libraries/rush-themed-ui/src/start.ts diff --git a/libraries/rush-components/src/styles/_base.scss b/libraries/rush-themed-ui/src/styles/_base.scss similarity index 100% rename from libraries/rush-components/src/styles/_base.scss rename to libraries/rush-themed-ui/src/styles/_base.scss diff --git a/libraries/rush-components/src/styles/_colors.scss b/libraries/rush-themed-ui/src/styles/_colors.scss similarity index 100% rename from libraries/rush-components/src/styles/_colors.scss rename to libraries/rush-themed-ui/src/styles/_colors.scss diff --git a/libraries/rush-components/tsconfig.json b/libraries/rush-themed-ui/tsconfig.json similarity index 100% rename from libraries/rush-components/tsconfig.json rename to libraries/rush-themed-ui/tsconfig.json diff --git a/libraries/rush-components/tsconfig.type.json b/libraries/rush-themed-ui/tsconfig.type.json similarity index 100% rename from libraries/rush-components/tsconfig.type.json rename to libraries/rush-themed-ui/tsconfig.type.json diff --git a/libraries/rush-components/webpack.config.js b/libraries/rush-themed-ui/webpack.config.js similarity index 100% rename from libraries/rush-components/webpack.config.js rename to libraries/rush-themed-ui/webpack.config.js diff --git a/rush.json b/rush.json index 56c6fe5bec2..bd6da771095 100644 --- a/rush.json +++ b/rush.json @@ -431,8 +431,8 @@ "reviewCategory": "libraries" }, { - "packageName": "@rushstack/components", - "projectFolder": "libraries/rush-components", + "packageName": "@rushstack/rush-themed-ui", + "projectFolder": "libraries/rush-themed-ui", "reviewCategory": "libraries" }, { From d215d36ad4b83df1a1c5b1a735ff0f5465c6339e Mon Sep 17 00:00:00 2001 From: David Michon Date: Thu, 19 Jan 2023 17:39:33 -0800 Subject: [PATCH 064/167] remove baseline --- .../src/test/getRepoDeps.test.ts | 184 +++--------------- 1 file changed, 26 insertions(+), 158 deletions(-) diff --git a/libraries/package-deps-hash/src/test/getRepoDeps.test.ts b/libraries/package-deps-hash/src/test/getRepoDeps.test.ts index 7005b2f50f3..a47d01c8a92 100644 --- a/libraries/package-deps-hash/src/test/getRepoDeps.test.ts +++ b/libraries/package-deps-hash/src/test/getRepoDeps.test.ts @@ -6,7 +6,7 @@ import { execSync } from 'child_process'; import { getRepoStateAsync, parseGitLsTree, getRepoRoot } from '../getRepoState'; -import { FileSystem, FileConstants } from '@rushstack/node-core-library'; +import { FileSystem } from '@rushstack/node-core-library'; const SOURCE_PATH: string = path.join(__dirname).replace(path.join('lib', 'test'), path.join('src', 'test')); @@ -15,27 +15,20 @@ const TEST_PROJECT_PATH: string = path.join(SOURCE_PATH, 'testProject'); const FILTERS: string[] = [`testProject/`, `nestedTestProject/`]; -function getRelevantEntries(results: Map): Map { - const relevantResults: Map = new Map(); +function checkSnapshot(results: Map): void { + const relevantResults: Record = {}; for (const [key, hash] of results) { if (key.startsWith(TEST_PREFIX)) { const partialKey: string = key.slice(TEST_PREFIX.length); for (const filter of FILTERS) { if (partialKey.startsWith(filter)) { - relevantResults.set(partialKey, hash); + relevantResults[partialKey] = hash; } } } } - return relevantResults; -} -function checkSnapshot(results: Map): void { - const asObject: Record = {}; - for (const [key, value] of results) { - asObject[key] = value; - } - expect(asObject).toMatchSnapshot(); + expect(relevantResults).toMatchSnapshot(); } describe(getRepoRoot.name, () => { @@ -95,23 +88,7 @@ describe(getRepoStateAsync.name, () => { it('can parse committed files', async () => { const repoRoot: string = getRepoRoot(__dirname); const results: Map = await getRepoStateAsync(repoRoot); - const filteredResults: Map = getRelevantEntries(results); - checkSnapshot(filteredResults); - const expectedFiles: Map = new Map( - Object.entries({ - 'nestedTestProject/src/file 1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', - [`nestedTestProject/${FileConstants.PackageJson}`]: '18a1e415e56220fa5122428a4ef8eb8874756576', - 'testProject/file1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', - 'testProject/file 2.txt': 'a385f754ec4fede884a4864d090064d9aeef8ccb', - 'testProject/file蝴蝶.txt': 'ae814af81e16cb2ae8c57503c77e2cab6b5462ba', - [`testProject/${FileConstants.PackageJson}`]: '18a1e415e56220fa5122428a4ef8eb8874756576' - }) - ); - - for (const [filePath, hash] of expectedFiles) { - expect(filteredResults.get(filePath)).toEqual(hash); - } - expect(filteredResults.size).toEqual(expectedFiles.size); + checkSnapshot(results); }); it('can handle adding one file', async () => { @@ -119,28 +96,10 @@ describe(getRepoStateAsync.name, () => { FileSystem.writeFile(tempFilePath, 'a'); - const repoRoot: string = getRepoRoot(__dirname); - const results: Map = await getRepoStateAsync(repoRoot); - const filteredResults: Map = getRelevantEntries(results); - try { - checkSnapshot(filteredResults); - const expectedFiles: Map = new Map( - Object.entries({ - 'nestedTestProject/src/file 1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', - [`nestedTestProject/${FileConstants.PackageJson}`]: '18a1e415e56220fa5122428a4ef8eb8874756576', - 'testProject/a.txt': '2e65efe2a145dda7ee51d1741299f848e5bf752e', - 'testProject/file1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', - 'testProject/file 2.txt': 'a385f754ec4fede884a4864d090064d9aeef8ccb', - 'testProject/file蝴蝶.txt': 'ae814af81e16cb2ae8c57503c77e2cab6b5462ba', - [`testProject/${FileConstants.PackageJson}`]: '18a1e415e56220fa5122428a4ef8eb8874756576' - }) - ); - - for (const [filePath, hash] of expectedFiles) { - expect(filteredResults.get(filePath)).toEqual(hash); - } - expect(filteredResults.size).toEqual(expectedFiles.size); + const repoRoot: string = getRepoRoot(__dirname); + const results: Map = await getRepoStateAsync(repoRoot); + checkSnapshot(results); } finally { FileSystem.deleteFile(tempFilePath); } @@ -153,29 +112,10 @@ describe(getRepoStateAsync.name, () => { FileSystem.writeFile(tempFilePath1, 'a'); FileSystem.writeFile(tempFilePath2, 'a'); - const repoRoot: string = getRepoRoot(__dirname); - const results: Map = await getRepoStateAsync(repoRoot); - const filteredResults: Map = getRelevantEntries(results); - try { - checkSnapshot(filteredResults); - const expectedFiles: Map = new Map( - Object.entries({ - 'nestedTestProject/src/file 1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', - [`nestedTestProject/${FileConstants.PackageJson}`]: '18a1e415e56220fa5122428a4ef8eb8874756576', - 'testProject/a.txt': '2e65efe2a145dda7ee51d1741299f848e5bf752e', - 'testProject/b.txt': '2e65efe2a145dda7ee51d1741299f848e5bf752e', - 'testProject/file1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', - 'testProject/file 2.txt': 'a385f754ec4fede884a4864d090064d9aeef8ccb', - 'testProject/file蝴蝶.txt': 'ae814af81e16cb2ae8c57503c77e2cab6b5462ba', - [`testProject/${FileConstants.PackageJson}`]: '18a1e415e56220fa5122428a4ef8eb8874756576' - }) - ); - - for (const [filePath, hash] of expectedFiles) { - expect(filteredResults.get(filePath)).toEqual(hash); - } - expect(filteredResults.size).toEqual(expectedFiles.size); + const repoRoot: string = getRepoRoot(__dirname); + const results: Map = await getRepoStateAsync(repoRoot); + checkSnapshot(results); } finally { FileSystem.deleteFile(tempFilePath1); FileSystem.deleteFile(tempFilePath2); @@ -187,26 +127,10 @@ describe(getRepoStateAsync.name, () => { FileSystem.deleteFile(testFilePath); - const repoRoot: string = getRepoRoot(__dirname); - const results: Map = await getRepoStateAsync(repoRoot); - const filteredResults: Map = getRelevantEntries(results); - try { - checkSnapshot(filteredResults); - const expectedFiles: Map = new Map( - Object.entries({ - 'nestedTestProject/src/file 1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', - [`nestedTestProject/${FileConstants.PackageJson}`]: '18a1e415e56220fa5122428a4ef8eb8874756576', - 'testProject/file 2.txt': 'a385f754ec4fede884a4864d090064d9aeef8ccb', - 'testProject/file蝴蝶.txt': 'ae814af81e16cb2ae8c57503c77e2cab6b5462ba', - [`testProject/${FileConstants.PackageJson}`]: '18a1e415e56220fa5122428a4ef8eb8874756576' - }) - ); - - for (const [filePath, hash] of expectedFiles) { - expect(filteredResults.get(filePath)).toEqual(hash); - } - expect(filteredResults.size).toEqual(expectedFiles.size); + const repoRoot: string = getRepoRoot(__dirname); + const results: Map = await getRepoStateAsync(repoRoot); + checkSnapshot(results); } finally { execSync(`git checkout --force HEAD -- ${TEST_PREFIX}testProject/file1.txt`, { stdio: 'ignore', @@ -220,27 +144,10 @@ describe(getRepoStateAsync.name, () => { FileSystem.writeFile(testFilePath, 'abc'); - const repoRoot: string = getRepoRoot(__dirname); - const results: Map = await getRepoStateAsync(repoRoot); - const filteredResults: Map = getRelevantEntries(results); - try { - checkSnapshot(filteredResults); - const expectedFiles: Map = new Map( - Object.entries({ - 'nestedTestProject/src/file 1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', - [`nestedTestProject/${FileConstants.PackageJson}`]: '18a1e415e56220fa5122428a4ef8eb8874756576', - 'testProject/file1.txt': 'f2ba8f84ab5c1bce84a7b441cb1959cfc7093b7f', - 'testProject/file 2.txt': 'a385f754ec4fede884a4864d090064d9aeef8ccb', - 'testProject/file蝴蝶.txt': 'ae814af81e16cb2ae8c57503c77e2cab6b5462ba', - [`testProject/${FileConstants.PackageJson}`]: '18a1e415e56220fa5122428a4ef8eb8874756576' - }) - ); - - for (const [filePath, hash] of expectedFiles) { - expect(filteredResults.get(filePath)).toEqual(hash); - } - expect(filteredResults.size).toEqual(expectedFiles.size); + const repoRoot: string = getRepoRoot(__dirname); + const results: Map = await getRepoStateAsync(repoRoot); + checkSnapshot(results); } finally { execSync(`git checkout --force HEAD -- ${TEST_PREFIX}testProject/file1.txt`, { stdio: 'ignore', @@ -258,31 +165,10 @@ describe(getRepoStateAsync.name, () => { FileSystem.writeFile(tempFilePath2, 'a'); FileSystem.writeFile(tempFilePath3, 'a'); - const repoRoot: string = getRepoRoot(__dirname); - const results: Map = await getRepoStateAsync(repoRoot); - const filteredResults: Map = getRelevantEntries(results); - try { - checkSnapshot(filteredResults); - - const expectedFiles: Map = new Map( - Object.entries({ - 'nestedTestProject/src/file 1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', - [`nestedTestProject/${FileConstants.PackageJson}`]: '18a1e415e56220fa5122428a4ef8eb8874756576', - 'testProject/a file.txt': '2e65efe2a145dda7ee51d1741299f848e5bf752e', - 'testProject/a file name.txt': '2e65efe2a145dda7ee51d1741299f848e5bf752e', - 'testProject/file1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', - 'testProject/file 2.txt': 'a385f754ec4fede884a4864d090064d9aeef8ccb', - 'testProject/file蝴蝶.txt': 'ae814af81e16cb2ae8c57503c77e2cab6b5462ba', - 'testProject/newFile批把.txt': '2e65efe2a145dda7ee51d1741299f848e5bf752e', - [`testProject/${FileConstants.PackageJson}`]: '18a1e415e56220fa5122428a4ef8eb8874756576' - }) - ); - - for (const [filePath, hash] of expectedFiles) { - expect(filteredResults.get(filePath)).toEqual(hash); - } - expect(filteredResults.size).toEqual(expectedFiles.size); + const repoRoot: string = getRepoRoot(__dirname); + const results: Map = await getRepoStateAsync(repoRoot); + checkSnapshot(results); } finally { FileSystem.deleteFile(tempFilePath1); FileSystem.deleteFile(tempFilePath2); @@ -295,30 +181,12 @@ describe(getRepoStateAsync.name, () => { FileSystem.writeFile(tempFilePath1, 'a'); - const repoRoot: string = getRepoRoot(__dirname); - const results: Map = await getRepoStateAsync(repoRoot, [ - `${TEST_PREFIX}testProject/log.log` - ]); - const filteredResults: Map = getRelevantEntries(results); - try { - checkSnapshot(filteredResults); - const expectedFiles: Map = new Map( - Object.entries({ - 'nestedTestProject/src/file 1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', - [`nestedTestProject/${FileConstants.PackageJson}`]: '18a1e415e56220fa5122428a4ef8eb8874756576', - 'testProject/file1.txt': 'c7b2f707ac99ca522f965210a7b6b0b109863f34', - 'testProject/file 2.txt': 'a385f754ec4fede884a4864d090064d9aeef8ccb', - 'testProject/file蝴蝶.txt': 'ae814af81e16cb2ae8c57503c77e2cab6b5462ba', - 'testProject/log.log': '2e65efe2a145dda7ee51d1741299f848e5bf752e', - [`testProject/${FileConstants.PackageJson}`]: '18a1e415e56220fa5122428a4ef8eb8874756576' - }) - ); - - for (const [filePath, hash] of expectedFiles) { - expect(filteredResults.get(filePath)).toEqual(hash); - } - expect(filteredResults.size).toEqual(expectedFiles.size); + const repoRoot: string = getRepoRoot(__dirname); + const results: Map = await getRepoStateAsync(repoRoot, [ + `${TEST_PREFIX}testProject/log.log` + ]); + checkSnapshot(results); } finally { FileSystem.deleteFile(tempFilePath1); } From 550ed8cb4f9476da97dc0577bf0bb4402d7da293 Mon Sep 17 00:00:00 2001 From: William Huang Date: Thu, 19 Jan 2023 19:48:28 -0800 Subject: [PATCH 065/167] chore: update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2970f83e81f..093550ef5a1 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ These GitHub repositories provide supplementary resources for Rush Stack: | [/build-tests/rush-project-change-analyzer-test](./build-tests/rush-project-change-analyzer-test/) | This is an example project that uses rush-lib's ProjectChangeAnalyzer to | | [/build-tests/set-webpack-public-path-plugin-webpack4-test](./build-tests/set-webpack-public-path-plugin-webpack4-test/) | Building this project tests the set-webpack-public-path-plugin using Webpack 4 | | [/build-tests/ts-command-line-test](./build-tests/ts-command-line-test/) | Building this project is a regression test for ts-command-line | -| [/libraries/rush-components](./libraries/rush-components/) | Rush Component Library: a set of themed components for rush projects | +| [/libraries/rush-themed-ui](./libraries/rush-themed-ui/) | Rush Component Library: a set of themed components for rush projects | | [/libraries/rushell](./libraries/rushell/) | Execute shell commands using a consistent syntax on every platform | | [/repo-scripts/doc-plugin-rush-stack](./repo-scripts/doc-plugin-rush-stack/) | API Documenter plugin used with the rushstack.io website | | [/repo-scripts/generate-api-docs](./repo-scripts/generate-api-docs/) | Used to generate API docs for the rushstack.io website | From 0388bd471345b96e4309eeb07fff62300d6cc307 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Thu, 19 Jan 2023 22:36:01 -0800 Subject: [PATCH 066/167] Convert rush-themed-ui to use the "library" profile from "@rushstack/heft-web-rig" and enable API Extractor --- apps/lockfile-explorer-web/config/heft.json | 5 + apps/lockfile-explorer-web/webpack.config.js | 5 +- common/reviews/api/rush-themed-ui.api.md | 101 +++++ libraries/rush-themed-ui/.eslintrc.js | 2 +- .../rush-themed-ui/config/api-extractor.json | 427 ++++++++++++++++++ libraries/rush-themed-ui/config/heft.json | 129 ------ .../rush-themed-ui/config/jest.config.json | 2 +- libraries/rush-themed-ui/config/rig.json | 2 +- libraries/rush-themed-ui/package.json | 6 +- .../rush-themed-ui/src/{start.ts => index.ts} | 0 libraries/rush-themed-ui/webpack.config.js | 24 +- 11 files changed, 545 insertions(+), 158 deletions(-) create mode 100644 common/reviews/api/rush-themed-ui.api.md create mode 100644 libraries/rush-themed-ui/config/api-extractor.json delete mode 100644 libraries/rush-themed-ui/config/heft.json rename libraries/rush-themed-ui/src/{start.ts => index.ts} (100%) diff --git a/apps/lockfile-explorer-web/config/heft.json b/apps/lockfile-explorer-web/config/heft.json index 166072d9581..68cac9d5d8f 100644 --- a/apps/lockfile-explorer-web/config/heft.json +++ b/apps/lockfile-explorer-web/config/heft.json @@ -134,6 +134,11 @@ "sourceFolder": "lib/stub", "destinationFolders": ["dist"], "fileExtensions": [".js"] + }, + { + "sourceFolder": "node_modules/@rushstack/rush-themed-ui/dist", + "destinationFolders": ["dist"], + "fileExtensions": [".js", ".map"] } ] } diff --git a/apps/lockfile-explorer-web/webpack.config.js b/apps/lockfile-explorer-web/webpack.config.js index 5d8baf21a38..db1db2d8a01 100644 --- a/apps/lockfile-explorer-web/webpack.config.js +++ b/apps/lockfile-explorer-web/webpack.config.js @@ -12,9 +12,8 @@ module.exports = function createConfig(env, argv) { configOverride: { resolve: { alias: { - // // Use the bundled library - // 'heft-web-rig-library-tutorial': - // 'heft-web-rig-library-tutorial/dist/heft-web-rig-library-tutorial.js' + // Don't rebundle this large library + '@rushstack/rush-themed-ui': '@rushstack/rush-themed-ui/dist/rush-themed-ui.js' } }, performance: { diff --git a/common/reviews/api/rush-themed-ui.api.md b/common/reviews/api/rush-themed-ui.api.md new file mode 100644 index 00000000000..dd873e1a57f --- /dev/null +++ b/common/reviews/api/rush-themed-ui.api.md @@ -0,0 +1,101 @@ +## API Report File for "@rushstack/rush-themed-ui" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { default as React_2 } from 'react'; + +// Warning: (ae-forgotten-export) The symbol "IButtonProps" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export const Button: ({ children, disabled, onClick }: IButtonProps) => JSX.Element; + +// @public (undocumented) +export const Checkbox: ({ label, isChecked, onChecked }: ICheckboxProps) => JSX.Element; + +// @public (undocumented) +export interface ICheckboxProps { + // (undocumented) + isChecked: boolean; + // (undocumented) + label: string; + // (undocumented) + onChecked: (checked: boolean) => void; +} + +// @public (undocumented) +export interface IInputProps { + // (undocumented) + onChange: (e: React_2.ChangeEvent) => void; + // (undocumented) + placeholder?: string; + // (undocumented) + type?: string; + // (undocumented) + value: string; +} + +// @public (undocumented) +export const Input: ({ value, placeholder, onChange, type }: IInputProps) => JSX.Element; + +// @public (undocumented) +export interface IScrollAreaProps { + // (undocumented) + children: React_2.ReactNode; +} + +// @public (undocumented) +export interface ITabsItem { + // (undocumented) + body?: React_2.ReactNode; + // (undocumented) + header: string; + // (undocumented) + value?: string | number; +} + +// @public (undocumented) +export interface ITabsProps { + // (undocumented) + def?: string; + // (undocumented) + items: ITabsItem[]; + // (undocumented) + onChange?: (value: any) => void; + // (undocumented) + renderChildren?: () => JSX.Element; + // (undocumented) + value?: string | number; +} + +// @public (undocumented) +export interface ITextProps { + // (undocumented) + bold?: boolean; + // (undocumented) + children: React_2.ReactNode; + // (undocumented) + className?: string; + // (undocumented) + size?: number; + // (undocumented) + type: TextType; +} + +// @public (undocumented) +export const ScrollArea: ({ children }: IScrollAreaProps) => JSX.Element; + +// @public (undocumented) +export const Tabs: ({ items, def, value, onChange, renderChildren }: ITabsProps) => JSX.Element; + +// @public (undocumented) +const Text_2: ({ type, bold, children, className, size }: ITextProps) => JSX.Element; +export { Text_2 as Text } + +// @public (undocumented) +export type TextType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span'; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/libraries/rush-themed-ui/.eslintrc.js b/libraries/rush-themed-ui/.eslintrc.js index 60160b354c4..288eaa16364 100644 --- a/libraries/rush-themed-ui/.eslintrc.js +++ b/libraries/rush-themed-ui/.eslintrc.js @@ -2,6 +2,6 @@ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { - extends: ['@rushstack/eslint-config/profile/node'], + extends: ['@rushstack/eslint-config/profile/web-app', '@rushstack/eslint-config/mixins/react'], parserOptions: { tsconfigRootDir: __dirname } }; diff --git a/libraries/rush-themed-ui/config/api-extractor.json b/libraries/rush-themed-ui/config/api-extractor.json new file mode 100644 index 00000000000..cafe285cb0d --- /dev/null +++ b/libraries/rush-themed-ui/config/api-extractor.json @@ -0,0 +1,427 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "extends": "./shared/api-extractor-base.json" + // "extends": "my-package/include/api-extractor-base.json" + + /** + * Determines the "" token that can be used with other config file settings. The project folder + * typically contains the tsconfig.json and package.json config files, but the path is user-defined. + * + * The path is resolved relative to the folder of the config file that contains the setting. + * + * The default value for "projectFolder" is the token "", which means the folder is determined by traversing + * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder + * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error + * will be reported. + * + * SUPPORTED TOKENS: + * DEFAULT VALUE: "" + */ + // "projectFolder": "..", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "/lib/index.d.ts", + + /** + * A list of NPM package names whose exports should be treated as part of this package. + * + * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", + * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part + * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly + * imports library2. To avoid this, we can specify: + * + * "bundledPackages": [ "library2" ], + * + * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been + * local files for library1. + */ + "bundledPackages": [], + + /** + * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files + * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. + * To use the OS's default newline kind, specify "os". + * + * DEFAULT VALUE: "crlf" + */ + // "newlineKind": "crlf", + + /** + * Set to true when invoking API Extractor's test harness. When `testMode` is true, the `toolVersion` field in the + * .api.json file is assigned an empty string to prevent spurious diffs in output files tracked for tests. + * + * DEFAULT VALUE: "false" + */ + // "testMode": false, + + /** + * Specifies how API Extractor sorts members of an enum when generating the .api.json file. By default, the output + * files will be sorted alphabetically, which is "by-name". To keep the ordering in the source code, specify + * "preserve". + * + * DEFAULT VALUE: "by-name" + */ + // "enumMemberOrder": "by-name", + + /** + * Determines how the TypeScript compiler engine will be invoked by API Extractor. + */ + "compiler": { + /** + * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * Note: This setting will be ignored if "overrideTsconfig" is used. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/tsconfig.json" + */ + // "tsconfigFilePath": "/tsconfig.json", + /** + * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. + * The object must conform to the TypeScript tsconfig schema: + * + * http://json.schemastore.org/tsconfig + * + * If omitted, then the tsconfig.json file will be read from the "projectFolder". + * + * DEFAULT VALUE: no overrideTsconfig section + */ + // "overrideTsconfig": { + // . . . + // } + /** + * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended + * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when + * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses + * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. + * + * DEFAULT VALUE: false + */ + // "skipLibCheck": true, + }, + + /** + * Configures how the API report file (*.api.md) will be generated. + */ + "apiReport": { + /** + * (REQUIRED) Whether to generate an API report. + */ + "enabled": true, + + /** + * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce + * a full file path. + * + * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". + * + * SUPPORTED TOKENS: , + * DEFAULT VALUE: ".api.md" + */ + // "reportFileName": ".api.md", + + /** + * Specifies the folder where the API report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, + * e.g. for an API review. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + "reportFolder": "../../../common/reviews/api" + + /** + * Specifies the folder where the temporary report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * After the temporary file is written to disk, it is compared with the file in the "reportFolder". + * If they are different, a production build will fail. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + // "reportTempFolder": "/temp/", + + /** + * Whether "forgotten exports" should be included in the API report file. Forgotten exports are declarations + * flagged with `ae-forgotten-export` warnings. See https://api-extractor.com/pages/messages/ae-forgotten-export/ to + * learn more. + * + * DEFAULT VALUE: "false" + */ + // "includeForgottenExports": false + }, + + /** + * Configures how the doc model file (*.api.json) will be generated. + */ + "docModel": { + /** + * (REQUIRED) Whether to generate a doc model file. + */ + "enabled": false + + /** + * The output path for the doc model file. The file extension should be ".api.json". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/.api.json" + */ + // "apiJsonFilePath": "/temp/.api.json", + + /** + * Whether "forgotten exports" should be included in the doc model file. Forgotten exports are declarations + * flagged with `ae-forgotten-export` warnings. See https://api-extractor.com/pages/messages/ae-forgotten-export/ to + * learn more. + * + * DEFAULT VALUE: "false" + */ + // "includeForgottenExports": false, + + /** + * The base URL where the project's source code can be viewed on a website such as GitHub or + * Azure DevOps. This URL path corresponds to the `` path on disk. + * + * This URL is concatenated with the file paths serialized to the doc model to produce URL file paths to individual API items. + * For example, if the `projectFolderUrl` is "https://github.com/microsoft/rushstack/tree/main/apps/api-extractor" and an API + * item's file path is "api/ExtractorConfig.ts", the full URL file path would be + * "https://github.com/microsoft/rushstack/tree/main/apps/api-extractor/api/ExtractorConfig.js". + * + * Can be omitted if you don't need source code links in your API documentation reference. + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "projectFolderUrl": "http://github.com/path/to/your/projectFolder" + }, + + /** + * Configures how the .d.ts rollup file will be generated. + */ + "dtsRollup": { + /** + * (REQUIRED) Whether to generate the .d.ts rollup file. + */ + "enabled": true + + /** + * Specifies the output path for a .d.ts rollup file to be generated without any trimming. + * This file will include all declarations that are exported by the main entry point. + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/dist/.d.ts" + */ + // "untrimmedFilePath": "/dist/.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for an "alpha" release. + * This file will include only declarations that are marked as "@public", "@beta", or "@alpha". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "alphaTrimmedFilePath": "/dist/-alpha.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. + * This file will include only declarations that are marked as "@public" or "@beta". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "betaTrimmedFilePath": "/dist/-beta.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. + * This file will include only declarations that are marked as "@public". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "publicTrimmedFilePath": "/dist/-public.d.ts", + + /** + * When a declaration is trimmed, by default it will be replaced by a code comment such as + * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the + * declaration completely. + * + * DEFAULT VALUE: false + */ + // "omitTrimmingComments": true + }, + + /** + * Configures how the tsdoc-metadata.json file will be generated. + */ + "tsdocMetadata": { + /** + * Whether to generate the tsdoc-metadata.json file. + * + * DEFAULT VALUE: true + */ + // "enabled": true, + /** + * Specifies where the TSDoc metadata file should be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", + * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup + * falls back to "tsdoc-metadata.json" in the package folder. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + }, + + /** + * Configures how API Extractor reports error and warning messages produced during analysis. + * + * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. + */ + "messages": { + /** + * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing + * the input .d.ts files. + * + * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "compilerMessageReporting": { + /** + * Configures the default routing for messages that don't match an explicit rule in this table. + */ + "default": { + /** + * Specifies whether the message should be written to the the tool's output log. Note that + * the "addToApiReportFile" property may supersede this option. + * + * Possible values: "error", "warning", "none" + * + * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail + * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes + * the "--local" option), the warning is displayed but the build will not fail. + * + * DEFAULT VALUE: "warning" + */ + "logLevel": "warning" + + /** + * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), + * then the message will be written inside that file; otherwise, the message is instead logged according to + * the "logLevel" option. + * + * DEFAULT VALUE: false + */ + // "addToApiReportFile": false + } + + // "TS2551": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by API Extractor during its analysis. + * + * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" + * + * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings + */ + "extractorMessageReporting": { + "default": { + "logLevel": "warning" + // "addToApiReportFile": false + } + + // "ae-extra-release-tag": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by the TSDoc parser when analyzing code comments. + * + * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "tsdocMessageReporting": { + "default": { + "logLevel": "warning" + // "addToApiReportFile": false + } + + // "tsdoc-link-tag-unescaped-text": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + } + } +} diff --git a/libraries/rush-themed-ui/config/heft.json b/libraries/rush-themed-ui/config/heft.json deleted file mode 100644 index f859f9c5abe..00000000000 --- a/libraries/rush-themed-ui/config/heft.json +++ /dev/null @@ -1,129 +0,0 @@ -/** - * Defines configuration used by core Heft. - */ -{ - "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", - - /** - * Optionally specifies another JSON config file that this file extends from. This provides a way for standard - * settings to be shared across multiple projects. - */ - "extends": "@rushstack/heft-web-rig/profiles/app/config/heft.json", - - "eventActions": [ - // { - // /** - // * (Required) The kind of built-in operation that should be performed. - // * The "deleteGlobs" action deletes files or folders that match the specified glob patterns. - // */ - // "actionKind": "deleteGlobs", - // - // /** - // * (Required) The Heft stage when this action should be performed. Note that heft.json event actions - // * are scheduled after any plugin tasks have processed the event. For example, a "compile" event action - // * will be performed after the TypeScript compiler has been invoked. - // * - // * Options: "clean", "pre-compile", "compile", "bundle", "post-build" - // */ - // "heftEvent": "clean", - // - // /** - // * (Required) A user-defined tag whose purpose is to allow configs to replace/delete handlers that - // * were added by other configs. - // */ - // "actionId": "my-example-action", - // - // /** - // * (Required) Glob patterns to be deleted. The paths are resolved relative to the project folder. - // * Documentation for supported glob syntaxes: https://www.npmjs.com/package/fast-glob - // */ - // "globsToDelete": [ - // "dist", - // "lib", - // "lib-esnext", - // "temp" - // ] - // }, - // - // { - // /** - // * (Required) The kind of built-in operation that should be performed. - // * The "copyFiles" action copies files that match the specified patterns. - // */ - // "actionKind": "copyFiles", - // - // /** - // * (Required) The Heft stage when this action should be performed. Note that heft.json event actions - // * are scheduled after any plugin tasks have processed the event. For example, a "compile" event action - // * will be performed after the TypeScript compiler has been invoked. - // * - // * Options: "pre-compile", "compile", "bundle", "post-build" - // */ - // "heftEvent": "pre-compile", - // - // /** - // * (Required) A user-defined tag whose purpose is to allow configs to replace/delete handlers that - // * were added by other configs. - // */ - // "actionId": "my-example-action", - // - // /** - // * (Required) An array of copy operations to run perform during the specified Heft event. - // */ - // "copyOperations": [ - // { - // /** - // * (Required) The base folder that files will be copied from, relative to the project root. - // * Settings such as "includeGlobs" and "excludeGlobs" will be resolved relative - // * to this folder. - // * NOTE: Assigning "sourceFolder" does not by itself select any files to be copied. - // */ - // "sourceFolder": "src", - // - // /** - // * (Required) One or more folders that files will be copied into, relative to the project root. - // * If you specify more than one destination folder, Heft will read the input files only once, using - // * streams to efficiently write multiple outputs. - // */ - // "destinationFolders": ["dist/assets"], - // - // /** - // * If specified, this option recursively scans all folders under "sourceFolder" and includes any files - // * that match the specified extensions. (If "fileExtensions" and "includeGlobs" are both - // * specified, their selections are added together.) - // */ - // "fileExtensions": [".jpg", ".png"], - // - // /** - // * A list of glob patterns that select files to be copied. The paths are resolved relative - // * to "sourceFolder". - // * Documentation for supported glob syntaxes: https://www.npmjs.com/package/fast-glob - // */ - // "includeGlobs": ["assets/*.md"], - // - // /** - // * A list of glob patterns that exclude files/folders from being copied. The paths are resolved relative - // * to "sourceFolder". These exclusions eliminate items that were selected by the "includeGlobs" - // * or "fileExtensions" setting. - // */ - // "excludeGlobs": [], - // - // /** - // * Normally, when files are selected under a child folder, a corresponding folder will be created in - // * the destination folder. Specify flatten=true to discard the source path and copy all matching files - // * to the same folder. If two files have the same name an error will be reported. - // * The default value is false. - // */ - // "flatten": false, - // - // /** - // * If true, filesystem hard links will be created instead of copying the file. Depending on the - // * operating system, this may be faster. (But note that it may cause unexpected behavior if a tool - // * modifies the link.) The default value is false. - // */ - // "hardlink": false - // } - // ] - // } - ] -} diff --git a/libraries/rush-themed-ui/config/jest.config.json b/libraries/rush-themed-ui/config/jest.config.json index 7ee087ffe19..600ba9ea39a 100644 --- a/libraries/rush-themed-ui/config/jest.config.json +++ b/libraries/rush-themed-ui/config/jest.config.json @@ -1,3 +1,3 @@ { - "extends": "@rushstack/heft-web-rig/profiles/app/config/jest.config.json" + "extends": "@rushstack/heft-web-rig/profiles/library/config/jest.config.json" } diff --git a/libraries/rush-themed-ui/config/rig.json b/libraries/rush-themed-ui/config/rig.json index 687fc2911bc..d72946b5042 100644 --- a/libraries/rush-themed-ui/config/rig.json +++ b/libraries/rush-themed-ui/config/rig.json @@ -2,5 +2,5 @@ "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", "rigPackageName": "@rushstack/heft-web-rig", - "rigProfile": "app" + "rigProfile": "library" } diff --git a/libraries/rush-themed-ui/package.json b/libraries/rush-themed-ui/package.json index 14056910b5d..1dc92f6ee56 100644 --- a/libraries/rush-themed-ui/package.json +++ b/libraries/rush-themed-ui/package.json @@ -4,11 +4,11 @@ "version": "0.0.0", "private": true, "license": "MIT", - "module": "lib/start.js", - "types": "lib/start.d.ts", + "module": "dist/rush-themed-ui.js", + "types": "dist/rush-themed-ui.d.ts", "scripts": { "build": "heft test --clean", - "start": "heft start", + "start": "heft build --watch", "test": "heft test", "_phase:build": "heft build --clean", "_phase:test": "heft test --no-build" diff --git a/libraries/rush-themed-ui/src/start.ts b/libraries/rush-themed-ui/src/index.ts similarity index 100% rename from libraries/rush-themed-ui/src/start.ts rename to libraries/rush-themed-ui/src/index.ts diff --git a/libraries/rush-themed-ui/webpack.config.js b/libraries/rush-themed-ui/webpack.config.js index 3725a2ce687..1215f0c5c1f 100644 --- a/libraries/rush-themed-ui/webpack.config.js +++ b/libraries/rush-themed-ui/webpack.config.js @@ -1,39 +1,23 @@ 'use strict'; -const path = require('path'); -const createWebpackConfig = require('@rushstack/heft-web-rig/profiles/app/webpack-base.config'); +const createWebpackConfig = require('@rushstack/heft-web-rig/profiles/library/webpack-base.config'); module.exports = function createConfig(env, argv) { return createWebpackConfig({ env: env, argv: argv, projectRoot: __dirname, + // Documentation: https://webpack.js.org/configuration/ configOverride: { - resolve: { - alias: { - // // Use the bundled library - // 'heft-web-rig-library-tutorial': - // 'heft-web-rig-library-tutorial/dist/heft-web-rig-library-tutorial.js' - } - }, + externals: ['react', 'react-dom', 'tslib'], + performance: { hints: env.production ? 'error' : false // This specifies the bundle size limit that will trigger Webpack's warning saying: // "The following entrypoint(s) combined asset size exceeds the recommended limit." // maxEntrypointSize: 500000, // maxAssetSize: 500000 - }, - devServer: { - port: 8090, - static: { - directory: path.join(__dirname, 'dist') - }, - client: { - webSocketURL: { - port: 8090 - } - } } } }); From a2f2e56c94bb6115f997d6fc0de8303e86d1a8ab Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Thu, 19 Jan 2023 22:46:54 -0800 Subject: [PATCH 067/167] Fix API Extractor warnings --- common/reviews/api/rush-themed-ui.api.md | 40 +++++++++++-------- .../src/components/Button/index.tsx | 10 ++++- .../src/components/Checkbox/index.tsx | 8 ++++ .../src/components/Input/index.tsx | 8 ++++ .../src/components/ScrollArea/index.tsx | 12 +++++- .../src/components/Tabs/index.tsx | 12 ++++++ .../src/components/Text/index.tsx | 12 ++++++ libraries/rush-themed-ui/src/index.ts | 12 ++++++ 8 files changed, 95 insertions(+), 19 deletions(-) diff --git a/common/reviews/api/rush-themed-ui.api.md b/common/reviews/api/rush-themed-ui.api.md index dd873e1a57f..351a31c0ba0 100644 --- a/common/reviews/api/rush-themed-ui.api.md +++ b/common/reviews/api/rush-themed-ui.api.md @@ -6,15 +6,23 @@ import { default as React_2 } from 'react'; -// Warning: (ae-forgotten-export) The symbol "IButtonProps" needs to be exported by the entry point index.d.ts -// -// @public (undocumented) +// @public export const Button: ({ children, disabled, onClick }: IButtonProps) => JSX.Element; -// @public (undocumented) +// @public export const Checkbox: ({ label, isChecked, onChecked }: ICheckboxProps) => JSX.Element; -// @public (undocumented) +// @public +export interface IButtonProps { + // (undocumented) + children: JSX.Element | string; + // (undocumented) + disabled?: boolean; + // (undocumented) + onClick: () => void; +} + +// @public export interface ICheckboxProps { // (undocumented) isChecked: boolean; @@ -24,7 +32,7 @@ export interface ICheckboxProps { onChecked: (checked: boolean) => void; } -// @public (undocumented) +// @public export interface IInputProps { // (undocumented) onChange: (e: React_2.ChangeEvent) => void; @@ -36,16 +44,16 @@ export interface IInputProps { value: string; } -// @public (undocumented) +// @public export const Input: ({ value, placeholder, onChange, type }: IInputProps) => JSX.Element; -// @public (undocumented) +// @public export interface IScrollAreaProps { // (undocumented) children: React_2.ReactNode; } -// @public (undocumented) +// @public export interface ITabsItem { // (undocumented) body?: React_2.ReactNode; @@ -55,7 +63,7 @@ export interface ITabsItem { value?: string | number; } -// @public (undocumented) +// @public export interface ITabsProps { // (undocumented) def?: string; @@ -69,7 +77,7 @@ export interface ITabsProps { value?: string | number; } -// @public (undocumented) +// @public export interface ITextProps { // (undocumented) bold?: boolean; @@ -83,19 +91,17 @@ export interface ITextProps { type: TextType; } -// @public (undocumented) +// @public export const ScrollArea: ({ children }: IScrollAreaProps) => JSX.Element; -// @public (undocumented) +// @public export const Tabs: ({ items, def, value, onChange, renderChildren }: ITabsProps) => JSX.Element; -// @public (undocumented) +// @public const Text_2: ({ type, bold, children, className, size }: ITextProps) => JSX.Element; export { Text_2 as Text } -// @public (undocumented) +// @public export type TextType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span'; -// (No @packageDocumentation comment for this package) - ``` diff --git a/libraries/rush-themed-ui/src/components/Button/index.tsx b/libraries/rush-themed-ui/src/components/Button/index.tsx index 4561664fa67..5fccc974bdc 100644 --- a/libraries/rush-themed-ui/src/components/Button/index.tsx +++ b/libraries/rush-themed-ui/src/components/Button/index.tsx @@ -5,12 +5,20 @@ import React from 'react'; import { Text } from '../Text'; import styles from './styles.scss'; -interface IButtonProps { +/** + * React props for {@link Button} + * @public + */ +export interface IButtonProps { children: JSX.Element | string; disabled?: boolean; onClick: () => void; } +/** + * A button UI component + * @public + */ export const Button = ({ children, disabled = false, onClick }: IButtonProps): JSX.Element => { return (