Conversation
WalkthroughRelease metadata and presentation updated from beta to rc. CHANGELOG documents ESM build support. package.json version bumped. Rollup config adds two ES module outputs (regular and minified) alongside existing UMD builds. Demo HTML and README badges updated to reflect v0.2.0-rc. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant R as Rollup
participant T as terser()
participant U1 as dist/allonsh.js (UMD)
participant U2 as dist/allonsh.min.js (UMD)
participant E1 as dist/allonsh.esm.js (ESM) %% New
participant E2 as dist/allonsh.esm.min.js (ESM) %% New
Dev->>R: run build
R->>U1: emit UMD (sourcemap: existing)
R->>T: minify UMD
T-->>U2: emit UMD min
R->>E1: emit ESM (sourcemap: false)
R->>T: minify ESM
T-->>E2: emit ESM min
note over E1,E2: New ES module outputs added in 0.2.0-rc
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (5)
README.md (1)
19-19: Badge text OK; consider switching to a dynamic version badge.Shields double-hyphen escape correctly renders “v0.2.0-rc”. Optional: use an npm or GitHub tag version badge to avoid manual edits each release.
demo/index.html (1)
50-50: Avoid hard-coding the displayed version.Derive this value from package.json at build time (e.g., Rollup replace or importing package.json) to prevent drift.
CHANGELOG.md (1)
5-10: Changelog entry reads well; add compare link for consistency.Previous releases include a “Full Changelog” link—consider adding one for 0.2.0-rc too.
rollup.config.js (2)
22-32: ESM outputs look good; enable sourcemaps for non-minified builds.Helps debugging and keeps artifacts small only where needed.
{ file: 'dist/allonsh.js', format: 'umd', name: 'Allonsh', - sourcemap: false, + sourcemap: true, }, @@ { file: 'dist/allonsh.esm.js', format: 'es', - sourcemap: false, + sourcemap: true, },
34-35: Tiny improvement: prefer browser resolution explicitly.Not required here, but adding browser resolution guards against accidental Node-targeted sub-deps in the future.
- plugins: [resolve(), commonjs()], + plugins: [resolve({ browser: true }), commonjs()],
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (5)
CHANGELOG.md(1 hunks)README.md(1 hunks)demo/index.html(1 hunks)package.json(1 hunks)rollup.config.js(1 hunks)
| { | ||
| "name": "allonsh", | ||
| "version": "0.2.0-beta", | ||
| "version": "0.2.0-rc", |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
ESM build won’t be discoverable without entry fields; dist also isn’t published.
Currently “main” points to src and there’s no “module”/“exports”, and “dist” isn’t in “files”. Consumers may import raw source and miss your new ESM build.
Apply the following updates:
@@
- "main": "src/Allonsh.js",
+ "main": "dist/allonsh.js",
+ "module": "dist/allonsh.esm.js",
+ "browser": "dist/allonsh.js",
+ "unpkg": "dist/allonsh.min.js",
+ "jsdelivr": "dist/allonsh.min.js",
+ "exports": {
+ ".": {
+ "import": "./dist/allonsh.esm.js",
+ "require": "./dist/allonsh.js",
+ "default": "./dist/allonsh.js"
+ }
+ },
@@
"scripts": {
"test": "vitest",
"format": "prettier --write .",
"format:check": "prettier --check .",
"build": "rollup -c",
+ "prepublishOnly": "npm run build",
"lint": "eslint src/",
@@
"files": [
- "src",
+ "dist",
+ "src",
"README.md",
"LICENSE",
"docs"
],Run to verify packaging entries and whitelist:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "main:" && jq -r '.main' package.json
echo "module:" && jq -r '.module' package.json
echo "exports:" && jq '.exports' package.json
echo "files:" && jq -r '.files[]' package.json
jq -r '.files[]' package.json | grep -q '^dist$' || { echo "dist missing from files"; exit 1; }
echo "If already built, confirm outputs exist:"
[ -d dist ] && ls -l dist/allonsh.js dist/allonsh.min.js dist/allonsh.esm.js dist/allonsh.esm.min.js || echo "dist not built yet; run: npm run build"Length of output: 105
Add ESM entry points and include dist in package files
• Update package.json so “main” points to your built CJS bundle and add “module”, “browser”, “unpkg”/“jsdelivr” fields
• Add an “exports” map for import/require resolution
• Include “dist” in the “files” array and run build before publishing
--- package.json
@@
- "main": "src/Allonsh.js",
+ "main": "dist/allonsh.js",
+ "module": "dist/allonsh.esm.js",
+ "browser": "dist/allonsh.js",
+ "unpkg": "dist/allonsh.min.js",
+ "jsdelivr": "dist/allonsh.min.js",
+ "exports": {
+ ".": {
+ "import": "./dist/allonsh.esm.js",
+ "require": "./dist/allonsh.js",
+ "default": "./dist/allonsh.js"
+ }
+ },
@@
"scripts": {
"test": "vitest",
"build": "rollup -c",
+ "prepublishOnly": "npm run build",
...
@@
"files": [
- "src",
+ "dist",
+ "src",
"README.md",
"LICENSE",
"docs"
],Committable suggestion skipped: line range outside the PR's diff.
Description
Related Issue
Type of Change
How Has This Been Tested?
Using
npm run buildChecklist
Additional Notes
N/A.
Summary by CodeRabbit