Skip to content

Commit 6c5f74b

Browse files
committed
refactor: update package.json scripts for improved diagnostics and CI flow; reorganize imports in test files; remove unused index test
1 parent 5719eb6 commit 6c5f74b

File tree

6 files changed

+7
-15
lines changed

6 files changed

+7
-15
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"build": "tsup",
1010
"build:docs": "typedoc --out docs ./src/index.ts",
1111
"check-exports": "attw --pack . --ignore-rules=cjs-resolves-to-esm",
12-
"check": "biome check ./src",
12+
"check": "biome check ./src --diagnostic-level=error --fix",
1313
"check-tsc": "tsc --noEmit",
1414
"test": "vitest run",
15-
"ci": "pnpm check-exports && pnpm check && pnpm test && pnpm build"
15+
"ci": "pnpm check && pnpm test && pnpm build && pnpm check-exports"
1616
},
1717
"keywords": [
1818
"cache",

src/Cache.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { describe, it, expect, beforeEach } from "vitest";
2-
import { Cache } from "./Cache";
31
import NodeCache from "@cacheable/node-cache";
2+
import { beforeEach, describe, expect, it } from "vitest";
3+
import { Cache } from "./Cache";
44

55
describe("Cache", () => {
66
let cache: Cache;

src/helpers.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, it, expect } from "vitest";
1+
import { describe, expect, it } from "vitest";
22
import { cachedCall, withCache } from "./helpers";
33

44
// A mock function that simulates an expensive async operation

src/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { getDefaultCache } from "./defaults";
2-
import type { CacheFunctionOptions } from "./types";
31
import crypto from "node:crypto";
42
import type { Cache } from "./Cache";
3+
import { getDefaultCache } from "./defaults";
4+
import type { CacheFunctionOptions } from "./types";
55

66
function defaultKeyGenerator(fnName: string, args: any[]): string {
77
const hash = crypto

src/index.test.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export const add = (a: number, b: number) => a + b;
2-
31
export { Cache } from "./Cache";
42
export type { CacheFunctionOptions } from "./types";
53
export { configureDefaultCache, getDefaultCache } from "./defaults";

0 commit comments

Comments
 (0)