tsdx | Zero-config CLI for TypeScript package development | Frontend Framework library
kandi X-RAY | tsdx Summary
kandi X-RAY | tsdx Summary
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.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tsdx
tsdx Key Features
tsdx Examples and Code Snippets
Community Discussions
Trending Discussions on tsdx
QUESTION
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:
...ANSWER
Answered 2021-Oct-15 at 08:13Not a problem with your React environment, its just that your css is invalid.
Theres no need to encapsulate your css property values in ticks (there are some occasions you need ticks, but none of your's need em).
QUESTION
I'm new to Node and In this package.json for React Typescript project I understand what rimraf
does but what is the --tsconfig
doing at the end?
When I run the prebuild
script I see that the file typedoc.json is deleted. But why this --tsconfig
? There is a tsconfig.json file but I can’t see that rimraf
is doing anything
ANSWER
Answered 2021-Oct-12 at 11:31Firstly, rimraf
will not do anything to the tsconfig.json
file. It’s important to understand that the docs
script in the package.json file, i.e. this part;
QUESTION
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 building code each time).
So, each time when I want to add the module to my package via yarn add modulename
and if in my tsconfig.json
file in compilerOptions
option: "module": "commonjs"
has the following value, tsdx build
unable to build code, and return me the following error:
Error: Incompatible tsconfig option. Module resolves to 'CommonJS'. This is incompatible with rollup, please use 'module: "ES2015"' or 'module: "ESNext"'
BUT!
if I will update compilerOptions
to module: "ESNext"
from commonjs
, ts-node
will give me an error, because it's still unable to use import {Method} from Module
instead of const x = require(CommonJS)
(which is quite old bug, according to this issue and this question)
- Typescript -v 4.1.5 (latest)
- ts-node: "^9.1.1"
- node -v: 15+
ANSWER
Answered 2021-Feb-12 at 20:45Currently working compromise is having two config files, which are exactly the same:
tsconfig.json
tsconfig.dev.json
except that the second has "module":"commonjs"
The second option, which actually somehow not working for me is adding to WebStrom's Environment Variables TS_NODE_COMPILER_OPTIONS='{"module":"commonjs"}'
from this question.
QUESTION
ANSWER
Answered 2020-Sep-29 at 09:05You can just set --target node
to fix the issue (since the default value is browser
).
QUESTION
I'm using Prisma upsert and getting an error about missing a required value when I'm trying to set one of the fields, which is an array type, specifically numeric[]
.
I'm using Prisma version 2.6.0
Data is getting into the database for all except a handful of rows and I'm getting an error thrown by Prisma on those rows when the upsert executes.
The error I'm getting from prisma is related to the array I'm trying to set:
...ANSWER
Answered 2020-Sep-03 at 23:08I wrote some jest tests to determine the cause of this and it turns out this was caused by passing in [0, null]
. After fixing the dataset this issue cleared up.
QUESTION
I have created a React library using TSDX → https://github.com/deadcoder0904/react-typical
It uses CSS Modules & attaches styles to the React library.
The bundle correctly outputs CSS file into the dist/
folder but it never really references it as it should.
This causes my styles to not show up at all.
Here's my complete tsdx.config.js
:
ANSWER
Answered 2020-Aug-08 at 15:46From my understanding, normally a library usually introduce the component & styles separately and let the users know in the document if they want to use default style then let import css file too such as:
QUESTION
I have made a React library using https://tsdx.io & chose the React + TypeScript + Storybook template.
The entire code is here → https://github.com/deadcoder0904/react-typical
I get this error:
undefined is not iterable (cannot read property Symbol(Symbol.iterator)) TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator)) at __read (http://localhost:6006/vendors~main.c9781e3a7458a3b52f4d.bundle.js:177373:46) at __spread (http://localhost:6006/vendors~main.c9781e3a7458a3b52f4d.bundle.js:177391:24) at http://localhost:6006/main.c9781e3a7458a3b52f4d.bundle.js:77:127 at commitHookEffectListMount (http://localhost:6006/vendors~main.c9781e3a7458a3b52f4d.bundle.js:140995:26) at commitPassiveHookEffects (http://localhost:6006/vendors~main.c9781e3a7458a3b52f4d.bundle.js:141033:11) at HTMLUnknownElement.callCallback (http://localhost:6006/vendors~main.c9781e3a7458a3b52f4d.bundle.js:121452:14) at Object.invokeGuardedCallbackDev (http://localhost:6006/vendors~main.c9781e3a7458a3b52f4d.bundle.js:121501:16) at invokeGuardedCallback (http://localhost:6006/vendors~main.c9781e3a7458a3b52f4d.bundle.js:121556:31) at flushPassiveEffectsImpl (http://localhost:6006/vendors~main.c9781e3a7458a3b52f4d.bundle.js:144117:9) at unstable_runWithPriority (http://localhost:6006/vendors~main.c9781e3a7458a3b52f4d.bundle.js:170649:12)
Not sure how I can get rid of it?
My storybook file ReactTypical.stories.tsx
is so simple:
ANSWER
Answered 2020-Aug-03 at 09:33I found the answer. Turns out the steps
variable was undefined
in Storybook & was working well in the example from examples/
folder so I changed the Storybook code.
QUESTION
I'm working with the TSDX tool to build a react-typescript library. I have a number of types exported in my @types/
directory which are clearly picked up by the compiler as I use them within the app with no trouble.
However, during my build, they do not get copied into my output bundle, which surprises me, since they are referenced through the code (which does get bundled correctly).
...ANSWER
Answered 2020-Apr-30 at 19:07This is actually, believe it or not, by design.
You can define the location of your types in tsconfig.json and it is expected that they are always in the final build (by the fact that they are not moved). i.e. given this structure:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install tsdx
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page