Skip to content

Update - #48

Merged
4sllan merged 14 commits into
mainfrom
update
Jul 29, 2026
Merged

4sllan merged 14 commits into
mainfrom
update

Conversation

@4sllan

@4sllan 4sllan commented Jun 16, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Upgraded project to support Nuxt 4
    • Enhanced CI/CD pipeline now runs tests on every push and pull request
  • Tests

    • Added comprehensive test coverage for Dropzone component, utilities, and module imports
    • Removed legacy placeholder tests
  • Chores

    • Updated ESLint and Prettier configurations for improved code quality standards
    • Restructured TypeScript configuration with project references
    • Updated build tooling and dependencies to Nuxt 4 ecosystem standards

aslan.gama added 8 commits June 16, 2026 13:49
Adiciona o arquivo vitest.config.ts para configurar os testes unitários do projeto,
incluindo plugins Vue, aliases de resolução de módulos e configurações de ambiente.
Remove .eslintrc.json e adiciona eslint.config.js com a nova configuração flat.
Ajusta regras para Nuxt, Vue e TypeScript para melhor consistência.
Move a imagem 'checkerboard.jpg' para o diretório correto 'app/assets/images'.
Atualiza workflows de CI para incluir testes unitários e lint.
Adiciona workflow de release para publicação no npm e criação de releases no GitHub, garantindo a validação de versão e changelog.
Remove workflow de testes obsoleto.
Adiciona novos arquivos de teste:
- 'dropzone.test.ts': 382 novas linhas para testar o componente Dropzone.
- 'utils.test.ts': 126 novas linhas para testar as funções utilitárias.
- 'module.test.ts': 9 novas linhas para verificar a importação do módulo.
Remove 'example.test.ts' (7 linhas deletadas).
@4sllan 4sllan self-assigned this Jun 16, 2026
@coderabbitai

coderabbitai Bot commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@4sllan, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4895fdf9-a968-44a8-843a-7939c507e1ed

📥 Commits

Reviewing files that changed from the base of the PR and between 56f3d0b and 97f4dbd.

📒 Files selected for processing (7)
  • .prettierignore
  • CHANGELOG.md
  • package.json
  • playground/app/components/ImageCropper.vue
  • test/dropzone.test.ts
  • tsconfig.json
  • vitest.config.ts
📝 Walkthrough

Walkthrough

Upgrades the six-dropzone module from Nuxt 3 to Nuxt 4 (^4.0.0 compatibility, version 0.4.8), replaces .eslintrc.json with a flat eslint.config.js, adds Prettier config, splits CI and release into separate GitHub Actions workflows, introduces a Vitest unit test suite for Dropzone.vue and runtime utilities, and restructures the playground directory.

Changes

Nuxt 4 Migration and Tooling Overhaul

Layer / File(s) Summary
Nuxt 4 module and TypeScript config
package.json, src/module.ts, tsconfig.json, playground/tsconfig.json, playground/package.json
Bumps the module compatibility from ^3.0.0 to ^4.0.0, updates version to 0.4.8, pins all dependencies to Nuxt 4 toolchain versions, replaces extends-based tsconfig with explicit compilerOptions and project references. playground/package.json is removed.
ESLint, Prettier, and Vitest configuration
.eslintrc.json, eslint.config.js, .prettierrc, .prettierignore, vitest.config.ts
Removes legacy .eslintrc.json and introduces flat eslint.config.js via createConfigForNuxt with JS/Vue/TS rule overrides. Adds .prettierrc with formatting rules and .prettierignore for build artifacts. Configures vitest.config.ts with Vue plugin, path aliases for #imports/#runtime/#modules, happy-dom environment, and coverage settings.
CI and release workflow split
.github/workflows/ci.yml, .github/workflows/release.yml, .github/workflows/test.yml
Removes the old test.yml. Replaces the tag-triggered pipeline in ci.yml with a branch/PR unit job using pnpm v10 + Node 20. Adds release.yml that validates tag/package.json version parity, extracts the matching CHANGELOG.md section via awk, publishes to npm with provenance, and creates a GitHub Release.
Unit test suite
test/dropzone.test.ts, test/utils.test.ts, test/module.test.ts, test/example.test.ts
Removes the placeholder example.test.ts. Adds module.test.ts (dynamic import check), utils.test.ts (covers backgroundImage, imageUrlToBase64, dataURLtoFile, isFileAccepted), and dropzone.test.ts (props, events, multiple files, exposed methods, drag-and-drop, slots, modelValue sync).
Playground restructure
playground/components/ImageCropper.vue, playground/app/components/ImageCropper.vue
Removes the active playground/components/ImageCropper.vue (with src prop, cropped/close emits). Adds playground/app/components/ImageCropper.vue under the Nuxt 4 app/ directory; script and template are fully commented out, but scoped CSS is active.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • 4sllan/six-dropzone#47: Modifies the same .github/workflows/ci.yml file with overlapping Node/Actions configuration changes.
  • 4sllan/six-dropzone#4: Directly touches both .eslintrc.json and .github/workflows/ci.yml, which are both changed in this PR.
  • 4sllan/six-dropzone#26: Adds playground/components/ImageCropper.vue, which this PR removes and relocates to playground/app/components/.

Suggested labels

enhancement

