Questions tagged [tsdx]

Zero-config CLI for TypeScript package development

Despite all the recent hype, setting up a new TypeScript (x React) library can be tough. Between Rollup, Jest, tsconfig, Yarn resolutions, ESLint, and getting VSCode to play nicely....there is just a whole lot of stuff to do (and things to screw up). TSDX is a zero-config CLI that helps you develop, test, and publish modern TypeScript packages with ease--so you can focus on your awesome new library and not waste another afternoon on the configuration.

https://www.npmjs.com/package/tsdx

31 questions
7
votes
1 answer

Typescript inferred type cannot be named without reference

My project's setup is tsdx (based on Rollup and Typescript). Working in my IDE (vscode) everything looks fine, and even running yarn tsc works without errors. When I'm running yarn build (which is tsdx build) I get the following error: (typescript)…
itaied
  • 119
  • 1
  • 1
  • 6
6
votes
1 answer

How to structure an NPM package with general utilities

I need to make an NPM package for some common functionality used by various frontend-projects in our company, but very unsure how to do it properly. We're using Typescript, and tsdx seem to handle several things I'm very unsure how to do properly,…
Svish
  • 152,914
  • 173
  • 462
  • 620
5
votes
3 answers

Error while importing component from library

I'm working on this component library that uses tsdx, all of the components work fine except for this one. It's a dialog that uses the @headlessui/react lib, and it's Dialog component. It's exported like this: DialogBase.Content =…
David Díaz
  • 89
  • 4
  • 15
5
votes
0 answers

Cannot find module '@babel/plugin-proposal-private-property-in-object'

I added @storybook/preset-create-react-app to my addons, because I want the storybook to work with React/CRA. Basically, I am trying to import SVG the same way as CRA does. import SomeSvgStaticUrl, { ReactComponent as SomeSvgReactComponent } from…
Hafiz Temuri
  • 3,882
  • 6
  • 41
  • 66
5
votes
0 answers

Export submodules instead of all components in the root with tsdx

Current Behavior We are building shared-code projects with tsdx, and we only have one doubt, concern we can't get an answer. How to export subfolders for packages published with TSDX. Let's use my previous example for the question. In the entry…
robertovg
  • 1,018
  • 11
  • 16
3
votes
1 answer

npm publish only publish index.js and excluding everything else

Problems I'm trying to publish my own SDK in npm. When I'm trying to install my packages, my dist folder only shows index.js Code: Here is my package.json file. It already includes main and files, https://docs.npmjs.com/cli/v8/using-npm/scripts. { …
3
votes
0 answers

How can I apply module augmentation for a peer dependency?

My scenario I am creating a TypeScript package using TSDX (react-storyook template) with a MUI v5 peer dependency. In the package, I am augmenting the theme in order to customise it, as documented by MUI. I am then consuming this package by a…
hasanas
  • 101
  • 3
3
votes
0 answers

tsdx - import .css - error - PostCSS plugin postcss-modules requires PostCSS 8

I have created a package using TSDX create . I require to use a .css file I followed the guide from https://tsdx.io/customization#rollup Error: Error: PostCSS plugin postcss-modules requires PostCSS 8.
tony
  • 41
  • 3
3
votes
0 answers

Reduce import cost of TSDX package

So I'm a bit new to bundle size performance improvements and something I'm trying to do is to reduce the import cost of my component library that's written in TSDX. It's a tool to create Typescript libraries based on rollup.js. I'm using the out of…
Giesburts
  • 6,879
  • 15
  • 48
  • 85
2
votes
1 answer

tsdx problem - creating a project with template react-with-stoybook FAILED

I wanted to create UI components library with Storybook and React. It was my first time using Storybook and I just followed the instruction from the documentation: https://tsdx.io/#quick-start I typed npx tsdx create my-components in the…
Chloezhang
  • 39
  • 4
2
votes
0 answers

MUI Theme provider not working in tsdx package development

Tring to create a custom button component with mui button using theme provider. Its working with react app and story book when using it directly. in my case, I need to publish custom button component as npm package and I'm using tsdx for developing…
2
votes
2 answers

Unable to use import instead of require, or unable to build dependensides with ts-node & tsdx

I have the following problem and know exactly why it has been triggered, but I haven't found any solution yet, so probably the community may help me with that. I am using tsdx for initiating ts repos, and also ts-node for quick debug (instead of…
AlexZeDim
  • 3,520
  • 2
  • 28
  • 64
1
vote
1 answer

i18next module does not compile within React-Typescript application

I have a React-Typescript application and had recently configured i18next setup for multi-language support. I believe all of the setups have been done correctly by following the guidelines of the official documentation. However, when I run the app,…
Ozan Yurtsever
  • 1,274
  • 8
  • 32
1
vote
1 answer

how to test my tsdx ui library package locally on react.js project

i use tsdx to create a react ui library, and i want to test it on my next.js project before pushing it to the npm package. i have try npm link , it works well in the beginning but when i change any thing in the package files it gave me an error,…
malngaawy
  • 105
  • 1
  • 9
1
vote
1 answer

tsdx - react is null, prevents hook usage

I've recently tried creating a react typescript component using tsdx to compile and I've hit a bit of a wall when debugging. The package is published and seemingly being published and installed without error. However, when it comes to actually being…
shubwub
  • 41
  • 8
1
2 3