teambit / envs

Component development environments for the Bit community
https://bit.dev/bit/envs
Other
63 stars 9 forks source link

Cannot build customs types (as described in the FAQ) #108

Open seed-of-apricot opened 4 years ago

seed-of-apricot commented 4 years ago

Describe the bug

Cannot export my custom d.ts file as a component. This is the first step of:

How to include custom-types folder from the author environment? You have some custom-types folder which extend other types with your own type definition. You want to reuse it in capsule. Do the following:

  • create a component from the types. <--- this one
  • add it in overrides to all other components.
  • include it in tsconfig.include as following:

Steps to Reproduce

  1. Create a folder @types under src.

image

  1. bit add src/@types --id types
  2. bit tag --all

Expected Behavior

The component will be ready to be exported.

Screenshots, exceptions and logs

C:\Users\apricot\src\apricot\chronolapselibrary\assets>bit add src/@types --id types
tracking component types:
added src/@types/svg.d.ts

C:\Users\apricot\src\apricot\chronolapselibrary\assets>bit status
new components
(use "bit tag --all [version]" to lock a version with all your changes)

     > types ... ok

modified components
(use "bit tag --all [version]" to lock a version with all your changes)
(use "bit diff" to compare changes)

     > images/logo ... ok

C:\Users\apricot\src\apricot\chronolapselibrary\assets>bit tag --all
  building components...
error: bit failed to build types with the following exception:
ENOENT: no such file or directory, scandir 'C:\Users\apricot\AppData\Local\Temp\bit\capsule-03946\dist'
Error: ENOENT: no such file or directory, scandir 'C:\Users\apricot\AppData\Local\Temp\bit\capsule-03946\dist'

Specifications

Additional context

bit.json

{
  "env": {
    "compiler": "bit.envs/compilers/react-typescript@3.1.45"
  },
  "componentsDefaultDirectory": "components/{name}",
  "packageManager": "npm",
  "overrides": {
    "src/@types": {
      "env": {
        "compiler": "-"
      }
    }
  }
}
alvaro-canepa commented 3 years ago

Any new on it? Using bit.envs/compilers/typescript@3.1.49 has the same issue. Folder /tmp/bit/capsule-#/dist doesn't created

I don't know if is relevant, but I noted only .ts, .tsx files are readed in /packages/common/src/create-ts-compiler.ts