Skip to content

Conversation

@vio
Copy link
Member

@vio vio commented Apr 23, 2025

Summary by CodeRabbit

  • Chores
    • Added a new development dependency for bundling.
  • New Features
    • Introduced multiple configuration options for the bundler, allowing flexible output of stats files in different formats and locations.
  • Tests
    • Added a new test suite to verify stats file generation with various bundler configurations.
    • Updated a test suite description for improved clarity.
  • Chores
    • Enhanced CI workflow with separate jobs for different bundler tests and updated job dependencies.

@coderabbitai
Copy link

coderabbitai bot commented Apr 23, 2025

Warning

Rate limit exceeded

@vio has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 59 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between c421297 and c67024a.

⛔ Files ignored due to path filters (1)
  • test/package/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • .github/workflows/ci.yml (2 hunks)
  • test/package/package.json (1 hunks)
  • test/package/rolldown-package.test.js (1 hunks)
  • test/package/rolldown.config.js (1 hunks)
  • test/package/rollup-package.test.js (2 hunks)

Walkthrough

The changes introduce support for the rolldown JavaScript bundler in the test package. A new development dependency on rolldown is added to the package configuration. A dedicated rolldown.config.js file is created, exporting multiple build configurations that vary in output format and stats file location. Corresponding tests are implemented in a new test suite to verify the correct generation of stats files under different configurations. Additionally, a minor update is made to an existing test suite's description for clarity. The CI workflow is updated to run separate jobs for testing both rollup and rolldown packages.

Changes

File(s) Change Summary
test/package/package.json Added rolldown as a devDependency.
test/package/rolldown.config.js New configuration file for rolldown with multiple exported build configs, each customizing output format and stats file.
test/package/rolldown-package.test.js New test suite verifying stats file generation by rolldown under various configurations.
test/package/rollup-package.test.js Updated test suite description from "package test" to "rollup package test" and aligned output config usage to dynamicOptions.
.github/workflows/ci.yml Renamed existing test-package job to test-package-rollup; added new test-package-rolldown job; updated job dependencies.

Sequence Diagram(s)

sequenceDiagram
    participant TestSuite as rolldown-package.test.js
    participant Bundler as rolldown
    participant FS as Filesystem

    TestSuite->>Bundler: Run bundler with config (default/dynamic/relative/absolute)
    Bundler->>FS: Write stats JSON file (location depends on config)
    TestSuite->>FS: Read stats JSON file
    TestSuite->>TestSuite: Parse and assert contents
Loading

Poem

In the warren of code, new configs abound,
Rolldown hops in, with stats to be found.
From default to custom, the tests check each case,
JSON files written, all falling in place.
With every new path, the rabbits delight—
Bundling and testing, from morning to night!
🐇✨


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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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

🧹 Nitpick comments (1)
test/package/rolldown-packge.test.js (1)

1-59: Filename has a typo

The filename "rolldown-packge.test.js" contains a typo (missing "a" in "package"). This should be corrected for consistency.

Rename the file from:

rolldown-packge.test.js

To:

rolldown-package.test.js
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd85402 and e81df11.

⛔ Files ignored due to path filters (1)
  • test/package/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • test/package/package.json (1 hunks)
  • test/package/rolldown-packge.test.js (1 hunks)
  • test/package/rolldown.config.js (1 hunks)
  • test/package/rollup-package.test.js (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
test/package/rolldown.config.js (1)
test/unit/fixtures/rollup-stats.ts (1)
  • stats (1-33)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Socket Security: Pull Request Alerts
🔇 Additional comments (11)
test/package/rollup-package.test.js (1)

9-9: Clear test suite description update

The description has been updated from "package test" to "rollup package test", which is more specific and better reflects the test suite's purpose, especially now that there are tests for both rollup and rolldown bundlers.

test/package/rolldown-packge.test.js (6)

1-8: Well-structured imports

The imports are properly organized and include all necessary dependencies for the test suite. The code reuses the same config imports from the rollup configuration file, which is a good approach for consistency.


9-13: Well-organized test structure

The test suite is properly organized with a clear description and appropriate setup. Using beforeEach to reset the virtual file system is a good practice for test isolation.


14-23: Correct implementation of basic test case

This test correctly verifies that rolldown outputs a stats JSON file and that the file contains the expected structure. The approach is consistent with the equivalent rollup test.


25-34: Typo in test case

There appears to be a potential issue in this test. You're using dynamicOptions for the rolldown call but then using config.output for the generate call, which might not be correct if the outputs differ between the two configurations.

You should verify this is intentional or update it to:

- await bundle.generate(config.output);
+ await bundle.generate(dynamicOptions.output);

36-46: Consistent testing of relative path output

Test verifies the stats file generation with a relative path filename, which is important for ensuring the plugin properly handles various path configurations.


48-59: Comprehensive testing of absolute path output

This test correctly verifies absolute path handling, which completes the coverage of different path configurations. Good attention to detail in testing both relative and absolute paths.

test/package/rolldown.config.js (4)

1-11: Well-structured default configuration

The default configuration is properly structured using defineConfig from rolldown, with appropriate input/output paths and the stats plugin with default options.


13-22: Dynamic configuration with format-based filename

This configuration showcases how to dynamically generate the stats filename based on the output format, which is a useful pattern for testing. The callback approach to the stats plugin is implemented correctly.


24-34: Configuration with relative path for stats output

The configuration properly demonstrates using a relative path for the stats output file, which is important for testing path handling in the plugin.


36-46: Configuration with absolute path for stats output

The absolute path configuration is properly implemented, completing the test coverage for different path types. Writing to '/tmp' is a standard approach for test files.

"keywords": [],
"license": "ISC",
"devDependencies": {
"rolldown": "^1.0.0-beta.8",
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Added rolldown dependency correctly

Added rolldown v1.0.0-beta.8 as a development dependency, which is required for the new rolldown tests. This is an appropriate addition to support the new test files.

The beta version is acceptable for testing purposes, but you might want to verify this is the most current beta version available.


🌐 Web query:

What is the latest version of rolldown bundler?

💡 Result:

The latest stable version of Rolldown is 1.0.0-beta.7, which was published about a month ago according to the NPM registry[4][7]. Rolldown is currently in beta status, which means that while it can handle most production use cases, there might still be bugs and rough edges[8].

Rolldown follows a release channel system with two main options:

  • Latest: Currently at version 1.0.0-beta.*
  • Nightly releases: Published nightly from the main branch under the "nightly" npm dist tag, which can be installed using npm i rolldown@nightly[8]

The most recent significant release was version 0.15.0, which was published on March 17, 2025. This version includes full test suite support on Node.js versions 18, 20, and 22, along with self-bootstrapping for every commit to ensure correctness[3].

Prior to that, version 0.14.0 added important features such as native watch() support, asset module type support, and umd format support[3].

It's worth noting that Rolldown is still in active development, as it's described as "currently in beta status" with some features like the built-in minification still considered work-in-progress[8].

Citations:


Verify the released Rolldown version

It looks like you’ve added "rolldown": "^1.0.0-beta.8" to test/package/package.json, but according to the npm registry the latest published beta is 1.0.0-beta.7. Please confirm whether v1.0.0-beta.8 has been released:

• If v1.0.0-beta.8 isn’t available yet, change the dependency to ^1.0.0-beta.7.
• If you need the absolute cutting-edge build, consider using the nightly tag (rolldown@nightly).

[test/package/package.json:13]

@vio vio force-pushed the rolldown-tests branch from e81df11 to 0a1a615 Compare April 23, 2025 22:01
@socket-security
Copy link

socket-security bot commented Apr 23, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedrolldown@​1.0.0-beta.8861007298100
Updated..%2F..@​1.2.2 ⏵ 1.3.6100100100100100

View full report

Copy link

@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: 2

🧹 Nitpick comments (2)
test/package/rolldown-package.test.js (2)

14-23: Enhance test assertions for more comprehensive verification.

The test only verifies that the fileName property exists in the stats output. Consider adding more comprehensive assertions to validate other important properties of the stats object.

  expect(stats['index.js']).toMatchObject({
    fileName: 'index.js',
+   type: 'chunk',
+   // Verify other expected properties based on your implementation
  });

5-5: Consider adding a test helper for common operations.

All tests share similar patterns of bundling, generating and reading stats files. Consider creating a helper function to reduce duplication.

async function bundleAndGetStats(config, statsPath) {
  const bundle = await rolldown(config);
  await bundle.generate(config.output);
  
  const actual = await fs.readFile(statsPath, 'utf8');
  return JSON.parse(actual);
}

Then use it in your tests:

test('should output stats JSON file', async () => {
  const statsPath = path.join(config.output.dir, 'stats.json');
  const stats = await bundleAndGetStats(config, statsPath);
  
  expect(stats['index.js']).toMatchObject({
    fileName: 'index.js',
  });
});
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e81df11 and 0a1a615.

⛔ Files ignored due to path filters (1)
  • test/package/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • test/package/package.json (1 hunks)
  • test/package/rolldown-package.test.js (1 hunks)
  • test/package/rolldown.config.js (1 hunks)
  • test/package/rollup-package.test.js (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • test/package/package.json
  • test/package/rolldown.config.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/package/rollup-package.test.js
🧰 Additional context used
🧬 Code Graph Analysis (1)
test/package/rolldown-package.test.js (2)
test/unit/fixtures/rollup-stats.ts (1)
  • stats (1-33)
test/package/rolldown.config.js (6)
  • dynamicOptions (13-22)
  • dynamicOptions (13-22)
  • relativeFileNameConfig (24-34)
  • relativeFileNameConfig (24-34)
  • absoluteFileNameConfig (36-46)
  • absoluteFileNameConfig (36-46)
🔇 Additional comments (1)
test/package/rolldown-package.test.js (1)

9-59: LGTM - Well-structured test suite with good coverage.

The test suite provides comprehensive coverage for the rolldown bundler integration:

  • Tests default configuration
  • Tests dynamic file naming
  • Tests relative path output
  • Tests absolute path output

Each test properly validates the generation of stats files with different configurations, which is excellent for ensuring the plugin works correctly with rolldown.

@vio vio force-pushed the rolldown-tests branch from 0a1a615 to e02c6a5 Compare April 23, 2025 22:14
Copy link

@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: 3

♻️ Duplicate comments (1)
test/package/rolldown-package.test.js (1)

7-7: ⚠️ Potential issue

Fix incorrect import path

The import statement is referring to './rollup.config' while you're testing Rolldown bundler. This mismatch is causing test failures.

-import config, { dynamicOptions, relativeFileNameConfig, absoluteFileNameConfig } from './rollup.config';
+import config, { dynamicOptions, relativeFileNameConfig, absoluteFileNameConfig } from './rolldown.config';
🧹 Nitpick comments (2)
test/package/rolldown-package.test.js (2)

1-60: Add check for rolldown availability

Since rolldown is a relatively new dependency, it would be good to add a check to skip these tests if rolldown is not available in the environment.

import fs from 'node:fs/promises';
import path from 'node:path';
-import { describe, test, expect, beforeEach } from 'vitest';
+import { describe, test, expect, beforeEach, beforeAll } from 'vitest';
import { rolldown } from 'rolldown';
import { vol } from 'memfs';

import config, { dynamicOptions, relativeFileNameConfig, absoluteFileNameConfig } from './rolldown.config';

+let hasRolldown = true;
+
+beforeAll(() => {
+  try {
+    require.resolve('rolldown');
+  } catch (e) {
+    hasRolldown = false;
+    console.warn('Rolldown not available, skipping rolldown tests');
+  }
+});
+
describe('rolldown package test', () => {
  beforeEach(() => {
+    if (!hasRolldown) {
+      test.skip('rolldown not available');
+      return;
+    }
    vol.reset();
  });

  // Rest of the tests remain unchanged
  // ...
});
🧰 Tools
🪛 GitHub Check: Test package on rollup v4 / node 20 / ubuntu-latest

[failure] 29-29: test/package/rolldown-package.test.js > rolldown package test > should output stats JSON file with explicit compilation file name
Error: ENOENT: no such file or directory, open 'dist/stats.es.json'
❯ test/package/rolldown-package.test.js:29:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: 'dist/stats.es.json' }

🪛 GitHub Check: Test package on rollup v4 / node 22 / windows-latest

[failure] 29-29: test/package/rolldown-package.test.js > rolldown package test > should output stats JSON file with explicit compilation file name
Error: ENOENT: no such file or directory, open 'dist/stats.es.json'
❯ test/package/rolldown-package.test.js:29:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: 'dist/stats.es.json' }

🪛 GitHub Check: Test package on rollup v4 / node 22 / ubuntu-latest

[failure] 29-29: test/package/rolldown-package.test.js > rolldown package test > should output stats JSON file with explicit compilation file name
Error: ENOENT: no such file or directory, open 'dist/stats.es.json'
❯ test/package/rolldown-package.test.js:29:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: 'dist/stats.es.json' }

🪛 GitHub Check: Test package on rollup v3 / node 22 / windows-latest

[failure] 29-29: test/package/rolldown-package.test.js > rolldown package test > should output stats JSON file with explicit compilation file name
Error: ENOENT: no such file or directory, open 'dist/stats.es.json'
❯ test/package/rolldown-package.test.js:29:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: 'dist/stats.es.json' }

🪛 GitHub Check: Test package on rollup v3 / node 22 / ubuntu-latest

[failure] 29-29: test/package/rolldown-package.test.js > rolldown package test > should output stats JSON file with explicit compilation file name
Error: ENOENT: no such file or directory, open 'dist/stats.es.json'
❯ test/package/rolldown-package.test.js:29:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: 'dist/stats.es.json' }

🪛 GitHub Actions: ci

[error] 1-1: Test failed: should output stats JSON file with explicit compilation file name. Error: ENOENT: no such file or directory, open 'dist/stats.es.json'


15-16: Consider consistent error handling across bundlers

Add error handling to catch and properly report bundling issues, similar to what you might have in the Rollup tests.

-    const bundle = await rolldown(config);
-    await bundle.generate(config.output);
+    try {
+      const bundle = await rolldown(config);
+      await bundle.generate(config.output);
+    } catch (error) {
+      console.error('Rolldown bundling error:', error);
+      throw error;
+    }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0a1a615 and e02c6a5.

⛔ Files ignored due to path filters (1)
  • test/package/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • test/package/package.json (1 hunks)
  • test/package/rolldown-package.test.js (1 hunks)
  • test/package/rolldown.config.js (1 hunks)
  • test/package/rollup-package.test.js (2 hunks)
✅ Files skipped from review due to trivial changes (2)
  • test/package/package.json
  • test/package/rolldown.config.js
🧰 Additional context used
🪛 GitHub Check: Test package on rollup v4 / node 20 / ubuntu-latest
test/package/rolldown-package.test.js

[failure] 29-29: test/package/rolldown-package.test.js > rolldown package test > should output stats JSON file with explicit compilation file name
Error: ENOENT: no such file or directory, open 'dist/stats.es.json'
❯ test/package/rolldown-package.test.js:29:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: 'dist/stats.es.json' }

test/package/rollup-package.test.js

[failure] 29-29: test/package/rollup-package.test.js > rollup package test > should output stats JSON file with explicit compilation file name
Error: ENOENT: no such file or directory, open 'dist/stats.es.json'
❯ test/package/rollup-package.test.js:29:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: 'dist/stats.es.json' }

🪛 GitHub Check: Test package on rollup v4 / node 22 / windows-latest
test/package/rolldown-package.test.js

[failure] 29-29: test/package/rolldown-package.test.js > rolldown package test > should output stats JSON file with explicit compilation file name
Error: ENOENT: no such file or directory, open 'dist/stats.es.json'
❯ test/package/rolldown-package.test.js:29:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: 'dist/stats.es.json' }

test/package/rollup-package.test.js

[failure] 29-29: test/package/rollup-package.test.js > rollup package test > should output stats JSON file with explicit compilation file name
Error: ENOENT: no such file or directory, open 'dist/stats.es.json'
❯ test/package/rollup-package.test.js:29:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: 'dist/stats.es.json' }

🪛 GitHub Check: Test package on rollup v4 / node 22 / ubuntu-latest
test/package/rolldown-package.test.js

[failure] 29-29: test/package/rolldown-package.test.js > rolldown package test > should output stats JSON file with explicit compilation file name
Error: ENOENT: no such file or directory, open 'dist/stats.es.json'
❯ test/package/rolldown-package.test.js:29:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: 'dist/stats.es.json' }

test/package/rollup-package.test.js

[failure] 29-29: test/package/rollup-package.test.js > rollup package test > should output stats JSON file with explicit compilation file name
Error: ENOENT: no such file or directory, open 'dist/stats.es.json'
❯ test/package/rollup-package.test.js:29:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: 'dist/stats.es.json' }

🪛 GitHub Check: Test package on rollup v3 / node 22 / windows-latest
test/package/rolldown-package.test.js

[failure] 29-29: test/package/rolldown-package.test.js > rolldown package test > should output stats JSON file with explicit compilation file name
Error: ENOENT: no such file or directory, open 'dist/stats.es.json'
❯ test/package/rolldown-package.test.js:29:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: 'dist/stats.es.json' }

test/package/rollup-package.test.js

[failure] 29-29: test/package/rollup-package.test.js > rollup package test > should output stats JSON file with explicit compilation file name
Error: ENOENT: no such file or directory, open 'dist/stats.es.json'
❯ test/package/rollup-package.test.js:29:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: 'dist/stats.es.json' }

🪛 GitHub Check: Test package on rollup v3 / node 22 / ubuntu-latest
test/package/rolldown-package.test.js

[failure] 29-29: test/package/rolldown-package.test.js > rolldown package test > should output stats JSON file with explicit compilation file name
Error: ENOENT: no such file or directory, open 'dist/stats.es.json'
❯ test/package/rolldown-package.test.js:29:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: 'dist/stats.es.json' }

test/package/rollup-package.test.js

[failure] 29-29: test/package/rollup-package.test.js > rollup package test > should output stats JSON file with explicit compilation file name
Error: ENOENT: no such file or directory, open 'dist/stats.es.json'
❯ test/package/rollup-package.test.js:29:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: 'dist/stats.es.json' }

🪛 GitHub Actions: ci
test/package/rolldown-package.test.js

[error] 1-1: Test failed: should output stats JSON file with explicit compilation file name. Error: ENOENT: no such file or directory, open 'dist/stats.es.json'

test/package/rollup-package.test.js

[error] 1-1: Test failed: should output stats JSON file with explicit compilation file name. Error: ENOENT: no such file or directory, open 'dist/stats.es.json'

🔇 Additional comments (2)
test/package/rollup-package.test.js (2)

27-27: Good update to use consistent configuration references!

The change to use dynamicOptions.output instead of config.output for generating the bundle aligns with the configuration used for creating the bundle. This ensures consistency between bundle creation and generation.


9-9: Nice description update!

Updating the test suite description to "rollup package test" provides better clarity about the purpose of these tests, especially now that there are separate test suites for different bundlers.

import fs from 'node:fs/promises';
import path from 'node:path';
import { describe, test, expect, beforeEach } from 'vitest';
import { rolldown } from 'rolldown';
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify rolldown import

Ensure the rolldown package is correctly installed as a dev dependency and that the import syntax matches the package's export. Check the rolldown documentation to confirm the correct import method.


🏁 Script executed:

#!/bin/bash
# Check if rolldown is installed and how it should be imported
npm list rolldown --depth=0 || yarn list --pattern rolldown --depth=0

# Look for export statements in rolldown source
if [ -d "node_modules/rolldown" ]; then
  grep -r "export" --include="*.js" "node_modules/rolldown"
fi

Length of output: 341


Add and verify the rolldown dependency and import

It looks like the rolldown module isn’t installed in node_modules (so your test will always fail). To fix:

• In package.json – add rolldown as a devDependency:

npm install --save-dev rolldown

• In test/package/rolldown-package.test.js – confirm that the import matches what rolldown actually exports. If it uses a default export, switch to:

import rolldown from 'rolldown';

Otherwise, keep the named import ({ rolldown }) if that’s what the docs specify.

Once installed, rerun the test to ensure it resolves correctly.

@vio vio force-pushed the rolldown-tests branch from e02c6a5 to c421297 Compare April 23, 2025 22:23
Copy link

@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: 2

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

143-143: Remove trailing spaces

The line npm install contains trailing whitespace and will trigger a YAML lint error. Trim it to:

-          npm install 
+          npm install
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 143-143: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e02c6a5 and c421297.

⛔ Files ignored due to path filters (1)
  • test/package/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • .github/workflows/ci.yml (2 hunks)
  • test/package/package.json (1 hunks)
  • test/package/rolldown-package.test.js (1 hunks)
  • test/package/rolldown.config.js (1 hunks)
  • test/package/rollup-package.test.js (2 hunks)
✅ Files skipped from review due to trivial changes (2)
  • test/package/package.json
  • test/package/rolldown.config.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • test/package/rollup-package.test.js
  • test/package/rolldown-package.test.js
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/ci.yml

108-108: property "rollup" is not defined in object type {node: number; os: string; rolldown: number}

(expression)


142-142: property "rollup" is not defined in object type {node: number; os: string; rolldown: number}

(expression)

🪛 YAMLlint (1.35.1)
.github/workflows/ci.yml

[error] 143-143: trailing spaces

(trailing-spaces)

🔇 Additional comments (2)
.github/workflows/ci.yml (2)

54-55: Approve test-package-rollup integration

The renaming from test-package to test-package-rollup and the addition of the -t rollup flag in the test command correctly scopes this job to the Rollup bundler. The matrix configuration and steps are well-defined and align with existing conventions.

Also applies to: 105-106


156-157: Approve addition of bundler test dependencies

Adding both test-package-rollup and test-package-rolldown to the tests job’s needs ensures the pipeline only proceeds when tests for both bundlers have passed.

@vio vio force-pushed the rolldown-tests branch from c421297 to ef31d98 Compare April 23, 2025 22:37
@vio vio force-pushed the rolldown-tests branch from ef31d98 to c67024a Compare April 23, 2025 22:46
@vio vio merged commit 5201f20 into master Apr 23, 2025
17 checks passed
@vio vio deleted the rolldown-tests branch April 23, 2025 22:57
@coderabbitai coderabbitai bot mentioned this pull request Jun 28, 2025
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.

2 participants