Skip to content

Commit

Permalink
Merge tag '0.4.1'
Browse files Browse the repository at this point in the history
LogTape 0.4.1
  • Loading branch information
dahlia committed Jul 2, 2024
2 parents 885b7b4 + 009d3b7 commit 44fc87b
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: deno task test --coverage=.cov --junit-path=.test-report.xml
- uses: EnricoMi/publish-unit-test-result-action@v2
if: runner.os == 'Linux' && always()
Expand All @@ -43,6 +46,9 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
slug: dahlia/logtape
file: .cov.lcov
- run: deno task dnt
- run: bun run ./test_runner.js
working-directory: ${{ github.workspace }}/npm/
- run: deno task check

publish:
Expand Down
11 changes: 11 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ Version 0.5.0
To be released.


Version 0.4.1
-------------

Released on July 2, 2024.

- Fix a bug where LogTape failed to load under Node.js when incoporated
in a project from JSR. [[#3], [#4] by Kitson Kelly]


Version 0.4.0
-------------

Expand All @@ -19,6 +28,8 @@ Released on May 7, 2024.

[#1]: https://github.com/dahlia/logtape/issues/1
[#2]: https://github.com/dahlia/logtape/pull/2
[#3]: https://github.com/dahlia/logtape/issues/3
[#4]: https://github.com/dahlia/logtape/pull/4


Version 0.3.1
Expand Down
1 change: 1 addition & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"test": "deno test --allow-read --allow-write",
"coverage": "rm -rf coverage && deno task test --coverage && deno coverage --html coverage",
"dnt": "deno run -A dnt.ts",
"test-all": "deno task test && deno task dnt && cd npm/ && bun run ./test_runner.js && cd ../",
"hooks:install": "deno run --allow-read=deno.json,.git/hooks/ --allow-write=.git/hooks/ jsr:@hongminhee/deno-task-hooks",
"hooks:pre-commit": "deno task check",
"hooks:pre-push": "deno task test"
Expand Down
1 change: 1 addition & 0 deletions dnt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ await build({
entryPoints: ["./logtape/mod.ts"],
importMap: "./deno.json",
mappings: {
"./logtape/filesink.jsr.ts": "./logtape/filesink.node.ts",
"./logtape/filesink.deno.ts": "./logtape/filesink.node.ts",
},
shims: {
Expand Down
4 changes: 2 additions & 2 deletions logtape/filesink.deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export const denoDriver: RotatingFileSinkDriver<Deno.FsFile> = {
closeSync(fd) {
fd.close();
},
statSync: Deno.statSync,
renameSync: Deno.renameSync,
statSync: globalThis?.Deno.statSync,
renameSync: globalThis?.Deno.renameSync,
};

/**
Expand Down
9 changes: 9 additions & 0 deletions logtape/filesink.jsr.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const filesink: Omit<typeof import("./filesink.deno.ts"), "denoDriver"> =
await ("Deno" in globalThis
? import("./filesink.deno.ts")
: import("./filesink.node.ts"));

export const getFileSink = filesink.getFileSink;
export const getRotatingFileSink = filesink.getRotatingFileSink;

// cSpell: ignore filesink
1 change: 0 additions & 1 deletion logtape/filesink.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Deno.test("getFileSink()", () => {

Deno.test("getRotatingFileSink()", () => {
const path = Deno.makeTempFileSync();
console.debug({ path });
const sink: Sink & Disposable = getRotatingFileSink(path, {
maxSize: 150,
});
Expand Down
2 changes: 1 addition & 1 deletion logtape/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export {
type LoggerConfig,
reset,
} from "./config.ts";
export { getFileSink, getRotatingFileSink } from "./filesink.deno.ts";
export { getFileSink, getRotatingFileSink } from "./filesink.jsr.ts";
export {
type Filter,
type FilterLike,
Expand Down

0 comments on commit 44fc87b

Please sign in to comment.