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

Updates for Deno 2 #79

Merged
merged 4 commits into from
Oct 23, 2024
Merged

Updates for Deno 2 #79

merged 4 commits into from
Oct 23, 2024

Conversation

noelforte
Copy link
Contributor

@noelforte noelforte commented Oct 23, 2024

In prep for tackling #78, I have updated dependencies and also needed to handle a type assertion case because of how Typescript in Deno 2 handles error parameters in a try ... catch statement. This pull should bring everything up-to-date for running in Deno v2.

Hopefully nothing vastly breaking here but thought it best to open a seperate pull for these changes as they don't relate to #78.

@oscarotero oscarotero merged commit d2d774a into ventojs:main Oct 23, 2024
1 check passed
@oscarotero
Copy link
Collaborator

Thank you!

@noelforte
Copy link
Contributor Author

I don't believe this pull introduced any breaking changes, but while updating things I did notice that dnt fails to build the npm package with the following error:

$ deno task build-npm 1.12.11
Task build-npm deno run --allow-run=npm --allow-env --allow-sys --allow-read --allow-write --allow-net=jsr.io _scripts/build_npm.ts "1.12.11"
[dnt] Transforming...
[dnt] Running npm install...

added 10 packages, and audited 11 packages in 2s

found 0 vulnerabilities
[dnt] Building project...
[dnt] Type checking ESM...
src/deps.ts:7:30 - error TS6137: Cannot import type declaration files. Consider importing 'estree' instead of '@types/estree'.

7 export type * as ESTree from "@types/estree";
                               ~~~~~~~~~~~~~~~

error: Uncaught (in promise) Error: Had 1 diagnostics.
          throw new Error(`Had ${diagnostics.length} diagnostics.`);
                ^
    at getProgramAndMaybeTypeCheck (https://jsr.io/@deno/dnt/0.41.3/mod.ts:468:17)
    at build (https://jsr.io/@deno/dnt/0.41.3/mod.ts:354:17)
    at eventLoopTick (ext:core/01_core.js:175:7)
    at async file:///[...]/vento/_scripts/build_npm.ts:12:1

I tried downgrading back to Deno 1.46.3 and got the same thing so it's definitely not a Deno 2 issue. For additional context, _npm/src/deps.ts has this content:

export * as path from "./deps/jsr.io/@std/path/1.0.6/mod.js";
export * as html from "./deps/jsr.io/@std/html/1.0.3/mod.js";

export * as astring from "./deps/jsr.io/@davidbonnet/astring/1.8.6/src/astring.js";
export * as meriyah from "meriyah";
export * as walker from "estree-walker";
export type * as ESTree from "@types/estree"; // appears this is the source of the error

@oscarotero
Copy link
Collaborator

Looks like a bug in DNT package. Downgrading it to 0.41.2 works fine. But 0.41.3 fails.

@noelforte noelforte deleted the deno-2-updates branch October 23, 2024 17:25
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 this pull request may close these issues.

2 participants