Skip to content

tsup#644

Merged
hildjj merged 3 commits intopeggyjs:mainfrom
hildjj:tsup
Jul 18, 2025
Merged

tsup#644
hildjj merged 3 commits intopeggyjs:mainfrom
hildjj:tsup

Conversation

@hildjj
Copy link
Copy Markdown
Contributor

@hildjj hildjj commented Jul 17, 2025

  • Switch to tsup for building. Fixes Switch to tsup #641.
  • Switch to files approach so I don't have to maintain .npmignore

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.48%. Comparing base (4950979) to head (e8cca25).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #644   +/-   ##
=======================================
  Coverage   99.48%   99.48%           
=======================================
  Files          34       34           
  Lines        4283     4283           
=======================================
  Hits         4261     4261           
  Misses         22       22           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor Author

@hildjj hildjj left a comment

Choose a reason for hiding this comment

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

A few changes needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This file is left over from a previous web server that we used for docs.

"reject": [
"chai", // Moved to es6
"@types/chai", // Should match chai,
"rimraf", // Requires node 20
Copy link
Copy Markdown
Contributor Author

@hildjj hildjj Jul 17, 2025

Choose a reason for hiding this comment

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

We're node 20+ now, no need to keep rimraf back at a previous version. Chai still needs to be held back until either we switch to modules or I try testing it with require(mjs), which should work in node 20.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

require(mjs) should work, except for jest. TODO: remove Jest, which is a problem for another day.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved to files: in package.json, so we can stop maintaining this brittle file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Left over from old express server. Now tested from docs with eleventy as the server.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Left over from old express server. Now tested from docs with eleventy as the server.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Needed so tsup can bundle all of the tests. Wish there was a better way.

tsup.config.js Outdated
platform: "browser",
minify: true,
outDir: "browser",
target: "es5",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is negotiable. Left in for now to generate a bunch of polyfills into the output.

tsup.config.js Outdated
entry: {
"test-bundle.min": "test/all.js",
},
format: ["umd"],
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This doesn't have to be umd. iife would work.

bundle: true,
clean: false,
splitting: false,
external: ["mocha", "chai"],
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

note: do not add peggy here. The tests use require's deep into the project structure, so the tests and all of peggy have to be bundled together.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The benchmarks serve as spot checks of the generated code now.

@hildjj hildjj merged commit ee21e45 into peggyjs:main Jul 18, 2025
10 checks passed
@hildjj hildjj deleted the tsup branch July 18, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch to tsup

2 participants