#1/4 .ts files missing d.ts file after `tsc`

1 messages · Page 1 of 1 (latest)

last briar
#

I am creating an npm package and it mostly works but I cannot use

import { dialog, specificCharacter } from 'anomaly-packer'

because generated texts.js file is the only one that is missing a declaration file so I cannot have types from this specific module like dialog and specificCharacter functions after installing this package.

// src/index.ts
export * from './pack'
export * from './texts'

I also checked that my texts.ts has at least 1 export, it's got 4 exported functions, more than that it's also used by the pack.ts

// src/pack.ts
import * as texts from './texts'

ps I also have some error logs after running tsc but my dist dir is created anyways, it's just this one file that does not recieve a corresponding d.ts 🙃

#

and I also attach my tsconfig OFC

{
  "$schema": "https://raw.githubusercontent.com/TypeScriptToLua/TypeScriptToLua/master/tsconfig-schema.json",
  "compilerOptions": {
    "jsx": "react-jsx",
    "target": "ESNext",
    "module": "ESNext",
    "lib": ["ESNext"],
    "moduleResolution": "Bundler",
    "declaration": true,
    "skipLibCheck": true,
    "strictNullChecks": true,
    "strict": true,
    "moduleDetection": "force",
    "allowSyntheticDefaultImports": true,
    "outDir": "dist",
    "paths": {
      "@/*": ["./src/*"],
      "#/*": ["./*"]
    }
  },
  "tstl": {
    "luaTarget": "5.4"
  },
  "include": ["src"]
}
maiden horizon
#

I think you can debug it yourself. Doesn't seem like a TS "Feature"

#

Try renaming the file, recreating it, changing contents etc

last briar
#

@maiden horizon i decided to use tsup (lord forgive me for that but it works at least 🙏)

maiden horizon
#

You should really just toy with it until you figure it out

#

It not hard to debug

#

Either the issue is with the filename, the content, some file properties that would be fixed by recreating it, or some other issue with the build

last briar
last briar
#

!resolved