Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to run this package with "skipLibCheck=false" not possible #8

Closed
dennismeister93 opened this issue Aug 31, 2020 · 2 comments · Fixed by #10
Closed

option to run this package with "skipLibCheck=false" not possible #8

dennismeister93 opened this issue Aug 31, 2020 · 2 comments · Fixed by #10

Comments

@dennismeister93
Copy link

dennismeister93 commented Aug 31, 2020

Hey :)

When trying to build my application with your package I ended up with this error:

node_modules/@rsql/ast/dist/index.d.ts:3:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.

3 const EQ: "==";
  ~~~~~


node_modules/@rsql/parser/dist/index.d.ts:7:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.

7 function parse(source: string): ExpressionNode;
  ~~~~~~~~

It surely works when flagging skipLibCheck=true, but is this really wanted?

I now ended up with creating 2 custom typings in my application:

rsql_ast.d.ts:

declare module '@rsql/ast' {...}

rsql_parser.d.ts:

import { ExpressionNode } from '@rsql/ast';
declare module '@rsql/parser' {
    function parse(source: string): ExpressionNode;
}

i then was able to remove the skipLibCheck flag from my tsconfig and added the following option to it:

"paths": {
      "*": ["node_modules/*"],
      "@rsql/ast": ["custom_typings/rsql_ast.d.ts"],
      "@rsql/parser": ["custom_typings/rsql_parser.d.ts"]
    }

Looking forward to hear from you :)

@piotr-oles
Copy link
Owner

Thanks for reporting this issue, I will take a look at this in a few days. PR's are welcome, so if you have an idea how to fix, go ahead :)

piotr-oles added a commit that referenced this issue Sep 29, 2020
The dts-bundle project is not-maintained anymore. There is a PR to fix
an issue but no-one merges it. I could merge it as I'm part of the
TypeStrong organization but I still don't have publish access. To
overcome this blocker, I've copied the package and applied the fix. I
didn't found any maintaned package that could inline typings as
dts-bundle does.

✅ Closes: #8
@piotr-oles
Copy link
Owner

I've published a canary version - could you test if it solves your issues?

npm install @rsql/ast@1.0.2-canary.10.71f98a5.0
npm install @rsql/builder@1.0.2-canary.10.71f98a5.0
npm install @rsql/emitter@1.0.2-canary.10.71f98a5.0
npm install @rsql/parser@1.0.2-canary.10.71f98a5.0
# or 
yarn add @rsql/ast@1.0.2-canary.10.71f98a5.0
yarn add @rsql/builder@1.0.2-canary.10.71f98a5.0
yarn add @rsql/emitter@1.0.2-canary.10.71f98a5.0
yarn add @rsql/parser@1.0.2-canary.10.71f98a5.0

piotr-oles added a commit that referenced this issue Oct 8, 2020
The dts-bundle project is not maintained anymore. There is a PR to fix an issue but no-one merges it. I could merge it as I'm part of the TypeStrong organization but I don't have a publish access.  To overcome this blocker, I've copied the package and applied the fix. I didn't found any maintained package that could inline typings as dts-bundle does.

✅ Closes: #8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants