next-cache-toolbar 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -5,7 +5,6 @@ var jsxRuntime = require('react/jsx-runtime');
5
5
  var cacheEntryClient = require('./cache-entry-client-Cg2-NRrZ.js');
6
6
  var lucideReact = require('lucide-react');
7
7
  var fs = require('fs');
8
- var promises = require('node:fs/promises');
9
8
  var zod = require('zod');
10
9
  var cachePanelContextClient = require('./cache-panel-context-client-B1EgwMzI.js');
11
10
  var cachePanelHeadClient = require('./cache-panel-head-client-CbhKAPhZ.js');
@@ -58,7 +57,7 @@ const getCacheFiles = async ()=>{
58
57
  if (!fs.existsSync(cachePath)) {
59
58
  return;
60
59
  }
61
- const files = await promises.readdir(cachePath);
60
+ const files = await fs.promises.readdir(cachePath);
62
61
  const cacheFiles = new Map();
63
62
  for (const file of files){
64
63
  // ignore tags-manifest file
@@ -66,7 +65,7 @@ const getCacheFiles = async ()=>{
66
65
  continue;
67
66
  }
68
67
  try {
69
- const fileContent = await promises.readFile(`${cachePath}/${file}`);
68
+ const fileContent = await fs.promises.readFile(`${cachePath}/${file}`);
70
69
  const cacheEntry = nextCacheFileSchema.parse(JSON.parse(fileContent.toString()));
71
70
  cacheFiles.set(file, cacheEntry);
72
71
  } catch (error) {
package/dist/es/index.mjs CHANGED
@@ -2,8 +2,7 @@
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { d as TableHeader, e as TableRow, T as TableHead } from './cache-entry-client-CtWrVYTN.js';
4
4
  import { Braces, PanelBottomCloseIcon } from 'lucide-react';
5
- import { existsSync } from 'fs';
6
- import { readdir, readFile } from 'node:fs/promises';
5
+ import { existsSync, promises } from 'fs';
7
6
  import { z, ZodError } from 'zod';
8
7
  import { C as CachePanelContextProvider } from './cache-panel-context-client-D5NKXXpF.js';
9
8
  import { C as CachePanelHead } from './cache-panel-head-client-CZC6pddt.js';
@@ -56,7 +55,7 @@ const getCacheFiles = async ()=>{
56
55
  if (!existsSync(cachePath)) {
57
56
  return;
58
57
  }
59
- const files = await readdir(cachePath);
58
+ const files = await promises.readdir(cachePath);
60
59
  const cacheFiles = new Map();
61
60
  for (const file of files){
62
61
  // ignore tags-manifest file
@@ -64,7 +63,7 @@ const getCacheFiles = async ()=>{
64
63
  continue;
65
64
  }
66
65
  try {
67
- const fileContent = await readFile(`${cachePath}/${file}`);
66
+ const fileContent = await promises.readFile(`${cachePath}/${file}`);
68
67
  const cacheEntry = nextCacheFileSchema.parse(JSON.parse(fileContent.toString()));
69
68
  cacheFiles.set(file, cacheEntry);
70
69
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-cache-toolbar",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Toolbar with all cached data in Next.js app router",
5
5
  "scripts": {
6
6
  "prepublish": "npm run build",
@@ -10,7 +10,13 @@
10
10
  "dev:compile": "bunchee --watch",
11
11
  "dev:tailwind": "tailwindcss -i src/style.css -o dist/style.css --watch"
12
12
  },
13
- "author": "Kajetan Szymczak <kajtszymczak@gmail.com>",
13
+ "author": {
14
+ "name": "Kajetan Szymczak"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/KajSzy/next-cache-toolbar"
19
+ },
14
20
  "engines": {
15
21
  "node": ">=18",
16
22
  "pnpm": ">=8"
@@ -33,9 +39,9 @@
33
39
  },
34
40
  "devDependencies": {
35
41
  "@biomejs/biome": "^1.5.3",
36
- "@types/node": "^18.19.21",
37
- "@types/react": "^18",
38
- "@types/react-dom": "^18",
42
+ "@types/node": "^20.11.25",
43
+ "@types/react": "^18.2.61",
44
+ "@types/react-dom": "^18.2.19",
39
45
  "autoprefixer": "^10.4.18",
40
46
  "bunchee": "^4.4.8",
41
47
  "concurrently": "^8.2.2",
@@ -43,8 +49,8 @@
43
49
  "postcss": "^8.4.35",
44
50
  "rimraf": "^5.0.5",
45
51
  "tailwindcss": "^3.4.1",
46
- "turbo": "^1.12.4",
47
- "typescript": "^5"
52
+ "turbo": "^1.12.5",
53
+ "typescript": "^5.4.2"
48
54
  },
49
55
  "peerDependencies": {
50
56
  "next": "^14",
package/readme.md CHANGED
@@ -4,6 +4,10 @@ A toolbar that helps to identify [data cache](https://nextjs.org/docs/app/buildi
4
4
 
5
5
  ![Example](./assets/example_image.png)
6
6
 
7
+ ## Preview cached body
8
+
9
+ ![Example](./assets/body_preview.png)
10
+
7
11
  ## Use
8
12
 
9
13
  `next-cache-toolbar` requires to use [app router](https://nextjs.org/docs/app/building-your-application/caching#data-cache)