Skip to content

Commit

Permalink
update to Deno 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hansSchall committed Oct 13, 2024
1 parent cd6f6a4 commit 6714e60
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 23 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/jsr.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: JSR Publish
on:
push:
branches: main
push:
branches: main

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
publish:
name: Publish
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write
permissions:
contents: read
id-token: write

steps:
- name: Clone repository
uses: actions/checkout@v3
steps:
- name: Clone repository
uses: actions/checkout@v3

- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: v2.x

- name: Test
run: deno task check-ci
- name: Test
run: deno task check-ci

- name: Publish package to JSR
run: deno publish
- name: Publish package to JSR
run: deno publish
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Native Vite support for Deno imports (jsr:, npm:, https://).

Use Deno for the frontend and enjoy development without the hassle of `node_modules` and package managers!

Note: Versions older than 2.1.7 do not support Deno 2.0. Please update to ^2.1.7!

## Overview

1. Enable Deno for the whole workspace
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deno-plc/vite-plugin-deno",
"version": "2.1.6",
"version": "2.1.7",
"exports": "./mod.ts",
"compilerOptions": {
"lib": [
Expand Down
6 changes: 5 additions & 1 deletion src/ast-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ function run_task(task: AstTask): Omit<AstResult, "task_id"> {
};
}
} catch (err) {
throw new Error(`Failed to run task ${task.id}: ${err.message}`);
if (err instanceof Error) {
throw new Error(`Failed to run task ${task.id}: ${err.message}`);
} else {
throw new Error(`Failed to run task ${task.id}: ${err}`);
}
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,10 @@ export class ModuleGraph {
if (this.#npm_extended_id.has(npm_name)) {
if (this.#npm_extended_id.get(npm_name) !== extended_id) {
throw new Error(
`Expectation failed: underscore version extension differs while processing package '${name}'@'${format(version)
}' processing '${extended_id}' hit '${this.#npm_extended_id.get(npm_name)
`Expectation failed: underscore version extension differs while processing package '${name}'@'${
format(version)
}' processing '${extended_id}' hit '${
this.#npm_extended_id.get(npm_name)
}'. Please file an issue: https://github.com/deno-plc/vite-plugin-deno/issues/new`,
);
}
Expand Down

0 comments on commit 6714e60

Please sign in to comment.