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

chore: bump ts node #9498

Merged
merged 3 commits into from
Mar 5, 2024
Merged

chore: bump ts node #9498

merged 3 commits into from
Mar 5, 2024

Conversation

jordanh
Copy link
Contributor

@jordanh jordanh commented Mar 3, 2024

Description

Dumps ts-node to facilitate a more useful REPL.

Demo

Loom: https://www.loom.com/share/0d3311fe7a5640c5a0e9d81781c7f6b9?sid=895f8705-f17d-4928-9f37-31ccd717e3a9

Testing scenarios

[Please list all the testing scenarios a reviewer has to check before approving the PR]

  • Try REPL!

Run as:

DOTENV_CONFIG_PATH=<absolute path to your .env> npx -w parabol-server ts-node -r dotenv/config -O '{"noUnusedLocals":false, "strict":false, "noImplicitAny":false, "module":"NodeNext","target":"ESNext"}'

At the REPL prompt, try:

> import getKysely from './postgres/getKysely'
undefined
> const pg = getKysely()
undefined
> await pg.selectFrom('Team').select(['name','orgId']).where('id','=','6VSEcEuGdy').limit(1).execute()
[ { name: 'Company', orgId: 'Skc7syWwNox' } ]

Neat!

  • Add to your VSCode task.json (⌘ + shift + p) -> Task: Open User Tasks and add to tasks array:
    {
      "label": "Start TypeScript REPL",
      "type": "shell",
      "command": "DOTENV_CONFIG_PATH=<absolute path to .env> npx -w parabol-server ts-node -r dotenv/config -r dotenv/config -O '{\"noUnusedLocals\":false, \"strict\":false, \"noImplicitAny\":false, \"module\":\"NodeNext\",\"target\":\"ESNext\"}'",
      "problemMatcher": [],
      "presentation": {
        "reveal": "always",
        "panel": "new"
      }
    }
  • Run it with (⌘ + shift + p) -> Task: Run Task

Final checklist

  • I checked the code review guidelines
  • I have added Metrics Representative as reviewer(s) if my PR invovles metrics/data/analytics related changes
  • I have performed a self-review of my code, the same way I'd do it for any other team member
  • I have tested all cases I listed in the testing scenarios and I haven't found any issues or regressions
  • Whenever I took a non-obvious choice I added a comment explaining why I did it this way
  • I added the label Skip Maintainer Review Indicating the PR only requires reviewer review and can be merged right after it's approved if the PR introduces only minor changes, does not contain any architectural changes or does not introduce any new patterns and I think one review is sufficient'
  • PR title is human readable and could be used in changelog

@github-actions github-actions bot added the size/s label Mar 3, 2024
@@ -12,13 +11,13 @@ export async function up() {
.insert(
r
.table('ReflectPrompt')
.filter((row) => row('id').count().gt(100))
.map((row) => row.merge({id: row('id').slice(0, 100)}))
.filter((row: RDatum) => row('id').count().gt(100))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems bumping this version of TS Node made a few more no implict: any buggies appear. This (and below) popped up when I was testing a migration

@jordanh jordanh changed the title Chore/bump ts node chore: bump ts node Mar 3, 2024
@jordanh jordanh requested a review from mattkrick March 3, 2024 06:58
@jordanh jordanh marked this pull request as ready for review March 4, 2024 18:25
@github-actions github-actions bot requested a review from tghanken March 4, 2024 18:25
@mattkrick
Copy link
Member

nice!
if you ever want to compile TS without checking for errors you can always run yarn sucrase-node instead of ts-node! it's pretty nice when just hacking away & not wanting to write perfect TS

@mattkrick mattkrick merged commit 58c5817 into master Mar 5, 2024
13 checks passed
@mattkrick mattkrick deleted the chore/bump-ts-node branch March 5, 2024 22:17
@github-actions github-actions bot mentioned this pull request Mar 6, 2024
24 tasks
@jordanh
Copy link
Contributor Author

jordanh commented Mar 8, 2024

if you ever want to compile TS without checking for errors you can always run yarn sucrase-node instead of ts-node! it's pretty nice when just hacking away & not wanting to write perfect TS

TIL, thank you!

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

Successfully merging this pull request may close these issues.

None yet

2 participants