Skip to content

Conversation

@kazupon
Copy link
Member

@kazupon kazupon commented Jul 2, 2025

back port from #2221

Summary by CodeRabbit

  • Bug Fixes

    • Corrected a typographical error in a constant name from NOT_REOSLVED to NOT_RESOLVED, ensuring consistent fallback behavior in translation, number, and datetime formatting features.
    • Updated related test cases to use the corrected constant name.
  • Chores

    • Relocated the "type": "module" field to the end of multiple package configuration files for improved consistency.
    • Standardized HTML tag formatting in example documentation.

@coderabbitai
Copy link

coderabbitai bot commented Jul 2, 2025

Walkthrough

This update standardizes the spelling of the constant NOT_RESOLVED across source and test files, correcting previous typographical errors. Additionally, it reorganizes the placement of the "type": "module" field in multiple package.json files, moving it to the end of each file. Minor HTML formatting improvements were also made.

Changes

Files/Groups Change Summary
examples/storybook/index.html Changed <!DOCTYPE html> to lowercase and made meta/link tags self-closing.
packages/*/package.json Moved "type": "module" field from top-level to end of each package.json file.
packages/core-base/src/context.ts Renamed exported constant NOT_REOSLVED to NOT_RESOLVED.
packages/core-base/src/datetime.ts,
number.ts,
translate.ts
Fixed typo: replaced NOT_REOSLVED with NOT_RESOLVED in imports and usage.
packages/core-base/test/datetime.test.ts,
number.test.ts,
translate.test.ts
Corrected test imports and assertions to use NOT_RESOLVED instead of NOT_REOSLVED.
packages/vue-i18n-core/src/composer.ts Fixed typo in constant usage: NOT_REOSLVEDNOT_RESOLVED in import and logic.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CoreContext
    participant Constants

    User->>CoreContext: Request translation/number/datetime
    CoreContext->>Constants: Check for resolved value
    alt Not resolved
        CoreContext-->>User: Return NOT_RESOLVED
    else Resolved
        CoreContext-->>User: Return resolved value
    end
Loading

Suggested labels

Type: Improvement

Poem

In the warren, code was spelled,
A typo fixed, as rabbits yelled!
"RESOLVED at last!" they cheered in glee,
And modules moved for clarity.
With tags now closed and names made right,
The code hops forward, pure and bright! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.

@kazupon kazupon added the Type: Improvement Includes backwards-compatible fixes label Jul 2, 2025
@cloudflare-workers-and-pages
Copy link

Deploying vue-i18n-next with  Cloudflare Pages  Cloudflare Pages

Latest commit: c52ee7b
Status: ✅  Deploy successful!
Preview URL: https://f4806872.vue-i18n-next.pages.dev
Branch Preview URL: https://fix-core-base-typo-v12.vue-i18n-next.pages.dev

View logs

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: 0

🧹 Nitpick comments (2)
examples/storybook/index.html (1)

4-6: Avoid mixing XHTML-style self-closing tags in HTML5

<meta> and <link> are void elements, so the extra /> is optional. If the rest of the codebase omits it, consider reverting to <meta …> / <link …> for stylistic consistency.

packages/shared/package.json (1)

5-9: Typo in keyword list: utitlityutility

While outside the scope of the current change, fixing this misspelling will improve searchability on npm.

-    "intlify",
-    "utitlity"
+    "intlify",
+    "utility"
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b7c93ac and c52ee7b.

📒 Files selected for processing (17)
  • examples/storybook/index.html (1 hunks)
  • packages/core-base/package.json (1 hunks)
  • packages/core-base/src/context.ts (1 hunks)
  • packages/core-base/src/datetime.ts (2 hunks)
  • packages/core-base/src/number.ts (2 hunks)
  • packages/core-base/src/translate.ts (2 hunks)
  • packages/core-base/test/datetime.test.ts (3 hunks)
  • packages/core-base/test/number.test.ts (3 hunks)
  • packages/core-base/test/translate.test.ts (3 hunks)
  • packages/core/package.json (1 hunks)
  • packages/devtools-types/package.json (1 hunks)
  • packages/message-compiler/package.json (1 hunks)
  • packages/petite-vue-i18n/package.json (1 hunks)
  • packages/shared/package.json (1 hunks)
  • packages/vue-i18n-core/package.json (1 hunks)
  • packages/vue-i18n-core/src/composer.ts (2 hunks)
  • packages/vue-i18n/package.json (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (7)
packages/core-base/src/number.ts (1)
packages/core-base/src/context.ts (1)
  • NOT_RESOLVED (339-339)
packages/core-base/src/datetime.ts (1)
packages/core-base/src/context.ts (1)
  • NOT_RESOLVED (339-339)
packages/core-base/test/number.test.ts (2)
packages/core-base/src/number.ts (1)
  • number (185-290)
packages/core-base/src/context.ts (1)
  • NOT_RESOLVED (339-339)
packages/core-base/src/translate.ts (2)
packages/core-base/src/context.ts (1)
  • NOT_RESOLVED (339-339)
packages/core-base/src/runtime.ts (1)
  • MessageFunctionReturn (76-78)
packages/core-base/test/datetime.test.ts (2)
packages/core-base/src/datetime.ts (1)
  • datetime (190-295)
packages/core-base/src/context.ts (1)
  • NOT_RESOLVED (339-339)
packages/core-base/test/translate.test.ts (2)
packages/core-base/src/translate.ts (1)
  • translate (614-802)
packages/core-base/src/context.ts (1)
  • NOT_RESOLVED (339-339)
packages/vue-i18n-core/src/composer.ts (1)
packages/core-base/src/context.ts (1)
  • NOT_RESOLVED (339-339)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: upload
  • GitHub Check: Build (windows-latest, 20)
  • GitHub Check: Unit test (windows-latest, 22)
  • GitHub Check: Unit test (windows-latest, 20)
  • GitHub Check: Build (ubuntu-latest, 20)
  • GitHub Check: Build (macos-latest, 20)
  • GitHub Check: release
  • GitHub Check: release
🔇 Additional comments (25)
examples/storybook/index.html (1)

1-1: Lower-case DOCTYPE is perfectly valid

<!doctype html> is functionally identical to the previous upper-case form in HTML5—no action needed.

packages/vue-i18n/package.json (1)

80-82: Order-only change, no functional impact – looks good

Re-locating "type": "module" after "sideEffects" is a cosmetic re-ordering; JSON property order is ignored by tooling. No risk introduced.

packages/vue-i18n-core/package.json (1)

86-88: Consistent re-ordering acknowledged

Same non-functional move of "type": "module" beneath "sideEffects". File now ends cleanly with no dangling comma – all good.

packages/core/package.json (1)

73-75: LGTM

Pure re-ordering; validates against npm pack --dry-run without warnings. 👍

packages/core-base/package.json (1)

71-73: No issues found

Cosmetic relocation only; JSON remains valid and consistent with other packages.

packages/message-compiler/package.json (1)

70-72: Change approved

Ordering tweak confirmed; nothing else altered.
Minor note: keeping the same field order across every package.json (sideEffects → type) helps diff readability—current patch already follows that.

packages/shared/package.json (1)

59-60: Change is harmless – ordering of keys in package.json is non-semantic

Relocating the "type": "module" field next to "sideEffects": false does not affect consumers and keeps the layout consistent with other package manifests in the repo.

packages/petite-vue-i18n/package.json (1)

80-82: Consistent field positioning looks good

Same non-functional shuffle as in other packages – no issues spotted.

packages/devtools-types/package.json (1)

62-64: No concerns with the key re-ordering

The move keeps manifests uniform across workspaces; behaviour remains unchanged.

packages/core-base/src/context.ts (1)

339-339: LGTM! Typo fixed in constant definition.

The NOT_RESOLVED constant is now correctly spelled. This fix ensures consistency across the entire codebase.

packages/core-base/test/number.test.ts (2)

26-26: LGTM! Import statement corrected.

The import of NOT_RESOLVED now uses the correct spelling, consistent with the fixed constant definition.


243-243: LGTM! Test assertions updated with correct constant spelling.

Both test assertions in the "context unresolving option" suite now correctly reference NOT_RESOLVED, ensuring tests will pass with the fixed constant definition.

Also applies to: 262-262

packages/core-base/src/number.ts (2)

14-14: LGTM! Import statement corrected.

The import of NOT_RESOLVED now uses the correct spelling, ensuring proper reference to the fixed constant definition.


273-273: LGTM! Usage updated with correct constant spelling.

The return statement now correctly references NOT_RESOLVED when the unresolving option is enabled and format resolution fails.

packages/core-base/src/datetime.ts (2)

15-15: LGTM! Import statement corrected.

The import of NOT_RESOLVED now uses the correct spelling, consistent with the fixed constant definition.


278-278: LGTM! Usage updated with correct constant spelling.

The return statement now correctly references NOT_RESOLVED when the unresolving option is enabled and datetime format resolution fails.

packages/core-base/test/datetime.test.ts (2)

26-26: LGTM! Import statement corrected.

The import of NOT_RESOLVED now uses the correct spelling, ensuring consistency with the fixed constant definition.


269-269: LGTM! Test assertions updated with correct constant spelling.

Both test assertions in the "context unresolving option" suite now correctly reference NOT_RESOLVED, ensuring tests will pass with the fixed constant definition.

Also applies to: 288-288

packages/core-base/src/translate.ts (2)

21-28: Typo fixed – import is now correctly referencing NOT_RESOLVED.
The constant name now matches the definition in context.ts, avoiding the previous undefined-identifier issue.


706-717: Return-path now uses the right sentinel constant.
The early-return branch correctly compares against NOT_RESOLVED, restoring the missing-translation sentinel flow. No further action required.

packages/vue-i18n-core/src/composer.ts (2)

1-7: Import typo corrected – NOT_RESOLVED is resolved.
This prevents runtime undefined errors when the composer evaluates unresolved translations.


2236-2241: Fallback detection condition fixed.
The check now hits the intended NOT_RESOLVED sentinel, ensuring proper root fallback behaviour. Looks good.

packages/core-base/test/translate.test.ts (3)

19-19: LGTM! Critical typo fix in import statement.

The import statement now correctly references NOT_RESOLVED instead of the typo NOT_REOSLVED. This fix is essential for the tests to work properly.


556-556: LGTM! Correct usage of the fixed constant.

The test assertion properly expects NOT_RESOLVED to be returned when the unresolving option is enabled and the message cannot be resolved.


571-571: LGTM! Correct usage of the fixed constant.

The test assertion properly expects NOT_RESOLVED to be returned when the unresolving option is enabled and the message cannot be resolved.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jul 2, 2025

Open in StackBlitz

@intlify/core

npm i https://pkg.pr.new/@intlify/core@2222

@intlify/core-base

npm i https://pkg.pr.new/@intlify/core-base@2222

@intlify/devtools-types

npm i https://pkg.pr.new/@intlify/devtools-types@2222

@intlify/message-compiler

npm i https://pkg.pr.new/@intlify/message-compiler@2222

petite-vue-i18n

npm i https://pkg.pr.new/petite-vue-i18n@2222

@intlify/shared

npm i https://pkg.pr.new/@intlify/shared@2222

vue-i18n

npm i https://pkg.pr.new/vue-i18n@2222

@intlify/vue-i18n-core

npm i https://pkg.pr.new/@intlify/vue-i18n-core@2222

commit: c52ee7b

@github-actions
Copy link

github-actions bot commented Jul 2, 2025

Size Report

Bundles

File Size Gzip Brotli
core.esm-browser.prod.js 38.05 kB 11.62 kB (-0.00 kB) 10.38 kB (-0.01 kB)
core.global.prod.js 31.11 kB 10.78 kB (-0.00 kB) 9.71 kB (+0.04 kB)
core.runtime.esm-browser.prod.js 23.77 kB 7.70 kB (-0.01 kB) 6.89 kB (-0.01 kB)
core.runtime.global.prod.js 18.08 kB 7.03 kB (-0.01 kB) 6.31 kB (-0.01 kB)
message-compiler.esm-browser.prod.js 19.29 kB 5.76 kB 5.14 kB
message-compiler.global.prod.js 17.32 kB 5.55 kB 4.98 kB
petite-vue-i18n-core.esm-browser.prod.js 20.70 kB 6.98 kB 6.27 kB (-0.00 kB)
petite-vue-i18n-core.global.prod.js 15.66 kB 6.08 kB 5.51 kB
petite-vue-i18n.esm-browser.prod.js 37.01 kB 11.36 kB 10.20 kB (+0.00 kB)
petite-vue-i18n.global.prod.js 29.87 kB 10.21 kB 9.22 kB
petite-vue-i18n.runtime.esm-browser.prod.js 22.58 kB 7.35 kB 6.64 kB (-0.00 kB)
petite-vue-i18n.runtime.global.prod.js 16.86 kB 6.42 kB 5.82 kB
vue-i18n.esm-browser.prod.js 50.71 kB 15.17 kB (-0.00 kB) 13.60 kB (+0.04 kB)
vue-i18n.global.prod.js 40.57 kB 13.63 kB 12.25 kB
vue-i18n.runtime.esm-browser.prod.js 36.28 kB 11.17 kB (-0.00 kB) 10.03 kB (-0.01 kB)
vue-i18n.runtime.global.prod.js 27.56 kB 9.88 kB 8.91 kB

Usages

Name Size Gzip Brotli
packages/size-check-core (@intlify/core) 9.22 kB 3.82 kB 3.46 kB
packages/size-check-petite-vue-i18n (petite-vue-i18n) 78.02 kB 30.40 kB 27.36 kB
packages/size-check-vue-i18n (vue-i18n) 83.24 kB 31.90 kB 28.70 kB

@kazupon kazupon merged commit f51b27f into master Jul 2, 2025
31 checks passed
@kazupon kazupon deleted the fix/core-base-typo-v12 branch July 2, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Improvement Includes backwards-compatible fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants