Skip to content
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

fix: add types to exports for @formbricks/js #1597

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

florrdv
Copy link
Contributor

@florrdv florrdv commented Nov 8, 2023

What does this PR do?

Fixes type resolution when using the bundler moduleResolution TypeScript option.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • Enhancement (small improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change adds a new database migration
  • This change requires a documentation update

How should this be tested?

  • Create TypeScript project and install @formbricks/js
  • Set compilerOptions.moduleResolution to bundler in your tsconfig.json file
  • Observe that types are not resolved correctly
  • Make the change detailed in this PR, observe that this PR fixes the issue

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read How we Code at Formbricks
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand bits
  • Ran pnpm build
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues
  • First PR at Formbricks? Please sign the CLA! Without it we wont be able to merge it 🙏

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Formbricks Docs if changes were necessary

Copy link

vercel bot commented Nov 8, 2023

@florrdv is attempting to deploy a commit to the formbricks Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

github-actions bot commented Nov 8, 2023

Thank you for following the naming conventions for pull request titles! 🙏

@florrdv
Copy link
Contributor Author

florrdv commented Nov 8, 2023

Happy to provide any further details you may see fit.

Copy link
Contributor

packages/js/package.json

It's a good practice to keep the scripts in the package.json file organized and easy to understand. Currently, the "dev" and "go" scripts are doing the same thing, which can be confusing. Consider removing the duplicate script to improve readability.
Create Issue

    "scripts": {
      "dev": "vite build --watch",
      "build": "tsc && vite build",
      "lint": "eslint ./src --fix",
      "clean": "rimraf .turbo node_modules dist coverage"
    }

Currently, the "build" script is running the TypeScript compiler (tsc) and then running the Vite build. This could potentially be slow if the project is large. Consider using the "tsc --build" command, which is faster because it only recompiles files that have changed.
Create Issue

    "scripts": {
      "dev": "vite build --watch",
      "build": "tsc --build && vite build",
      "lint": "eslint ./src --fix",
      "clean": "rimraf .turbo node_modules dist coverage"
    }

Copy link
Member

@mattinannt mattinannt left a comment

Choose a reason for hiding this comment

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

@florrdv thanks a lot for this formbricks-js improvement :-)

@mattinannt mattinannt added this pull request to the merge queue Nov 8, 2023
Merged via the queue into formbricks:main with commit dd0091e Nov 8, 2023
9 of 11 checks passed
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.

None yet

2 participants