Skip to content
Merged

patch #657

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "browzarr",
"version": "0.7.0",
"version": "0.7.1",
"description": "A browser-based visualization toolkit for exploring and analyzing Zarr data stores.",
"type": "module",
"keywords": [
Expand Down Expand Up @@ -46,13 +46,12 @@
"browzarr": "./cli.mjs"
},
"scripts": {
"postinstall": "node src/hooks/copy-wasm.mjs",
"prBuild": "pnpm buildRepo",
"prLint": "pnpm lint",
"dev": "next dev",
"dev": "node src/hooks/copy-wasm.mjs && next dev",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The script copy-wasm.mjs is located in src/hooks/. In React/Next.js projects, src/hooks/ is conventionally reserved for custom React hooks (e.g., useSomething). Placing a build-time Node.js script here can be confusing for maintainers. Consider moving this script to a root-level scripts/ directory (e.g., scripts/copy-wasm.mjs) to keep the project structure clean and conventional. (Note: You will also need to move the actual file to the new location).

Suggested change
"dev": "node src/hooks/copy-wasm.mjs && next dev",
"dev": "node scripts/copy-wasm.mjs && next dev",

"buildRepo": "pnpm rmBuild && pnpm build",
"rmBuild": "pnpm -r exec rm -rf out",
"build": "next build",
"build": "node src/hooks/copy-wasm.mjs && next build",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Following the suggestion to move copy-wasm.mjs out of src/hooks/ to a more conventional scripts/ directory, update the path here as well. Additionally, since .wasm files are dynamically copied to the public/ directory during the build process, please ensure that public/*.wasm is added to your .gitignore to prevent generated binary files from being committed to the repository.

Suggested change
"build": "node src/hooks/copy-wasm.mjs && next build",
"build": "node scripts/copy-wasm.mjs && next build",

"start": "next start",
"prepublishOnly": "pnpm run rmBuild && pnpm run build",
"test": "vitest",
Expand Down
Loading