diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1e29221..896039f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v4 - uses: denoland/setup-deno@v1 with: - deno-version: v1.x + deno-version: v2.x - uses: oven-sh/setup-bun@v2 with: bun-version: latest @@ -61,7 +61,7 @@ jobs: - uses: actions/checkout@v4 - uses: denoland/setup-deno@v1 with: - deno-version: v1.x + deno-version: v2.x - if: github.ref_type == 'branch' run: | jq \ diff --git a/CHANGES.md b/CHANGES.md index 727464c..1a99885 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,18 @@ Version 0.7.0 To be released. +Version 0.6.4 +------------- + +Released on October 28, 2024. + + - Fixed a build warning due to importing `node:fs` and `node:util` modules on + Next.js' client rendering. [[#19]] + - Made it to work on Deno 2.0.0 or higher. + +[#19]: https://github.com/dahlia/logtape/issues/19 + + Version 0.6.3 ------------- diff --git a/deno.json b/deno.json index 81d4748..7292df1 100644 --- a/deno.json +++ b/deno.json @@ -15,6 +15,7 @@ }, "exclude": [ "*-venv/", + ".github/", "coverage/", "docs/", "npm/" diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 34ac59b..5bdb201 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -1,11 +1,7 @@ -import { Presets, SingleBar } from "cli-progress"; import { jsrRef } from "markdown-it-jsr-ref"; import { defineConfig } from "vitepress"; import { transformerTwoslash } from "@shikijs/vitepress-twoslash"; -const progress = new SingleBar({}, Presets.shades_classic); -let started = false; - const jsrRefVersion = process.env.CI === "true" && process.env.GITHUB_REF_TYPE === "tag" ? "stable" @@ -15,13 +11,6 @@ const jsrRefPlugin = await jsrRef({ package: "@logtape/logtape", version: jsrRefVersion, cachePath: ".jsr-cache.json", - progress: (complete: number, total: number) => { - if (started) progress.update(complete); - else { - started = true; - progress.start(total, complete); - } - }, }); let extraNav: { text: string; link: string }[] = []; diff --git a/docs/bun.lockb b/docs/bun.lockb index 3a96dd5..343c5d7 100755 Binary files a/docs/bun.lockb and b/docs/bun.lockb differ diff --git a/docs/package.json b/docs/package.json index dbe9f6d..6a83bac 100644 --- a/docs/package.json +++ b/docs/package.json @@ -3,14 +3,13 @@ "devDependencies": { "@biomejs/biome": "^1.8.3", "@cloudflare/workers-types": "^4.20240909.0", - "@logtape/logtape": "^0.6.0-dev.82", + "@logtape/logtape": "^0.6.3", "@logtape/otel": "^0.2.0", "@shikijs/vitepress-twoslash": "^1.17.6", "@teidesu/deno-types": "^1.46.3", "@types/bun": "^1.1.9", "@types/node": "^22.5.5", - "cli-progress": "^3.12.0", - "markdown-it-jsr-ref": "^0.3.2", + "markdown-it-jsr-ref": "^0.4.0", "vitepress": "^1.3.4" }, "scripts": { diff --git a/logtape/config.ts b/logtape/config.ts index af2e44d..1395565 100644 --- a/logtape/config.ts +++ b/logtape/config.ts @@ -192,8 +192,8 @@ export async function configure< if (Symbol.dispose in filter) disposables.add(filter as Disposable); } - if ("process" in globalThis) { // @ts-ignore: It's fine to use process in Node - // deno-lint-ignore no-node-globals + if ("process" in globalThis && !("Deno" in globalThis)) { // @ts-ignore: It's fine to use process in Node + // deno-lint-ignore no-process-globals process.on("exit", dispose); } else { // @ts-ignore: It's fine to addEventListener() on the browser/Deno addEventListener("unload", dispose); diff --git a/logtape/fs.cjs b/logtape/fs.cjs index 40171ff..fe20ac6 100644 --- a/logtape/fs.cjs +++ b/logtape/fs.cjs @@ -1,10 +1,12 @@ let fs = null; if ( - "process" in globalThis && "versions" in globalThis.process && - "node" in globalThis.process.versions && - typeof globalThis.caches === "undefined" && - typeof globalThis.addEventListener !== "function" || - "Bun" in globalThis + typeof window === "undefined" && ( + "process" in globalThis && "versions" in globalThis.process && + "node" in globalThis.process.versions && + typeof globalThis.caches === "undefined" && + typeof globalThis.addEventListener !== "function" || + "Bun" in globalThis + ) ) { try { // Intentionally confuse static analysis of bundlers: diff --git a/logtape/nodeUtil.cjs b/logtape/nodeUtil.cjs index dc5c169..0984aff 100644 --- a/logtape/nodeUtil.cjs +++ b/logtape/nodeUtil.cjs @@ -1,10 +1,12 @@ let util = null; if ( - "process" in globalThis && "versions" in globalThis.process && - "node" in globalThis.process.versions && - typeof globalThis.caches === "undefined" && - typeof globalThis.addEventListener !== "function" || - "Bun" in globalThis + typeof window === "undefined" && ( + "process" in globalThis && "versions" in globalThis.process && + "node" in globalThis.process.versions && + typeof globalThis.caches === "undefined" && + typeof globalThis.addEventListener !== "function" || + "Bun" in globalThis + ) ) { try { // Intentionally confuse static analysis of bundlers: