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
1
vote
0 answers

TSDX can't import CSS/SASS files as modules in React components

I have created TSDX react-with-storybook project, but found out that I couldn't import CSS modules. The problem appears when I run npm start: ✖ Failed to compile (typescript) Error: G:/projects/design-system/src/index.tsx(2,19): semantic error…
Vladislav
  • 33
  • 4
1
vote
0 answers

Warning: Did not expect server HTML to contain the text node "Home" in

We are making an npm react package (by tsdx library) which is a custom hook. Developers who install this package need to make a config.json file at the root and a Languages.json file in the public folder of their Next.js project. We need to access…
Roya Sh
  • 11
  • 1
1
vote
1 answer

How to add a polyfill to a library?

Been trying to learn how to create/distribute a npm package, and I've composed my first library that utilizes the ResizeObserver API, which currently has about 89.6% global support at the moment. I'd like to bundle up a file that includes the…
1
vote
0 answers

How I run storybook with tsx and sass files

I'm using TSDX to create a library with storybook. My problem is when I run storybook with: npm run start-storybook -p 6006 show me next errors: ERROR in ./src/sidenav/functions/index.tsx Module not found: Error: Can't resolve…
Javier
  • 1,975
  • 3
  • 24
  • 46
1
vote
0 answers

tsdx and babel fail to build typical TypeScript with unexpected token

I'm creating a little React component library. For doing so I'm using tsdx. Unfortunately the build fails (tsdx build) already fails with a very basic error. $ tsdx build ✓ Creating entry file 1.3 secs (babel plugin) SyntaxError:…
Robin
  • 8,162
  • 7
  • 56
  • 101
1
vote
2 answers

Should I git-push a dist folder of a npm package

The JS package I've prepared (using tsdx) is being used across multiple company systems. It lies within our gitlab so the package.json entry looks like this: "some-package":…
user0101
  • 1,277
  • 1
  • 9
  • 17
1
vote
1 answer

Class constructor cannot be invoked without 'new' for TSdx package

I created a npm package using TSdx for a small Jest reporter. If I use that package in another project, I get the following error. Uncaught TypeError: Class constructor BaseReporter cannot be invoked without 'new' at new ExampleReporter…
sschmeck
  • 7,233
  • 4
  • 40
  • 67
1
vote
0 answers

Tree shaking with TSDX - typescript with rollup

I have a Monorepo which is created using yarn workspaces and bundled with TSDX. Note: TSDX is Typescript + Rollup My Monorepo has 2 folders inside packages, App (private) - It's a CRA - create react app application, this application is…
0
votes
0 answers

Uncaught TypeError: Failed to resolve module specifier. Relative references must start with either "/", "./", or "../"

I'm using TSDX to create my module, which implements rollup, and I'm running into an issue with using the module correctly in another project. The module seems to build and publish just fine, I'm able to install it in my other project, and I'm…
Cameron Crane
  • 113
  • 1
  • 12
0
votes
0 answers

Does anyone have this error while creating a TSDX project?

I want to try using TSDX but whenever I try to create a new TSDX project using : npx tsdx create 'name' my cmd get stuck on modules installation like this : Anyone knows how to solve that? I tried to reinstall Node and NPM but it didn't change…
Nvm_0
  • 1
  • 2
0
votes
0 answers

How do I include extra files in my NPM package?

I am writing my first NPM package. There should be a text file that the program reads from to generate random names. But, whenever I do an NPM build, the "dist" folder doesn't have the text file. I am using tsdx to make this.
0
votes
1 answer

CSS How to fix 'Invalid property value'

I'm creating a React component library using the TSDX react-with-storybook template. However, I can't seem to get CSS to work in my components via import. Here is a my button component: import React, { FC, HTMLAttributes } from 'react'; import…
Perry
  • 62
  • 1
  • 8
0
votes
0 answers

How to read files on the client-side not only on server side?

We are making an npm react package (by tsdx library), a custom hook for multi-languaging react projects. Developers who install this package need to make a config.json file at the root and a Languages.json file in the public folder of their Next.js…
0
votes
0 answers

Strict-mode does not allow assignment to undefined variables

After build the TypeScript using tsdx and doing the minify with NUglify I start to get the error Strict-mode does not allow assignment to undefined variables: regeneratorRuntime. try { regeneratorRuntime = runtime; } catch (accidentalStrictMode)…
Pablo
  • 1,953
  • 4
  • 28
  • 57
0
votes
1 answer

Components based on Chakra from my own library don't get themed

I started a component library, based on tsdx --template react-with-storybook, added chakra-ui/react as a dependency, then created components in it. The components use colors from Chakra's default theme -- in particular, blue.700. In Storybook, I…
RemcoGerlich
  • 30,470
  • 6
  • 61
  • 79