🐇 From Nuxt 3 to 4 we hop with glee,
New workflows, new tests—oh fiddle-dee!
ESLint flat, Prettier neat,
The Dropzone suite is now complete.
A bunny approved this with both feet! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The pull request title "Update" is vague and generic, providing no meaningful information about the changeset's purpose or primary changes. Provide a descriptive title that clearly summarizes the main objective, such as "Upgrade to Nuxt 4 and restructure CI workflows" or "Migrate project to Nuxt 4 with updated tooling and tests".
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 14-47: The job named "🧩 Unit + Lint + Typecheck" at line 15
advertises three types of checks but only executes `pnpm test` in the final step
at line 47, allowing lint and typecheck regressions to merge undetected. Add two
additional workflow steps after the "Run Unit Tests" step: one that runs `pnpm
lint` and another that runs `pnpm typecheck`, following the same pattern as the
existing test step, so the job actually performs all three promised checks.
- Around line 19-29: Replace all mutable action version tags with full commit
SHAs to prevent potential compromise and add credential isolation for security
hardening. In `.github/workflows/ci.yml` at lines 19-29, pin the
`actions/checkout@v6`, `pnpm/action-setup@v4`, and `actions/setup-node@v6`
actions to their full commit SHAs, add `persist-credentials: false` to the
checkout action, and add a top-level `permissions:` block with `contents: read`.
In `.github/workflows/release.yml` at lines 18-34, pin the same three actions
(`actions/checkout`, `pnpm/action-setup`, and `actions/setup-node`) to their
full commit SHAs and add `persist-credentials: false` to the checkout action. In
`.github/workflows/release.yml` at line 105, pin the
`softprops/action-gh-release` action to its full commit SHA instead of the
mutable tag.

In @.github/workflows/release.yml:
- Around line 75-90: The awk script in the changelog parsing section uses a
sequence of string substitutions (lines 79-83) that doesn't robustly extract the
version number from headings like "## [v0.4.8] - 2026-06-16". The current
approach removes characters in sequence but leaves extra text (like the trailing
"- 2026-06-16" date and remaining brackets), causing the comparison on line 82
to fail even for valid version headings. Replace the brittle multi-substitution
approach with a more targeted regex pattern that extracts only the version
number (e.g., using grep or a single awk regex) so the heading comparison
reliably matches versions regardless of surrounding formatting like dates or
brackets.

In @.prettierignore:
- Line 7: The .prettierignore file contains an incorrect pattern on line 7 that
reads .playground when the actual directory path in the repo is playground/.
Change the pattern from .playground to playground/ to ensure the playground
directory is properly excluded from Prettier formatting runs.

In `@playground/app/components/ImageCropper.vue`:
- Around line 1-96: The entire ImageCropper component implementation is
commented out, breaking the component contract required by its consumer in
playground/app/pages/index.vue. Restore functionality by uncommenting the script
setup section (which includes the props definition for src, the emit definitions
for cropped and close events, and the functions emitCrop, confirmDelete, and
applyZoom) and uncommenting the template section with the cropper UI and delete
confirmation dialog. This will re-enable the component to accept the src prop
and emit the cropped and close events as expected by the consuming code.

In `@test/dropzone.test.ts`:
- Around line 1-13: Remove the fake timer setup from the test suite since the
tests do not manipulate timers and it conflicts with the setTimeout in
Dropzone's onMounted lifecycle. Delete the vi.useFakeTimers() call from the
beforeEach hook. Also update the afterEach hook to call vi.useRealTimers()
instead of just vi.restoreAllMocks() to ensure real timers are properly
restored, or remove the afterEach hook entirely if no other cleanup is needed
after fake timers are no longer being used.

In `@vitest.config.ts`:
- Around line 2-13: The vitest.config.ts file uses `__dirname` which is not
available in ES modules and will cause a ReferenceError when Vitest loads the
config. In the resolve.alias object (lines 10–12), replace all occurrences of
`__dirname` with an ESM-safe alternative. For Node.js v20.11.0 or later, use
`import.meta.dirname` directly in place of `__dirname`. For older Node.js
versions, add an import statement for `fileURLToPath` from 'node:url' and
`import.meta.url`, then derive the directory path before using it in the alias
definitions. Update the three alias paths: '`#imports`', '`#runtime`', and
'`#modules`' to use the ESM-compatible directory reference instead of `__dirname`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6dac84f9-1548-4605-8ac9-0eba9100ab94

📥 Commits

Reviewing files that changed from the base of the PR and between 140a74c and 56f3d0b.

⛔ Files ignored due to path filters (3)
  • package-lock.json is excluded by !**/package-lock.json
  • playground/app/assets/images/checkerboard.jpg is excluded by !**/*.jpg
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (20)
  • .eslintrc.json
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • .github/workflows/test.yml
  • .prettierignore
  • .prettierrc
  • eslint.config.js
  • package.json
  • playground/app/components/ImageCropper.vue
  • playground/app/pages/index.vue
  • playground/components/ImageCropper.vue
  • playground/package.json
  • playground/tsconfig.json
  • src/module.ts
  • test/dropzone.test.ts
  • test/example.test.ts
  • test/module.test.ts
  • test/utils.test.ts
  • tsconfig.json
  • vitest.config.ts
💤 Files with no reviewable changes (5)
  • .github/workflows/test.yml
  • playground/components/ImageCropper.vue
  • test/example.test.ts
  • playground/package.json
  • .eslintrc.json

Comment thread .prettierignore Outdated
Comment thread playground/app/components/ImageCropper.vue
Comment thread test/dropzone.test.ts Outdated
Repository owner deleted a comment from coderabbitai Bot Jul 29, 2026
Repository owner deleted a comment from coderabbitai Bot Jul 29, 2026
Repository owner deleted a comment from coderabbitai Bot Jul 29, 2026
4sllan and others added 5 commits July 29, 2026 13:06
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Refactor Vitest configuration for better module resolution using `fileURLToPath` and improve TypeScript configuration by setting `moduleResolution` to `bundler`.
Repository owner deleted a comment from coderabbitai Bot Jul 29, 2026
@4sllan
4sllan merged commit bb6ce90 into main Jul 29, 2026
2 checks passed
@4sllan
4sllan deleted the update branch July 29, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant