Skip to content

[GS-5825]/provide support for typescript_Engineering Ticket #263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

PranitaJainB
Copy link

@PranitaJainB PranitaJainB commented Feb 20, 2025

Overview

Jira

GS-5825

Requirement

Contexture has never been user friendly, which is compounded by the fact that there is little documentation and no types. This ticket aims to add TypeScript support to it in order to make it more understandable and usable.

NOTE: This ticket is only about enabling TypeScript, not typing the code!

Verifying

I am testing by renaming a file packages/client/src/listeners.js to .ts extension . After that I ran a command tsc --noEmit at client folder , and it starts giving Typescript error .

@PranitaJainB PranitaJainB self-assigned this Feb 20, 2025
Copy link

changeset-bot bot commented Feb 20, 2025

⚠️ No Changeset found

Latest commit: 9f8bf37

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@PranitaJainB PranitaJainB marked this pull request as ready for review February 25, 2025 12:39
Copy link
Contributor

@sandhya-spend sandhya-spend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. tsx and typescript should be added to package.json so that they are setup during install. Also concurrently.
  2. Also, cannot run certain commands.
Screenshot 2025-02-27 at 1 51 41 PM

@PranitaJainB PranitaJainB marked this pull request as draft February 28, 2025 14:26
@PranitaJainB
Copy link
Author

PranitaJainB commented Feb 28, 2025

  1. tsx and typescript should be added to package.json so that they are setup during install. Also concurrently.
  2. Also, cannot run certain commands.

Done.

Copy link
Contributor

github-actions bot commented Feb 28, 2025

Warnings
⚠️ ❗ This PR is BIG (+594 -104) Please keep it below 500 net changes

Generated by 🚫 dangerJS against 9f8bf37

@PranitaJainB PranitaJainB marked this pull request as ready for review March 3, 2025 13:08
Copy link
Contributor

