Skip to content

SNOW-2111092 TypeScript Support #1080

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

Merged
merged 37 commits into from
Jun 10, 2025

Conversation

sfc-gh-rsavenok
Copy link
Collaborator

@sfc-gh-rsavenok sfc-gh-rsavenok commented May 19, 2025

Description

This PR implements TypeScript support, allowing us to write new code in TypeScript and start the migration of old files.

  • The new /dist folder will contain compiled JS code. Customers will start using /dist/index.js as an entry point.
  • ts files can be imported into js files
  • js files can be imported into ts files
  • Added migration playbook to README.md

New devDependencies

  • @types/** - these are *.d.ts files for libraries we use
  • ts-node - used by mocha to run tests with typescript build pipeline

Ensuring that compiled code works as expected

  • Mocha will run with ts-node, which will compile every test file before executing and ensure similar behavior to compiled code
  • if typescript has errors, npm pack would fail and would prevent us from publishing a broken build
  • on top of that, we have performance tests in monorepo, that are using snowflake-sdk package directly, so they will crush if our compiled code can't execute

Security Review

https://github.com/snowflakedb/security_reviews/pull/6846

Checklist

  • Format code according to the existing code style (run npm run lint:check -- CHANGED_FILES and fix problems in changed code)
  • Create tests which fail without the change (if possible)
  • Make all tests (unit and integration) pass (npm run test:unit and npm run test:integration)
  • Extend the types in index.d.ts file (if necessary)
  • Extend the README / documentation and ensure is properly displayed (if necessary)
  • Provide JIRA issue id (if possible) or GitHub issue id in commit message

@sfc-gh-snowflakedb-snyk-sa
Copy link
Contributor

sfc-gh-snowflakedb-snyk-sa commented May 19, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@sfc-gh-rsavenok sfc-gh-rsavenok changed the title POC TS support SNOW-2111092 TypeScript Support May 19, 2025
@sfc-gh-rsavenok sfc-gh-rsavenok marked this pull request as ready for review May 29, 2025 21:16
@sfc-gh-rsavenok sfc-gh-rsavenok requested a review from a team as a code owner May 29, 2025 21:16
@sfc-gh-rsavenok sfc-gh-rsavenok requested review from sfc-gh-dszmolka and removed request for sfc-gh-dszmolka June 10, 2025 12:38
Copy link

codecov bot commented Jun 10, 2025

Codecov Report

Attention: Patch coverage is 96.70330% with 3 lines in your changes missing coverage. Please review.

Project coverage is 89.38%. Comparing base (a9174fb) to head (2d0c532).

Files with missing lines Patch % Lines
lib/util.ts 97.53% 1 Missing and 1 partial ⚠️
lib/snowflake.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1080      +/-   ##
==========================================
+ Coverage   89.21%   89.38%   +0.16%     
==========================================
  Files          76       76              
  Lines        7558     7553       -5     
  Branches        0       51      +51     
==========================================
+ Hits         6743     6751       +8     
+ Misses        815      795      -20     
- Partials        0        7       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sfc-gh-rsavenok sfc-gh-rsavenok merged commit f3fb322 into master Jun 10, 2025
50 checks passed
@sfc-gh-rsavenok sfc-gh-rsavenok deleted the rsavenok/ts-migration-playground branch June 10, 2025 13:04
@github-actions github-actions bot locked and limited conversation to collaborators Jun 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants