StanzaSystems / stanza-js

stanza-js contains the Node.js and Browser SDK for Stanza, along with JavaScript samples.
https://stanza.systems
Other
7 stars 1 forks source link

chore: setup and run prettier and eslint #212

Closed ktrz-sre-is closed 11 months ago

ktrz-sre-is commented 11 months ago
vercel[bot] commented 11 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stanza-js-next-with-stripe ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 15, 2023 0:04am
github-actions[bot] commented 11 months ago

LCOV of commit 54695dd during CI #547

Summary coverage rate:
  lines......: 91.0% (5690 of 6253 lines)
  functions..: 85.4% (281 of 329 functions)
  branches...: 88.6% (879 of 992 branches)

Files changed coverage rate:
                                                                                  |Lines       |Functions  |Branches    
  Filename                                                                        |Rate     Num|Rate    Num|Rate     Num
  ======================================================================================================================
  packages/browser/index.ts                                                       | 100%      2|    -     0|    -      0
  packages/browser/src/context.ts                                                 | 100%     96| 100%     4| 100%     15
  packages/browser/src/feature.ts                                                 | 100%      6|    -     0| 100%      2
  packages/browser/src/index.ts                                                   |89.8%     88|80.0%     5|84.6%     13
  packages/browser/src/localStorageStateProvider.ts                               |87.6%    137| 100%    13|87.5%     24
  packages/core/index.ts                                                          | 100%      2|    -     0|    -      0
  packages/core/src/api/fetchApiFeaturesStates.ts                                 |87.9%     58| 100%     1|25.0%     16
  packages/core/src/eventEmitter.ts                                               |96.6%     59| 100%     7|84.6%     13
  packages/core/src/getFeatureStates.ts                                           | 100%     22| 100%     1| 100%      6
  packages/core/src/getFeatureStatesHot.ts                                        | 100%     14| 100%     1| 100%      4
  packages/core/src/getFeatureStatesStale.ts                                      | 100%     14| 100%     1| 100%      5
  packages/core/src/globals.ts                                                    |96.1%     76| 100%     6|86.4%     22
  packages/core/src/groupBy.ts                                                    | 100%     12| 100%     1| 100%      2
  packages/core/src/identity.ts                                                   | 100%      1| 100%     1| 100%      1
  packages/core/src/index.ts                                                      | 100%     29|    -     0|    -      0
  packages/core/src/init.ts                                                       | 100%     22| 100%     1|83.3%      6
  packages/core/src/models/createFeatureState.ts                                  | 100%     10| 100%     1| 100%      1
  packages/core/src/models/featureStatesEqual.ts                                  | 100%     10| 100%     1| 100%      4
  packages/core/src/models/isFeatureStateFresh.ts                                 | 100%     11| 100%     1|50.0%      2
  packages/core/src/startPollingFeatureStateUpdates.ts                            | 100%     26| 100%     3|88.9%     18
  packages/core/src/utils/fetchFeatureStates.ts                                   | 100%     35| 100%     2| 100%      8
  packages/core/src/utils/inMemoryLocalStateProvider.ts                           |96.9%     64| 100%     8|83.3%     12
  packages/core/src/utils/withTimeout.ts                                          | 100%     34| 100%     2| 100%      6
  packages/core/src/withStanzaHeaders.ts                                          | 100%     33| 100%     1| 100%      7
  packages/mocks/handlers/src/handlers.ts                                         |71.2%    111|    -     0|71.4%      7
  packages/mocks/handlers/src/index.ts                                            | 100%      1|    -     0|    -      0
  packages/mocks/server/src/index.ts                                              | 100%      1|    -     0|    -      0
  packages/mocks/server/src/server.ts                                             | 100%      5|    -     0|    -      0
  packages/next-node/src/nextRequestErrorHandler.ts                               | 100%     18| 100%     1| 100%      6
  packages/next/src/addCookie.ts                                                  | 100%     17| 100%     1| 100%      7
  packages/next/src/mergeHeaders.ts                                               | 100%      8| 100%     1| 100%      3
  packages/next/src/removeCommonHeaders.ts                                        | 100%     12| 100%     1| 100%      3
  packages/next/src/stanzaSession.ts                                              |90.1%    151| 100%     6|90.5%     21
  packages/node/index.ts                                                          | 100%      7|    -     0|    -      0
  packages/node/src/addInstrumentation.ts                                         |86.9%     84|33.3%     3| 100%      1
  packages/node/src/authentication/fetchAuthToken.ts                              |75.0%      8| 100%     1|50.0%      2
  packages/node/src/authentication/startPollingAuthToken.ts                       |90.0%     20| 100%     4| 100%      4
  packages/node/src/baggage/enrichContextWithStanzaBaggage.ts                     | 100%     25| 100%     1| 100%      6
  packages/node/src/baggage/getActiveStanzaEntry.ts                               | 100%     13| 100%     1| 100%      5
  packages/node/src/baggage/getAllStanzaBaggageEntries.ts                         | 100%     13| 100%     1| 100%      3
  packages/node/src/baggage/getStanzaBaggageEntry.ts                              | 100%     13| 100%     1| 100%      2
  packages/node/src/baggage/getStanzaBaggageKeys.ts                               | 100%     12| 100%     1| 100%      1
  packages/node/src/baggage/model.ts                                              | 100%      8|    -     0| 100%      2
  packages/node/src/baggage/priorityBoost/deletePriorityBoostFromContextBaggage.ts| 100%      8| 100%     1| 100%      1
  packages/node/src/baggage/priorityBoost/getPriorityBoostFromContextBaggage.ts   | 100%     17| 100%     2|40.0%      5
  packages/node/src/baggage/priorityBoost/index.ts                                | 100%      3|    -     0|    -      0
  packages/node/src/baggage/priorityBoost/setPriorityBoostInContextBaggage.ts     | 100%     21| 100%     1| 100%      6
  packages/node/src/coerceStanzaInitOptions.ts                                    | 100%     35| 100%     3|76.9%     13
  packages/node/src/context/addStanzaTokenToContext.ts                            | 100%      7| 100%     1| 100%      2
  packages/node/src/context/bindContext.ts                                        |94.7%     19| 100%     1|66.7%      3
  packages/node/src/context/guard/addStanzaGuardToContext.ts                      | 100%      7| 100%     1| 100%      2
  packages/node/src/context/guard/getStanzaGuardFromContext.ts                    | 100%     12| 100%     1| 100%      4
  packages/node/src/context/guard/index.ts                                        | 100%      2|    -     0|    -      0
  packages/node/src/context/guard/stanzaGuardContextKey.ts                        | 100%     16|    -     0|    -      0
  packages/node/src/context/priorityBoost/addPriorityBoostToContext.ts            | 100%     14| 100%     1| 100%      4
  packages/node/src/context/priorityBoost/deletePriorityBoostFromContext.ts       |66.7%      6| 0.0%     1|    -      0
  packages/node/src/context/priorityBoost/getPriorityBoostFromContext.ts          | 100%     11| 100%     1| 100%      4
  packages/node/src/context/priorityBoost/index.ts                                | 100%      3|    -     0|    -      0
  packages/node/src/context/priorityBoost/stanzaPriorityBoostContextKey.ts        | 100%     19|    -     0|    -      0
  packages/node/src/context/removeStanzaTokenFromContext.ts                       | 100%      7| 100%     1| 100%      2
  packages/node/src/context/stanzaApiKeyContextKey.ts                             | 100%     15|    -     0|    -      0
  packages/node/src/context/stanzaTokenContextKey.ts                              | 100%     15|    -     0|    -      0
  packages/node/src/createHttpHeaderGetter.ts                                     |45.5%     11| 0.0%     1|    -      0
  packages/node/src/fetchImplementation.ts                                        | 100%      3|    -     0| 0.0%      1
  packages/node/src/generateClientId.ts                                           | 100%      9| 100%     1| 100%      2
  packages/node/src/getEnvInitOptions.ts                                          | 100%     39| 100%     1| 100%      2
  packages/node/src/global/authToken.ts                                           | 100%     12| 100%     1| 100%      2
  packages/node/src/global/createGlobal.ts                                        | 100%     10| 100%     1| 100%      2
  packages/node/src/global/createGlobalState.ts                                   | 100%     63| 100%     3| 100%      9
  packages/node/src/global/eventBus.ts                                            | 100%    231|    -     0|    -      0
  packages/node/src/global/getTraceConfig.ts                                      | 100%     15| 100%     1| 100%      3
  packages/node/src/global/guardConfig.ts                                         | 100%     52| 100%     3| 100%     11
  packages/node/src/global/guardStore.ts                                          | 100%     16|    -     0|    -      0
  packages/node/src/global/hubService.ts                                          |93.5%     31|66.7%     3| 100%      2
  packages/node/src/global/logger.ts                                              |95.7%     69|75.0%     4|81.8%     11
  packages/node/src/global/requestTimeout.ts                                      | 100%     10| 100%     1| 100%      2
  packages/node/src/global/serviceConfig.ts                                       | 100%     31| 100%     4| 100%      7
  packages/node/src/global/skipTokenCache.ts                                      | 100%     10| 100%     1| 100%      2
  packages/node/src/global/tokenStore.ts                                          | 100%     12|    -     0|    -      0
  packages/node/src/grpc/isStatusObject.ts                                        | 100%     14| 100%     1| 100%      8
  packages/node/src/grpc/isTokenInvalidError.ts                                   | 100%     12| 100%     1| 100%      5
  packages/node/src/guard/fetchGuardConfig.ts                                     | 100%     16| 100%     1| 100%      2
  packages/node/src/guard/guard/index.ts                                          | 100%    112| 100%     7| 100%     24
  packages/node/src/guard/guard/ingressTokenValidator.ts                          | 100%    105| 100%     6|95.2%     21
  packages/node/src/guard/guard/quotaChecker.ts                                   |97.9%     96| 100%     6|94.1%     17
  packages/node/src/guard/initOrGetGuard.ts                                       | 100%     18| 100%     1| 100%      3
  packages/node/src/guard/model.ts                                                | 100%     26|    -     0| 100%      1
  packages/node/src/guard/stanzaGuard.ts                                          |90.8%    195| 100%     8|98.2%     56
  packages/node/src/guard/stanzaGuardError.ts                                     | 100%     10| 100%     1| 100%      1
  packages/node/src/guard/startPollingGuardConfig.ts                              | 100%     16| 100%     2|66.7%      3
  packages/node/src/hub/api/guardConfigResponse.ts                                | 100%     24|    -     0|    -      0
  packages/node/src/hub/api/serviceConfigResponse.ts                              | 100%     64|    -     0|    -      0
  packages/node/src/hub/api/stanzaAuthTokenResponse.ts                            | 100%      7|    -     0|    -      0
  packages/node/src/hub/api/stanzaGuardHealthResponse.ts                          |91.4%     35| 100%     1|40.0%      5
  packages/node/src/hub/api/stanzaMarkTokensAsConsumedResponse.ts                 | 100%      7|    -     0|    -      0
  packages/node/src/hub/api/stanzaTokenLeaseResponse.ts                           | 100%     14|    -     0|    -      0
  packages/node/src/hub/api/stanzaTokenResponse.ts                                | 100%     13|    -     0|    -      0
  packages/node/src/hub/api/stanzaValidateTokenResponse.ts                        | 100%     15|    -     0|    -      0
  packages/node/src/hub/grpc/createGrpcHubService.ts                              |99.6%    260| 100%    12|96.2%     53
  packages/node/src/hub/rest/createHubRequest.ts                                  |92.4%     79| 100%     2|83.3%      6
  packages/node/src/hub/rest/createRestHubService.ts                              |94.4%    234|90.0%    10| 100%     40
  packages/node/src/hub/wrapHubServiceWithMetrics.ts                              | 100%    244| 100%     4|64.3%     42
  packages/node/src/init.ts                                                       |73.7%     19| 100%     1|75.0%      4
  packages/node/src/initOrThrow.ts                                                |97.2%     72| 100%     1|90.0%     10
  packages/node/src/meta.ts                                                       | 100%      4|    -     0|    -      0
  packages/node/src/open-telemetry/StanzaConfigEntityManager.ts                   |70.0%    110|66.7%     6|87.5%     16
  packages/node/src/open-telemetry/instrumentation/defaultContextAttributes.ts    | 100%     17| 100%     1| 100%      1
  packages/node/src/open-telemetry/instrumentation/featureAttributes.ts           | 100%     12| 100%     1| 100%      1
  packages/node/src/open-telemetry/instrumentation/guardAttributes.ts             | 100%     16| 100%     2| 100%      2
  packages/node/src/open-telemetry/instrumentation/guardResolutionAttributes.ts   | 100%     37| 100%     1| 100%      1
  packages/node/src/open-telemetry/instrumentation/requestAttributes.ts           | 100%     29| 100%     1| 100%      1
  packages/node/src/open-telemetry/instrumentation/stanzaInstrumentation.ts       | 100%    367| 100%    13|62.3%     53
  packages/node/src/open-telemetry/metric/stanzaMetricExporter.ts                 |43.1%    123|16.7%     6|28.6%      7
  packages/node/src/open-telemetry/sampler/ManagedSampler.ts                      |72.7%     11|50.0%     2| 100%      1
  packages/node/src/open-telemetry/sampler/StanzaConfiguredSampler.ts             |32.3%     93|33.3%     3| 100%      1
  packages/node/src/open-telemetry/sampler/StanzaSampler.ts                       | 100%      9| 100%     1| 100%      1
  packages/node/src/open-telemetry/sampler/StanzaSamplerManager.ts                |90.9%     22|66.7%     6| 100%      4
  packages/node/src/open-telemetry/span-processor/ManagedSpanProcessor.ts         |65.5%     29|20.0%     5| 100%      1
  packages/node/src/open-telemetry/span-processor/StanzaSpanExporter.ts           |20.8%     72| 0.0%     2|    -      0
  packages/node/src/open-telemetry/span-processor/StanzaSpanProcessor.ts          | 100%     12| 100%     1| 100%      1
  packages/node/src/open-telemetry/span-processor/StanzaSpanProcessorManager.ts   |81.0%     42|57.1%     7| 100%      4
  packages/node/src/open-telemetry/span-processor/createSpanExporter.ts           |40.0%     10| 0.0%     1|    -      0
  packages/node/src/propagation/HeaderContextPropagator.ts                        | 100%     38| 100%     4| 100%     14
  packages/node/src/propagation/StanzaApiKeyPropagator.ts                         | 100%     14| 100%     1| 100%      1
  packages/node/src/propagation/StanzaBaggagePropagator.ts                        |73.6%     53|50.0%     2| 100%      3
  packages/node/src/propagation/StanzaTokenPropagator.ts                          | 100%     14| 100%     1| 100%      1
  packages/node/src/propagation/TraceConfigOverrideAdditionalInfoPropagator.ts    |96.2%    105|75.0%     8|91.7%     12
  packages/node/src/quota/backoffGetQuota.ts                                      |99.3%    136| 100%     9|94.4%     36
  packages/node/src/quota/createTokenState.ts                                     | 100%    157| 100%    11|95.2%     42
  packages/node/src/quota/createTokenStore.ts                                     | 100%    124| 100%    10|97.4%     38
  packages/node/src/quota/getQuota.ts                                             |97.5%     81| 100%     1|84.2%     19
  packages/node/src/service/fetchServiceConfig.ts                                 | 100%     21| 100%     1| 100%      7
  packages/node/src/service/startPollingConfigService.ts                          |91.3%     23| 100%     2|50.0%      4
  packages/node/src/span/NoopSpanEnhancer.ts                                      | 100%      8| 0.0%     2|    -      0
  packages/node/src/span/headers/HeadersSpanEnhancer.ts                           |63.3%     30|33.3%     6| 100%      2
  packages/node/src/span/headers/HeadersSpanEnhancerConfigured.ts                 |97.9%     97| 100%     5|87.5%     16
  packages/node/src/stanzaGuardHealth.ts                                          |50.0%      8| 0.0%     1|    -      0
  packages/node/src/stanzaInitOptions.ts                                          | 100%     33|    -     0| 100%      1
  packages/node/src/stanzaPriorityBoost.ts                                        |45.5%     11| 0.0%     1|    -      0
  packages/node/src/utils/createStanzaWrapper.ts                                  |57.6%     33|33.3%     3| 100%      1
  packages/node/src/utils/isTruthy.ts                                             | 100%      2| 100%     1| 100%      1
  packages/node/src/utils/startPolling.ts                                         |98.0%     49| 100%     3|87.5%     16
  packages/node/src/utils/userAgentHeader.ts                                      | 100%     10| 100%     1| 100%      1
  packages/node/src/utils/withTimeout.ts                                          | 100%     34| 100%     2| 100%      5
  packages/node/src/utils/wrapEventsAsync.ts                                      | 100%     36| 100%     1|91.7%     12
  packages/stanza-react/src/context/StanzaContext.ts                              | 100%      6|    -     0|    -      0
  packages/stanza-react/src/context/StanzaContextName.ts                          | 100%      3|    -     0|    -      0
  packages/stanza-react/src/context/StanzaProvider.tsx                            |55.6%     18| 0.0%     1|    -      0
  packages/stanza-react/src/context/WithStanzaContextName.tsx                     |47.4%     19| 0.0%     1|    -      0
  packages/stanza-react/src/createStanzaInstance.ts                               |50.0%     14| 0.0%     1|    -      0
  packages/stanza-react/src/feature/WithStanzaFeature.tsx                         |52.9%     51| 0.0%     1|    -      0
  packages/stanza-react/src/hooks/useStanzaContext.ts                             |14.6%     41| 0.0%     1|    -      0
  packages/stanza-react/src/index.ts                                              | 100%      6|    -     0|    -      0
  packages/stanza-react/src/stanzaInstance.ts                                     | 100%      7|    -     0| 100%      2