Skip to content

Conversation

kotAPI
Copy link
Collaborator

@kotAPI kotAPI commented Sep 11, 2025

Summary

  • generate full export map with CJS support
  • add module/types fields and size-limit release checks
  • initialize changesets for semantic versioning
  • validate export mapping during pre-commit to keep package.json in sync

Testing

  • npm run check:exports
  • npm test
  • npm run lint
  • npm run size (fails: size-limit: not found)

Summary by CodeRabbit

  • New Features

    • Added explicit ESM and CommonJS entry points plus bundled TypeScript types; theme CSS and a Tailwind preset exposed as public assets.
  • Documentation

    • Added documentation for the changeset/versioning workflow and a configuration for release notes.
  • Chores

    • Added export validation to pre-commit, new release and maintenance scripts, and size-budgeting tooling to the project.

Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

Walkthrough

Adds Changesets config and docs, a Husky pre-commit export check, extended package.json exports/ESM/CJS/types and size-limit tooling, and enhances scripts/generate-exports.cjs with a --check mode, root and .cjs mappings, RELEASED_COMPONENTS filtering, and safer error handling.

Changes

Cohort / File(s) Summary of changes
Changesets setup
./.changeset/README.md, ./.changeset/config.json
Adds documentation and a Changesets config specifying schema, changelog path, commit behavior (commit: false), access=public, linked=[], and baseBranch=main.
Git hooks
./.husky/pre-commit
Inserts npm run check:exports before tests and lint:staged, so pre-commit can abort early if exports are outdated.
Package metadata & workflows
./package.json
Adds main -> ./dist/index.cjs, module -> ./dist/index.js, types -> ./dist/index.d.ts, and a root export map plus asset exports; introduces check:exports, release, changeset, version-packages, size scripts, size-limit config, and devDependencies for Changesets and size-limit tooling.
Export generator
./scripts/generate-exports.cjs
Adds --check mode that validates package.json.exports against a generated exportsMap; adds root . export and .cjs require mappings for components, filters to RELEASED_COMPONENTS, handles missing dist gracefully, preserves theme exports, and refactors write/compare flow with informative messaging.

Sequence Diagram(s)

sequenceDiagram
  actor Dev as Developer
  participant Git as Git/Husky
  participant CE as check:exports
  participant GE as generate-exports.cjs
  participant PKG as package.json

  Dev->>Git: git commit
  Git->>CE: npm run check:exports
  CE->>GE: node scripts/generate-exports.cjs --check
  GE->>PKG: Read current exports
  GE->>GE: Generate exportsMap (components, themes, root, .cjs)
  GE-->>CE: returns equality result
  alt Up-to-date
    CE-->>Git: exit 0
    Git->>Git: run tests & lint:staged
    Git-->>Dev: commit completes
  else Out-of-date
    CE-->>Git: exit non-zero (message)
    Git-->>Dev: commit aborted
  end
Loading
sequenceDiagram
  actor Rel as Release Engineer
  participant NPM as npm scripts
  participant GE as generate-exports.cjs
  participant PKG as package.json
  participant CS as changesets

  Rel->>NPM: npm run release
  NPM->>GE: build:generate-exports (write)
  GE->>PKG: Update package.json.exports
  NPM->>CS: changeset publish
  CS-->>Rel: published
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

release

Poem

I hop through changes, tidy and spry,
Mapping exports under moonlit sky.
CJS and ESM side by side,
A pre-commit check keeps slips denied.
Tiny rabbit ships a cleaner tie. 🐰✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "feat: enhance release workflow" is concise and accurately reflects the primary intent of the changeset (release tooling: export map generation with CJS support, changesets, size-limit checks, and pre-commit export validation), making it clear and relevant for reviewers scanning PR history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kotapi/ensure-release-scripts-run-and-export-mappings-are-committed

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/generate-exports.cjs (1)

46-53: Make export generation deterministic and independent of dist/ for pre-commit checks.

  • Sort component names to avoid order-only diffs.
  • When dist is missing (common pre-commit), generate from RELEASED_COMPONENTS so --check doesn’t fail spuriously.