@sandhya-spend sandhya-spend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Blocker[ All the tsconfig.json fles are pretty much the same. Consolidate them all to tsconfig.all.jsonc and have only the differting options and extends.

@PranitaJainB PranitaJainB changed the title [GS-5825]/provide support for typescript [GS-5825]/provide support for typescript_Engineering Ticket Mar 3, 2025
Copy link
Contributor

@sandhya-spend sandhya-spend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. LGTM.

Copy link
Contributor

github-actions bot commented Apr 5, 2025

Coverage after merging GS-5825/support-for-typescript into main will be

99.58%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
packages/client/src
   exampleTypes.js95.25%85.71%40%98.50%109, 123, 126–132
   index.js98.89%93.85%100%100%211, 213, 284, 73
   lens.js100%100%100%100%
   listeners.js100%100%100%100%
   mockService.js95.65%83.33%100%100%22, 30
   node.js97.48%96%87.50%98.84%72, 76
   reactors.js99.12%100%90.91%100%
   serialize.js100%100%100%100%
   subquery.js98.80%88.89%100%100%66
   traversals.js100%100%100%100%
   types.js92.59%83.33%100%95.24%12–13
   validation.js78.13%80%100%77.78%20–26
packages/client/src/actions
   index.js100%100%100%100%
   wrap.js98.33%85.71%100%100%41
packages/client/src/exampleTypes
   pivot.js83.18%74.29%87.50%84.07%10–13, 138–139, 14, 140–149, 15, 150–160, 167–168, 21–22, 227, 23, 243, 257–263, 48, 53–57, 8–9, 9
packages/client/src/util
   futil.js67.31%100%57.14%65.85%18–19, 24–28, 31, 36–41
   tree.js100%100%100%100%
packages/export/src
   csv.js94.74%80%50%98%26, 47
   excel.js94.59%76.92%50%98.94%13, 38, 52, 91
   index.js0%0%0%0%1, 1–4, 6
   utils.js100%100%100%100%
packages/export/src/nodes
   fieldValuesGroupStats.js75%70%66.67%76.74%25, 29, 34–43, 9
   index.js0%0%0%0%1, 1–5
   pivot.js98.40%82.35%100%100%52, 56, 89
   results.js100%100%100%100%
   terms_stats.js100%100%100%100%
packages/provider-elasticsearch/src
   compat.js100%100%100%100%
   index.js79.26%46.43%80%85.33%100, 104, 104, 116–121, 123, 129, 13, 130–139, 14, 30, 61–67, 72–73, 79, 81, 88–89
   schema.js88.39%92.86%80%88.17%53–56, 86–93
   types.js100%100%100%100%
packages/provider-elasticsearch/src/example-types
   index.js100%100%100%100%
   schemaMapping.js100%100%100%100%
   testUtils.js98.88%92.31%100%100%12
packages/provider-elasticsearch/src/example-types/filters
   bool.js100%100%100%100%
   date.js87.18%66.67%50%91.18%10–11, 19, 9
   dateRangeFacet.js70.83%100%75%67.86%59–85
   exists.js100%100%100%100%
   facet.js91.47%76.47%66.67%94.50%39–40, 65–72
   geo.js100%100%100%100%
   number.js52.05%100%50%50%22–29, 33–56
   query.js100%100%100%100%
   step.js82.05%100%60%83.87%19–23
   tagsQuery.js86.98%90.63%85.71%86.36%111–128, 140, 149–153, 159–161
   tagsText.js100%100%100%100%
   text.js96.58%86.67%100%100%11, 22, 40, 71
packages/provider-elasticsearch/src/example-types/legacy
   cardinality.js93.33%100%50%100%
   dateHistogram.js95.45%100%50%100%
   esTwoLevelAggregation.js92.11%86.67%66.67%93.75%34–36, 83–87
   matchStats.js97.06%100%50%100%
   rangeStats.js100%100%100%100%
   smartIntervalHistogram.js97.44%100%50%100%
   statistical.js90.91%100%50%100%
   terms_stats.js97.73%100%66.67%100%
packages/provider-elasticsearch/src/example-types/metricGroups
   dateIntervalGroupStats.js100%100%100%100%
   dateRangesGroupStats.js98.28%100%75%100%
   fieldValuePartitionGroupStats.js87.76%100%40%92.31%34–36
   fieldValuesDelta.js97.44%100%66.67%100%
   fieldValuesGroupStats.js99.07%100%83.33%100%
   groupStatUtils.js86.05%100%75%85.71%20–24
   numberIntervalGroupStats.js100%100%100%100%
   numberRangesGroupStats.js97.87%100%66.67%100%
   percentilesGroupStats.js82.46%75%50%85.71%16–18, 24–26, 43–44
   pivot.js85.73%89.77%71.43%85.81%107, 151–152, 159, 166, 408–410, 460–470, 473, 478, 480, 483, 486, 534–535, 563–618, 75–81, 84–91
   stats.js91.30%100%50%100%
   tagsQueryGroupStats.js100%100%100%100%
packages/provider-elasticsearch/src/example-types/metricGroups/pivotData
   columnResponse.js100%100%100%100%
   columnResult.js100%100%100%100%
   pivotResponse.js100%100%100%100%
   pivotResponseWithFilteredFieldValueGroup.js100%100%100%100%
packages/provider-elasticsearch/src/example-types/results
   index.js20.93%100%0%21.95%10–39, 8–9
packages/provider-elasticsearch/src/example-types/results/highlighting
   request.js95.15%93.75%100%95.26%193, 193–201, 40–42
   response.js100%100%100%100%
   search.js22.22%100%0%22.64%20–60
   testSchema.js100%100%100%100%
   util.js100%100%100%100%
packages/provider-elasticsearch/src/schema-data
   aliases.js100%100%100%100%
   mapping-with-non-objects.js100%100%100%100%
   mapping-with-types.js100%100%100%100%
   mapping-without-types.js100%100%100%100%
   schema-with-types.js100%100%100%100%
   schema-without-types.js100%100%100%100%
packages/provider-elasticsearch/src/utils
   elasticDSL.js100%100%100%100%
   fields.js100%100%100%100%
   futil.js99.39%100%92.86%100%
   luceneQueryUtils.js100%100%100%100%
   regex.js100%100%100%100%
   results.js100%100%100%100%
   smartInterval.js83.33%33.33%100%92.86%11, 11, 9
packages/provider-mongo/src
   index.js93.33%71.43%83.33%96.77%10, 33, 45, 9
   types.js100%100%100%100%
packages/provider-mongo/src/example-types
   bool.js100%100%100%100%
   date.js98%90.91%100%100%23
   dateHistogram.js95.65%62.50%100%100%19, 25, 25
   exists.js100%100%100%100%
   facet.js99.30%95.74%100%100%123–124
   index.js100%100%100%100%
   mongoId.js100%100%100%100%
   number.js100%100%100%100%
   results.js97.74%92.31%100%99.01%180, 59, 61, 64–66
   statistical.js100%100%100%100%
   tagsText.js100%100%100%100%
   termsStats.js100%100%100%100%
   text.js100%100%100%100%
packages/server/src
   dataStrategies.js85.71%100%75%85%28–36
   exampleTypes.js97.10%83.33%100%100%6, 9
   index.js97.53%100%100%96.97%47–48
   utils.js88.37%93.75%100%86.02%44–49, 63–71
packages/server/src/__data__
   imdb.js100%100%100%100%
packages/server/src/provider-debug
   index.js100%100%100%100%
packages/server/src/provider-memory
   date.js96.67%100%60%100%
   exampleTypes.js91.61%91.67%81.25%93.20%100, 16–17, 50, 64, 96–99
   index.js95%66.67%100%100%10
   results.js95.24%50%100%100%14
packages/util/src
   dateUtil.js0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–69, 7, 70–74, 8–9
   keywordGenerations.js100%100%100%100%
packages/util/src/exampleTypes
   tagsQuery.js0%0%0%0%1, 1, 10–12, 2–9

@conraddavisjr conraddavisjr dismissed stellarhoof’s stale review April 7, 2025 17:23

Stale - re-review requested.

@@ -16,6 +20,7 @@
"@changesets/cli": "^2.26.0",
"@flex-development/toggle-pkg-type": "^1.0.1",
"@vitest/coverage-v8": "^2.1.1",
"concurrently": "^9.1.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocker: This package is not being used so it can be removed.

@@ -25,6 +30,8 @@
"glob": "^8.1.0",
"minimist": "^1.2.7",
"prettier": "^2.8.3",
"tsx": "^4.19.3",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocker: This package is not being used so it can be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants