Skip to content
Closed
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
},
"homepage": "https://github.com/harperfast",
"scripts": {
"dev": "tsup index.ts cli.ts --format esm --clean --dts --watch --external puppeteer",
"dev": "tsup index.ts cli.ts --format esm --clean --watch --external puppeteer",

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

In sync with the build script changes, consider removing index.ts from the dev script entry points to avoid compiling the unused library entry point.

Suggested change
"dev": "tsup index.ts cli.ts --format esm --clean --watch --external puppeteer",
"dev": "tsup cli.ts --format esm --clean --watch --external puppeteer",

"link": "npm run build && npm link",
"build": "tsup index.ts cli.ts --format esm --clean --dts --external puppeteer && cp node_modules/harper/schema.graphql dist/",
"build": "tsup index.ts cli.ts --format esm --clean --external puppeteer && cp node_modules/harper/schema.graphql dist/",

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

Since --dts is being dropped because this package is only consumed as a CLI and not as a library, index.ts and its compiled output dist/index.js are now dead code.

To clean this up and avoid exposing an untyped entry point, consider removing index.ts from the tsup entry points.

Note: If you apply this suggestion, please also remember to:

  1. Remove the . export from the exports field in package.json (lines 33-35).
  2. Delete the unused index.ts file.
Suggested change
"build": "tsup index.ts cli.ts --format esm --clean --external puppeteer && cp node_modules/harper/schema.graphql dist/",
"build": "tsup cli.ts --format esm --clean --external puppeteer && cp node_modules/harper/schema.graphql dist/",

"commitlint": "commitlint --edit",
"start": "node ./dist/cli.js",
"lint": "oxlint --format stylish .",
Expand Down