-const distPath = path.resolve(__dirname, '../dist/components');
-let files = [];
-try {
-    files = fs.readdirSync(distPath);
-} catch (error) {
-    console.warn(`Warning: ${distPath} not found. No components will be exported.`);
-    files = [];
-}
+const distPath = path.resolve(__dirname, '../dist/components');
+const hasDist = fs.existsSync(distPath);
+let componentNames = [];
+if (hasDist) {
+  componentNames = fs
+    .readdirSync(distPath)
+    .filter(f => f.endsWith('.js'))
+    .map(f => f.replace(/\.js$/, ''))
+    .sort();
+} else {
+  console.warn(`Warning: ${distPath} not found. Using RELEASED_COMPONENTS only.`);
+  componentNames = [...RELEASED_COMPONENTS].sort();
+}
@@
-// Add component exports
-files.forEach(file => {
-    const match = file.match(/^(.+)\.js$/);
-    if (match) {
-        const name = match[1];
-
-        if (!RELEASED_COMPONENTS.includes(name)) {
-            notReleasedComponents.push(name);
-            return;
-        }
-
-        exportsMap[`./${name}`] = {
-            import: `./dist/components/${name}.js`,
-            require: `./dist/components/${name}.cjs`,
-            types: `./dist/components/${name}.d.ts`
-        };
-    }
-});
+// Add component exports
+componentNames.forEach(name => {
+  // If we discovered from dist, filter by RELEASED_COMPONENTS and log omissions
+  if (hasDist && !RELEASED_COMPONENTS.includes(name)) {
+    notReleasedComponents.push(name);
+    return;
+  }
+  exportsMap[`./${name}`] = {
+    import: `./dist/components/${name}.js`,
+    require: `./dist/components/${name}.cjs`,
+    types: `./dist/components/${name}.d.ts`
+  };
+});

Also applies to: 70-87

🧹 Nitpick comments (5)
.changeset/README.md (1)

1-4: Expand README with when/what to include in a changeset and bump types.

Gives contributors clear guidance and reduces missed bumps.

 # Changesets

 This directory was generated to track release notes and versioning.
 Run `npm run changeset` to add a new changeset when you modify public APIs.
+ 
+## When to add a changeset
+- Any user-visible change: new component/prop, breaking rename/removal, behavior change, dependency version that affects consumers.
+- Internal-only refactors that don’t affect the public API can skip.
+
+## How to pick the bump
+- patch: bug fixes, typing/backfill that don’t change runtime API.
+- minor: new components/props, additive features.
+- major: breaking changes to props, names, semantics, or styling contracts.
+
+## Common flow
+1) `npm run changeset` and select bump.
+2) Commit the generated file.
+3) CI or release script will run `changeset version` and `changeset publish`.
+
+Tip: run `npm run check:exports` before committing to keep exports in sync.
scripts/generate-exports.cjs (2)

107-110: Optionally preserve non-managed custom exports (e.g., "./package.json") when writing.

Prevents accidental removal of intentional extra entries.

-        pkg.exports = exportsMap;
+        const managed = new Set(Object.keys(exportsMap));
+        const preserved = Object.fromEntries(
+          Object.entries(pkg.exports || {}).filter(([k]) => !managed.has(k))
+        );
+        pkg.exports = { ...preserved, ...exportsMap };

64-67: Consider adding a passthrough for "./package.json" export.

Commonly exposed to allow tooling to read metadata without deep imports.

 exportsMap['./themes/default.css'] = './dist/themes/default.css';
 exportsMap['./themes/tailwind-presets/default.js'] = './dist/themes/tailwind-presets/default.js';
+exportsMap['./package.json'] = './package.json';
package.json (1)

9-17: Harden exports for broader resolver support; verify subpath types/CJS.

  • Add a "default" condition on the root export for older/bundler resolvers.
  • If you intend CJS support for theme presets, expose a "require" target (only if a .cjs build exists).
  • Ensure per-subpath type resolution (generator should emit "types" for component subpaths; otherwise TS may not pick them up).

Apply:

   "exports": {
     ".": {
       "import": "./dist/index.js",
       "require": "./dist/index.cjs",
-      "types": "./dist/index.d.ts"
+      "types": "./dist/index.d.ts",
+      "default": "./dist/index.js"
     },
     "./themes/default.css": "./dist/themes/default.css",
-    "./themes/tailwind-presets/default.js": "./dist/themes/tailwind-presets/default.js"
+    "./themes/tailwind-presets/default.js": "./dist/themes/tailwind-presets/default.js"
+    // If you ship CJS for presets, prefer an object mapping:
+    // "./themes/tailwind-presets/default.js": {
+    //   "import": "./dist/themes/tailwind-presets/default.js",
+    //   "require": "./dist/themes/tailwind-presets/default.cjs"
+    // }
   },

Optionally consider exporting "./package.json" if any consumers need metadata (some tooling still reads it).

.husky/pre-commit (1)

3-6: Fail fast in the hook to avoid passing commits after earlier failures.

Either enable errexit or chain with && so later steps don’t mask failures.

Apply:

- npm run check:exports
- npm test
-
- npm run lint:staged
+ npm run check:exports && \
+ npm test && \
+ npm run lint:staged

Alternatively, add a set -e on a new line after the shebang. Also consider adding npm run check:types here if type safety is required before commit.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 07797cf and 5bbb63b.

📒 Files selected for processing (5)
  • .changeset/README.md (1 hunks)
  • .changeset/config.json (1 hunks)
  • .husky/pre-commit (1 hunks)
  • package.json (6 hunks)
  • scripts/generate-exports.cjs (4 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-14T18:13:36.606Z
Learnt from: GoldGroove06
PR: rad-ui/ui#1214
File: package.json:64-64
Timestamp: 2025-07-14T18:13:36.606Z
Learning: In npm, lifecycle scripts with `pre` and `post` prefixes automatically run before and after their corresponding main scripts. For example, a `prebuild` script will automatically run before the `build` script when executing `npm run build`, so there's no need to explicitly call `npm run prebuild` in the build script.

Applied to files:

  • package.json
🔇 Additional comments (5)
.changeset/config.json (1)

1-8: Confirm CI commits Changesets version bumps or set commit: true.

.changeset/config.json has "commit": false but package.json contains a release script that runs changeset publish and a version-packages script that runs changeset version. If you do not have a CI workflow that commits the version bump (e.g., a workflow using changesets/action or a step that runs changeset version and pushes the commit), change .changeset/config.json to "commit": true so changeset version creates the commit locally.
Locations: .changeset/config.json; package.json (release, version-packages).

.changeset/README.md (1)

1-4: size-limit already present — update config only if you want enforced thresholds

package.json already has size-limit (^11.1.2), "size" script = "size-limit", and a size-limit config [{ "path": "dist/components/*.js" }]. The original request to add size-limit is obsolete; add "@size-limit/preset-small-lib" and explicit "limit" (e.g. "10 KB") / "import" or change the path to "dist/index.js" only if you want the stricter checks.
Location: package.json

Likely an incorrect or invalid review comment.

package.json (3)

5-7: Dual ESM/CJS + types entries look good.

The main/module/types trio is consistent with the ESM package ("type": "module") and provides a CJS fallback.


35-35: Exports check script is a solid guardrail.

Nice to have this wired for CI and local validation.


102-103: Deps for changesets/size-limit added—confirm local install fixed “size-limit: not found”.

After npm i, npm run size should resolve now. If CI runs with production-only deps, ensure devDeps are installed in the job that executes size checks.

Also applies to: 129-129

Comment on lines +44 to +47
"release": "npm run build:generate-exports && changeset publish",
"changeset": "changeset",
"version-packages": "changeset version",
"size": "size-limit",
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Release flow can publish unbuilt artifacts and skip versioning/size checks.

  • changeset publish won’t build by itself; wire build+size checks via prepack.
  • Include versioning before publish, letting prepack run on npm publish automatically.

Apply:

-    "release": "npm run build:generate-exports && changeset publish",
+    "release": "npm run version-packages && changeset publish",

Add (outside this hunk):

{
  "scripts": {
    "prepack": "npm run build:rollup:process && npm run size && npm test"
  }
}

This ensures the package is built, budget-checked, and tested during publish.

🤖 Prompt for AI Agents
In package.json around lines 44 to 47, the current release flow runs changeset
publish directly which can publish unbuilt artifacts and skip versioning/size
checks; add a "prepack" script at top-level scripts that runs the build, size
check and tests (e.g. run the rollup build, npm run size, and npm test) so npm
publish will automatically build and validate, and update the release flow to
run changeset version before publish (or ensure the release script invokes the
versioning step prior to changeset publish) so packages are versioned before
publishing.

Comment on lines +54 to +58
"size-limit": [
{
"path": "dist/components/*.js"
}
],
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

size-limit config lacks required "limit" and will fail.

Add a budget; otherwise npm run size errors with a missing/invalid limit.

Apply:

   "size-limit": [
     {
-      "path": "dist/components/*.js"
+      "path": "dist/components/*.js",
+      "limit": "30 KB"
     }
   ],

If you prefer per-entry budgets, split by component or add a second entry for the root bundle (e.g., dist/index.js).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"size-limit": [
{
"path": "dist/components/*.js"
}
],
"size-limit": [
{
"path": "dist/components/*.js",
"limit": "30 KB"
}
],
🤖 Prompt for AI Agents
In package.json around lines 54 to 58, the size-limit entry for
"dist/components/*.js" is missing the required "limit" field and will cause `npm
run size` to fail; add a "limit" property (e.g., "10 KB" or an appropriate
byte/KB/MB value) to that object, or replace the single glob with multiple
entries each containing a "path" and "limit" (for per-component budgets) and/or
add an additional entry for the root bundle (e.g., "dist/index.js" with its own
"limit").

Comment on lines 42 to +43
const RELEASED_COMPONENTS = require('./RELEASED_COMPONENTS.cjs');
const isCheck = process.argv.includes('--check');
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Guard missing RELEASED_COMPONENTS to avoid hard crashes.

-const RELEASED_COMPONENTS = require('./RELEASED_COMPONENTS.cjs');
+let RELEASED_COMPONENTS = [];
+try {
+  RELEASED_COMPONENTS = require('./RELEASED_COMPONENTS.cjs');
+} catch (e) {
+  console.warn('Warning: RELEASED_COMPONENTS.cjs not found; treating all discovered components as unreleased.');
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const RELEASED_COMPONENTS = require('./RELEASED_COMPONENTS.cjs');
const isCheck = process.argv.includes('--check');
let RELEASED_COMPONENTS = [];
try {
RELEASED_COMPONENTS = require('./RELEASED_COMPONENTS.cjs');
} catch (e) {
console.warn('Warning: RELEASED_COMPONENTS.cjs not found; treating all discovered components as unreleased.');
}
const isCheck = process.argv.includes('--check');
🤖 Prompt for AI Agents
In scripts/generate-exports.cjs around lines 42-43, the direct
require('./RELEASED_COMPONENTS.cjs') can crash if the file is missing; wrap the
require in a try/catch (or check fs.existsSync first), on failure set
RELEASED_COMPONENTS to a safe default (e.g., an empty array/object as expected
by the rest of the script) and emit a clear console.warn or error message; do
not let the exception propagate and crash the process.

Comment on lines +98 to +106
if (isCheck) {
const current = JSON.stringify(pkg.exports, null, 2);
const expected = JSON.stringify(exportsMap, null, 2);
if (current !== expected) {
console.error('❌ package.json exports are out of date. Run npm run build:generate-exports to update.');
process.exit(1);
}
console.log('✅ package.json exports are up to date.');
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid brittle string-equality; compare semantically and allow extra custom exports.

Exact JSON string compare fails on key order and blocks legitimate extra entries like "./package.json".

-    if (isCheck) {
-        const current = JSON.stringify(pkg.exports, null, 2);
-        const expected = JSON.stringify(exportsMap, null, 2);
-        if (current !== expected) {
-            console.error('❌ package.json exports are out of date. Run npm run build:generate-exports to update.');
-            process.exit(1);
-        }
-        console.log('✅ package.json exports are up to date.');
-    } else {
+    if (isCheck) {
+        const deepEqual = (a, b) => {
+          if (a === b) return true;
+          if (typeof a !== typeof b) return false;
+          if (Array.isArray(a)) return a.length === b.length && a.every((v, i) => deepEqual(v, b[i]));
+          if (a && typeof a === 'object') {
+            const ak = Object.keys(a);
+            const bk = Object.keys(b);
+            if (ak.length !== bk.length) return false;
+            return ak.every(k => deepEqual(a[k], b[k]));
+          }
+          return false;
+        };
+        const current = pkg.exports || {};
+        const expected = exportsMap;
+        const mismatches = [];
+        for (const k of Object.keys(expected)) {
+          if (!deepEqual(current[k], expected[k])) mismatches.push(k);
+        }
+        if (mismatches.length) {
+          console.error(`❌ package.json exports are out of date for keys: ${mismatches.join(', ')}. Run npm run build:generate-exports to update.`);
+          process.exit(1);
+        }
+        console.log('✅ package.json exports are up to date.');
+    } else {
         pkg.exports = exportsMap;
         fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
         console.log('✅ package.json exports updated!');
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (isCheck) {
const current = JSON.stringify(pkg.exports, null, 2);
const expected = JSON.stringify(exportsMap, null, 2);
if (current !== expected) {
console.error('❌ package.json exports are out of date. Run npm run build:generate-exports to update.');
process.exit(1);
}
console.log('✅ package.json exports are up to date.');
} else {
if (isCheck) {
const deepEqual = (a, b) => {
if (a === b) return true;
if (typeof a !== typeof b) return false;
if (Array.isArray(a)) return a.length === b.length && a.every((v, i) => deepEqual(v, b[i]));
if (a && typeof a === 'object') {
const ak = Object.keys(a);
const bk = Object.keys(b);
if (ak.length !== bk.length) return false;
return ak.every(k => deepEqual(a[k], b[k]));
}
return false;
};
const current = pkg.exports || {};
const expected = exportsMap;
const mismatches = [];
for (const k of Object.keys(expected)) {
if (!deepEqual(current[k], expected[k])) mismatches.push(k);
}
if (mismatches.length) {
console.error(`❌ package.json exports are out of date for keys: ${mismatches.join(', ')}. Run npm run build:generate-exports to update.`);
process.exit(1);
}
console.log('✅ package.json exports are up to date.');
} else {
🤖 Prompt for AI Agents
scripts/generate-exports.cjs around lines 98 to 106: the current check uses
JSON.stringify equality which is brittle (key order) and rejects valid extra
exports; replace the string-equality with a semantic comparison that ensures
every key in exportsMap exists in package.json exports and that their values
deeply equal, while allowing additional keys (e.g., "./package.json") in
pkg.exports; on mismatch, print a clear message listing missing/mismatched keys
and exit non-zero, otherwise report up-to-date.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
package.json (2)

55-59: Add required size-limit budgets to avoid runtime failure.

Each entry needs a "limit"; without it, npm run size errors.

   "size-limit": [
     {
-      "path": "dist/components/*.js"
+      "path": "dist/components/*.js",
+      "limit": "30 KB"
+    },
+    {
+      "path": "dist/index.js",
+      "limit": "20 KB"
     }
   ],

Validate budgets exist:

#!/bin/bash
python - <<'PY'
import json,sys
cfg=json.load(open("package.json"))
ok=all('limit' in e for e in cfg.get('size-limit',[]) if isinstance(e,dict))
print("limits present:", ok)
sys.exit(0 if ok else 1)
PY

45-49: Harden release flow: build/test/size on publish; version before publish.

Wire prepack and run versioning before changeset publish to avoid publishing unbuilt artifacts and to enforce budgets/tests automatically.

-    "release": "npm run build:generate-exports && changeset publish",
+    "release": "npm run version-packages && changeset publish",
+    "prepack": "npm run build:rollup:process && npm run size && npm test",
+    "prepublishOnly": "npm run version-packages",
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5bbb63b and b914c61.

📒 Files selected for processing (1)
  • package.json (5 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-14T18:13:36.606Z
Learnt from: GoldGroove06
PR: rad-ui/ui#1214
File: package.json:64-64
Timestamp: 2025-07-14T18:13:36.606Z
Learning: In npm, lifecycle scripts with `pre` and `post` prefixes automatically run before and after their corresponding main scripts. For example, a `prebuild` script will automatically run before the `build` script when executing `npm run build`, so there's no need to explicitly call `npm run prebuild` in the build script.

Applied to files:

  • package.json
🪛 GitHub Actions: Tests
package.json

[error] 1-1: Command 'npm ci' failed due to JSON.parse error in package.json: Expected ',' or '}' after property value at position 319.

🪛 GitHub Actions: Lint
package.json

[error] 1-1: Step 'npm ci' failed: JSON.parse error in package.json (Unexpected string at position 319).

🪛 GitHub Actions: Coverage
package.json

[error] 1-1: npm ci failed: JSON.parse error in package.json (EJSONPARSE). Unexpected string in JSON at position 319 while parsing near "...ist/index.d.ts"\n "./themes/default.cs...". Note: package.json must be valid JSON.

🔇 Additional comments (4)
package.json (4)

36-36: check:exports script LGTM.

Good to gate via Husky; ensures package.json stays in sync.

Confirm .husky/pre-commit runs npm run check:exports.


5-7: ESM/CJS/types entry points look good.

main (CJS), module (ESM), and types align with the new export map.

Ensure the build emits: dist/index.cjs, dist/index.js, and dist/index.d.ts.


105-107: Dev tooling additions appropriate.

Adding @changesets/cli and @size-limit/preset-small-lib matches the new workflow.


132-132: size-limit CLI dependency present.

This unblocks npm run size once budgets are configured.

Comment on lines +10 to 16
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
"./themes/default.css": "./dist/themes/default.css",
"./themes/tailwind-presets/default.js": "./dist/themes/tailwind-presets/default.js"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

❓ Verification inconclusive

Fix broken exports JSON (missing brace/comma) — causes npm ci parse error.

The "." export object isn’t closed before the next keys, breaking JSON (see pipeline errors). Close the object and add a comma.

   "exports": {
-    ".": {
-      "import": "./dist/index.js",
-      "require": "./dist/index.cjs",
-      "types": "./dist/index.d.ts"
-    "./themes/default.css": "./dist/themes/default.css",
-    "./themes/tailwind-presets/default.js": "./dist/themes/tailwind-presets/default.js"
-  },
+    ".": {
+      "import": "./dist/index.js",
+      "require": "./dist/index.cjs",
+      "types": "./dist/index.d.ts"
+    },
+    "./themes/default.css": "./dist/themes/default.css",
+    "./themes/tailwind-presets/default.js": "./dist/themes/tailwind-presets/default.js"
+  },

Quick check script:


🏁 Script executed:

#!/bin/bash
python - <<'PY'
import json,sys
json.load(open("package.json"))
print("package.json parses OK")
PY

Length of output: 738


Fix broken exports JSON in package.json (missing brace/comma)

Close the "." export object and add a comma before the following export entries — package.json fails to parse (json.decoder.JSONDecodeError at line 14 column 5).

   "exports": {
-    ".": {
-      "import": "./dist/index.js",
-      "require": "./dist/index.cjs",
-      "types": "./dist/index.d.ts"
-    "./themes/default.css": "./dist/themes/default.css",
-    "./themes/tailwind-presets/default.js": "./dist/themes/tailwind-presets/default.js"
-  },
+    ".": {
+      "import": "./dist/index.js",
+      "require": "./dist/index.cjs",
+      "types": "./dist/index.d.ts"
+    },
+    "./themes/default.css": "./dist/themes/default.css",
+    "./themes/tailwind-presets/default.js": "./dist/themes/tailwind-presets/default.js"
+  },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
"./themes/default.css": "./dist/themes/default.css",
"./themes/tailwind-presets/default.js": "./dist/themes/tailwind-presets/default.js"
},
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
},
"./themes/default.css": "./dist/themes/default.css",
"./themes/tailwind-presets/default.js": "./dist/themes/tailwind-presets/default.js"
},
🧰 Tools
🪛 Biome (2.1.2)

[error] 14-14: expected , but instead found "./themes/default.css"

Remove "./themes/default.css"

(parse)

🤖 Prompt for AI Agents
In package.json around lines 10 to 16, the exports map for "." is missing a
closing brace and a separating comma which breaks JSON parsing; close the "."
object's block with a }, then add a comma after that closing brace before the
next export entries (./themes/default.css and
./themes/tailwind-presets/default.js) so the exports object is properly
separated and the JSON is valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant