holistics / dbml

Database Markup Language (DBML), designed to define and document database structures
https://dbml.org
Apache License 2.0
2.9k stars 170 forks source link

Missing types.ts files in @dbml/parse@3.8.0 #631

Closed Alfoussen closed 2 months ago

Alfoussen commented 2 months ago

Hi,

Some files are absent from @dbml/parse@3.8.0, failing the typescript compilation

import { Parser } from '@dbml/core';
$ npx tsc -b 

node_modules/@dbml/parse/dist/lib/lexer/tokens.d.ts:1:26 - error TS2307: Cannot find module '../types' or its corresponding type declarations.

1 import { Position } from '../types';
                           ~~~~~~~~~~

node_modules/@dbml/parse/dist/lib/parser/nodes.d.ts:3:26 - error TS2307: Cannot find module '../types' or its corresponding type declarations.

3 import { Position } from '../types';
                           ~~~~~~~~~~

node_modules/@dbml/parse/dist/compiler.d.ts:8:26 - error TS2307: Cannot find module './lib/interpreter/types' or its corresponding type declarations.

8 import { Database } from './lib/interpreter/types';
image
huyleminh01 commented 2 months ago

Hi @Alfoussen ,

Could you provide use with more information about your current situation?

Thank you.

Alfoussen commented 2 months ago

@huyleminh01

Typescript : Version 5.5.4

tsconfig.json

{
    "compilerOptions": {
      "module": "commonjs",
      "esModuleInterop": true,
      "target": "es6",
      "moduleResolution": "node",
      "sourceMap": true,
      "outDir": "dist"
    },
    "include": ["src/cli/**/*"],
    "exclude": ["**/*.spec.ts"],
    "lib": ["es2015"]
}
Alfoussen commented 2 months ago

Hi @huyleminh01

I manually added those missing files named type.d.ts and could make it compile. I just wonder why they are absent (or suppressed) from the original package... I escalated back to some older versions and still same missing files. Let me know if you need more info.

Huy-DNA commented 2 months ago

hi @Alfoussen, thanks for letting us know this :heart: We've acknowledged the problem and will notify you when the problem is fixed!

Huy-DNA commented 2 months ago

@Alfoussen fixed in https://github.com/holistics/dbml/pull/632, please let us know if you encounter any other errors.