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

oxc-transform does not return declaration ever since after the v0.30 version #7010

Closed
tunnckoCore opened this issue Oct 29, 2024 · 0 comments · Fixed by #7012
Closed

oxc-transform does not return declaration ever since after the v0.30 version #7010

tunnckoCore opened this issue Oct 29, 2024 · 0 comments · Fixed by #7012
Assignees
Labels
C-bug Category - Bug P-high Priority - High

Comments

@tunnckoCore
Copy link

tunnckoCore commented Oct 29, 2024

I use it to convert typescript files, but any version after the 0.30.0 version it doesn't have declaration in the result that the method returns

const xform = oxc.transform(filepath, source, {
  cwd: opts.cwd,
  typescript: {
    // if `--dts` flag emit types, otherwise don't
    declaration: opts.dts ? { stripInternal: false } : {},
    rewriteImportExtensions: true,
  },
});

console.log(xform); // => in 0.30.0: { code, declaration, errors }

if (xform.errors.length > 0) {
  throw new Error('oxc-transform failure: ' + xform.errors.join(';'));
}
if (typeof xform.declaration !== 'string') {
  throw new Error('oxc-transform failure: no declaration');
}

Does it stopped extracting declarations or what?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category - Bug P-high Priority - High
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants