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

Migrate off tsdx #126

Closed
karlhorky opened this issue Oct 14, 2021 · 8 comments · Fixed by #587
Closed

Migrate off tsdx #126

karlhorky opened this issue Oct 14, 2021 · 8 comments · Fixed by #587

Comments

@karlhorky
Copy link
Member

karlhorky commented Oct 14, 2021

tsdx was a nice idea, but it's no longer maintained.

Time to come up with our own solution for this, maybe using:

@karlhorky
Copy link
Member Author

Wonder if this starter could offer us any tips: https://github.com/egoist/ts-lib-starter

@karlhorky
Copy link
Member Author

karlhorky commented Apr 1, 2022

Or, also consider moving to one of:

  • microbundle
  • unbuild
  • preconstruct
  • tsup
  • pkgroll

Some all-in-one solutions like scaffoldres may offer some inspiration as well (although I guess moving completely to them may have problems similar to tsdx, if they become less maintained):

@karlhorky
Copy link
Member Author

@karlhorky
Copy link
Member Author

karlhorky commented Sep 14, 2022

Maybe another example, this one using esbuild (and Turborepo!): https://github.com/mmazzarolo/tangerine-monorepo

@karlhorky
Copy link
Member Author

@karlhorky
Copy link
Member Author

karlhorky commented Apr 14, 2023

Another reason to switch:

During the switch from Yarn to pnpm (#379 ), we also had to add some additional weird configuration:

.github/workflows/build-lint-test.yml

      - name: Check types
        run: |
          pnpm tsc --project __tests__/tsconfig.json
          pnpm tsc --project bin/tsconfig.json
          pnpm tsc --project docker/tsconfig.json
          pnpm tsc --project tsconfig.config.json

Screenshot 2023-04-14 at 10 27 31

@ProchaLu
Copy link
Member

ProchaLu commented Apr 14, 2023

My reason for switching:
After encountering issues with TSDX and switching to pnpm in PR #379, we must consider migrating away from TSDX as a solution. Currently, we are using node-linker=hoisted as a temporary workaround, but this may not be a long-term solution.

Different solutions without switching what I tried were to use rollup-plugin-typescript2 package to version 0.32.0 in my package.json file using PNPM's overrides feature.

  "pnpm": {
    "overrides": {
      "rollup-plugin-typescript2": "^0.32.0"
    }
  }

However, this approach resulted in a semantic error. I also explored other workarounds, such as using shamefully-hoist=true with pnpm, but this caused another error related to untyped function calls not accepting type arguments.

I have described these different solutions in detail in this comment

@karlhorky
Copy link
Member Author

Another option would be to just publish TypeScript, and use node --experimental-strip-types to run Preflight (no build step)

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 a pull request may close this issue.

2 participants