Skip to content

Conversation

@sv2dev
Copy link
Owner

@sv2dev sv2dev commented Apr 17, 2025

Summary by CodeRabbit

  • Chores
    • Switched from CircleCI to GitHub Actions for continuous integration and publishing workflows.
    • Simplified and updated ignore files to better manage build artifacts and dependencies.
    • Removed Yarn configuration in favor of npm and Volta for Node.js version management.
    • Updated package metadata, scripts, and dependencies for improved maintainability.
  • Refactor
    • Streamlined TypeScript configurations and build processes for both core and lit packages.
  • Bug Fixes
    • Ensured browser history state is explicitly set to null when undefined, improving navigation consistency.
  • Tests
    • Updated and added test cases for improved coverage and accuracy.
  • Documentation
    • Enhanced package metadata for clarity and accuracy.

@sv2dev sv2dev linked an issue Apr 17, 2025 that may be closed by this pull request
@coderabbitai
Copy link

coderabbitai bot commented Apr 17, 2025

Walkthrough

This update transitions the project from Yarn and CircleCI to npm and GitHub Actions for dependency management and continuous integration. The .circleci and Yarn configuration files are removed, replaced by GitHub Actions workflows for building, testing, and publishing. The .gitignore and .npmignore files are updated to reflect new build artifacts and ignore patterns. TypeScript configurations are streamlined for project references and incremental builds. The package.json files are revised for npm compatibility, updated metadata, and simplified scripts. Some internal logic in the router code is refined to handle null and undefined state values consistently.

Changes

Files / Grouped Paths Change Summary
.circleci/config.yml, .yarnrc.yml Removed CircleCI and Yarn configuration files.
.github/workflows/publish.yaml, .github/workflows/test-build.yaml Added GitHub Actions workflows for publishing and CI testing.
.gitignore Simplified Yarn ignore patterns, added *.tsbuildinfo to ignores.
package.json Switched scripts from Yarn to npm, updated devDependencies, added Volta config, updated metadata.
tsconfig.json Changed module resolution to bundler, added source/declaration maps, removed some compiler options.
packages/esroute/package.json, packages/esroute-lit/package.json Updated package metadata, bumped versions to 0.10.0, simplified build scripts, removed esbuild.
packages/esroute/.npmignore, packages/esroute-lit/.npmignore Updated ignore patterns to exclude maps, specs, build info; removed some previous ignores.
packages/esroute/tsconfig.json, packages/esroute-lit/tsconfig.json Enabled project references, set composite: true, switched to include/exclude for files, set rootDir.
packages/esroute/tsconfig-check.json, packages/esroute-lit/tsconfig-check.json Deleted typecheck-only tsconfig files.
packages/esroute/src/nav-opts.ts Changed property assignment checks from !== undefined to != null in constructor.
packages/esroute/src/router.ts Ensured history state methods receive null instead of undefined for state argument.
packages/esroute/src/router.spec.ts Adjusted tests for new state handling, changed microtask timing, added test for mapping navigation.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant GitHub
    participant GitHub Actions
    participant npm Registry

    Developer->>GitHub: Push to main / PR to main
    GitHub->>GitHub Actions: Trigger workflow (test-build or publish)
    alt On PR to main
        GitHub Actions->>GitHub: Checkout code
        GitHub Actions->>GitHub Actions: Install dependencies (npm)
        GitHub Actions->>GitHub Actions: Build project
        GitHub Actions->>GitHub Actions: Run tests
    else On push to main
        GitHub Actions->>GitHub: Checkout code
        GitHub Actions->>GitHub Actions: Check package versions
        alt If version changed
            GitHub Actions->>npm Registry: Publish updated package(s)
        end
    end
Loading

Poem

🐇
Out with the Yarn, in with npm’s might,
CircleCI hops away, GitHub Actions in sight.
TypeScript configs are neat and clean,
Ignore files trimmed, no build debris seen.
The router now handles null with care—
A modern warren, swift and fair!
—Rabbit, your code is ready to share.

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 10a551d and 97c7bdd.

📒 Files selected for processing (7)
  • .circleci/config.yml (0 hunks)
  • .github/workflows/publish.yaml (1 hunks)
  • .github/workflows/test-build.yaml (1 hunks)
  • packages/esroute-lit/package.json (1 hunks)
  • packages/esroute/package.json (1 hunks)
  • packages/esroute/src/nav-opts.ts (1 hunks)
  • packages/esroute/src/router.spec.ts (5 hunks)
💤 Files with no reviewable changes (1)
  • .circleci/config.yml
🚧 Files skipped from review as they are similar to previous changes (6)
  • .github/workflows/test-build.yaml
  • packages/esroute-lit/package.json
  • packages/esroute/src/nav-opts.ts
  • packages/esroute/package.json
  • .github/workflows/publish.yaml
  • packages/esroute/src/router.spec.ts

🪧 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 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 (4)
.github/workflows/test-build.yaml (1)

1-15: Functional GitHub Actions workflow for CI, but could be improved

The workflow correctly handles the basics of testing and building the project. However, consider these enhancements for better performance and reliability:

  1. Specify the Node.js version explicitly for consistency
  2. Add caching for node_modules to speed up subsequent runs
name: Test and Build

on:
  pull_request:
    branches:
      - main
jobs:
  test:
    name: Run all tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
+     - uses: actions/setup-node@v4
+       with:
+         node-version: '18'
+         cache: 'npm'
      - run: npm install
      - run: npm run build
      - run: npm run test
packages/esroute-lit/package.json (1)

6-9: Standardize repository metadata.
The updates to license, author, repository, and homepage look accurate. For improved npm compatibility and clarity, consider switching the repository field to an object format:

- "repository": "github:sv2dev/esroute",
+ "repository": {
+   "type": "git",
+   "url": "git+https://github.com/sv2dev/esroute.git"
+ },

And you may want to point homepage to the repo root or README:

- "homepage": "https://github.com/sv2dev/esroute/tree/main/packages/esroute-lit",
+ "homepage": "https://github.com/sv2dev/esroute#readme",

This makes it clearer for users and tooling.

.github/workflows/publish.yaml (2)

15-18: Optional: Use full Git history for robust comparisons.
Currently, actions/checkout is using fetch-depth: 2 (which covers only HEAD and HEAD^). To avoid potential issues with shallow clones, consider:

-      - uses: actions/checkout@v4
-        with:
-          fetch-depth: 2
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: 0  # Fetch full history for accurate diffs

This provides greater reliability when checking version changes.


1-6: Nitpick: Add manual and scheduled triggers.
The workflow currently runs only on pushes to main. You could enhance flexibility by supporting manual runs (workflow_dispatch) and a scheduled cron:

on:
  push:
    branches: [ main ]
  workflow_dispatch:
  schedule:
    - cron: '0 0 1 * *'  # monthly

This allows ad-hoc and periodic publishes as needed.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fff2063 and 10a551d.

⛔ Files ignored due to path filters (188)
  • .yarn/cache/@esbuild-darwin-arm64-npm-0.20.2-e287d70c91-8.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@isaacs-cliui-npm-8.0.2-f4364666d5-4a473b9b32.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@jest-schemas-npm-29.6.3-292730e442-910040425f.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@jridgewell-sourcemap-codec-npm-1.4.15-a055fb62cf-b881c7e503.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@lit-labs-ssr-dom-shim-npm-1.2.0-6bda8c35cb-704621c28d.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@lit-reactive-element-npm-2.0.4-4836436301-368d788d9e.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@npmcli-agent-npm-2.2.2-e2f559d6c0-67de7b88cc.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@npmcli-fs-npm-3.1.0-0844a57978-a50a6818de.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@pkgjs-parseargs-npm-0.11.0-cd2a3fe948-6ad6a00fc4.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@rollup-rollup-darwin-arm64-npm-4.14.3-eca59280e9-8.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@sinclair-typebox-npm-0.27.8-23e206d653-00bd7362a3.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@types-estree-npm-1.0.5-5b7faed3b4-dd8b5bed28.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@types-trusted-types-npm-2.0.7-a07fc44f59-8e4202766a.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@vitest-expect-npm-1.5.0-aca2e6805c-a2a5659fbe.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@vitest-runner-npm-1.5.0-4ea8130b80-3680a9d4f1.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@vitest-snapshot-npm-1.5.0-807b642dba-fcf93d06c7.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@vitest-spy-npm-1.5.0-7e371e530c-518c847bb1.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@vitest-utils-npm-1.5.0-be84c568f7-07a59b62b4.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/abbrev-npm-2.0.0-0eb38a17e5-0e994ad2aa.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/acorn-npm-8.11.3-0d7ab48b38-76d8e7d559.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/acorn-walk-npm-8.3.2-df039a42bf-3626b9d26a.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/agent-base-npm-7.1.1-c9e1a4b59e-51c158769c.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/aggregate-error-npm-3.1.0-415a406f4e-1101a33f21.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/ansi-regex-npm-5.0.1-c963a48615-2aa4bb54ca.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/ansi-regex-npm-6.0.1-8d663a607d-1ff8b7667c.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/ansi-styles-npm-4.3.0-245c7d42c7-513b44c3b2.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/ansi-styles-npm-5.2.0-72fc7003e3-d7f4e97ce0.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/ansi-styles-npm-6.2.1-d43647018c-ef940f2f0c.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/assertion-error-npm-1.1.0-66b893015e-fd9429d3a3.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/balanced-match-npm-1.0.2-a53c126459-9706c088a2.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/brace-expansion-npm-2.0.1-17aa2616f9-a61e7cd2e8.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/cac-npm-6.7.14-c46284e425-45a2496a94.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/cacache-npm-18.0.2-d6329a1b9d-0250df80e1.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/chai-npm-4.4.1-ffd006b4b1-9ab84f36eb.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/check-error-npm-1.0.3-137994eabc-e2131025cf.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/chownr-npm-2.0.0-638f1c9c61-c57cf9dd07.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/clean-stack-npm-2.2.0-a8ce435a5c-2ac8cd2b2f.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/color-convert-npm-2.0.1-79730e935b-79e6bdb9fd.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/color-name-npm-1.1.4-025792b0ea-b044585952.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/cross-spawn-npm-7.0.3-e4ff3e65b3-671cc7c728.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/css.escape-npm-1.5.1-b24d2ba77a-f6d38088d8.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/deep-eql-npm-4.1.3-020a64f862-7f6d30cb41.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/diff-sequences-npm-29.6.3-18ab2c9949-f4914158e1.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/eastasianwidth-npm-0.2.0-c37eb16bd1-7d00d7cd8e.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/emoji-regex-npm-8.0.0-213764015c-d4c5c39d5a.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/emoji-regex-npm-9.2.2-e6fac8d058-8487182da7.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/encoding-npm-0.1.13-82a1837d30-bb98632f8f.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/env-paths-npm-2.2.1-7c7577428c-65b5df55a8.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/err-code-npm-2.0.3-082e0ff9a7-8b7b1be20d.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/esbuild-npm-0.20.2-1923187a7f-bc88050fc1.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/estree-walker-npm-3.0.3-0372979673-a65728d572.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/execa-npm-8.0.1-0211bd404c-cac1bf8658.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/exponential-backoff-npm-3.1.1-04df458b30-3d21519a4f.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/foreground-child-npm-3.1.1-77e78ed774-139d270bc8.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/fs-minipass-npm-2.1.0-501ef87306-1b8d128dae.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/fs-minipass-npm-3.0.3-d148d6ac19-8722a41109.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/fsevents-npm-2.3.3-ce9fb0ffae-11e6ea6fea.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/fsevents-patch-7934e3c202-8.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/get-func-name-npm-2.0.2-409dbe3703-3f62f4c236.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/get-stream-npm-8.0.1-c921b4840e-01e3d3cf29.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/glob-npm-10.3.12-f2e90133a0-2b0949d636.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-ac85f94da9.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/happy-dom-npm-8.9.0-da8dfa876b-2a9d853199.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/he-npm-1.2.0-3b73a2ff07-3d4d6babcc.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/http-cache-semantics-npm-4.1.1-1120131375-83ac0bc60b.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/http-proxy-agent-npm-7.0.2-643ed7cc33-670858c8f8.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/https-proxy-agent-npm-7.0.4-a51e13f5dc-daaab857a9.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/human-signals-npm-5.0.0-ed25a9f58c-6504560d5e.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/iconv-lite-npm-0.6.3-24b8aae27e-3f60d47a5c.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/imurmurhash-npm-0.1.4-610c5068a0-7cae75c8cd.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/indent-string-npm-4.0.0-7b717435b2-824cfb9929.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/ip-address-npm-9.0.5-9fa024d42a-aa15f12cfd.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/is-fullwidth-code-point-npm-3.0.0-1ecf4ebee5-44a30c2945.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/is-lambda-npm-1.0.1-7ab55bc8a8-93a32f0194.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/is-stream-npm-3.0.0-a77ac9a62e-172093fe99.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/isexe-npm-2.0.0-b58870bd2e-26bf6c5480.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/isexe-npm-3.1.1-9c0061eead-7fe1931ee4.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/jackspeak-npm-2.3.6-42e1233172-57d43ad11e.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/js-tokens-npm-9.0.0-35a2868eaf-427d0db681.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/jsbn-npm-1.1.0-1da0181838-944f924f2b.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/jsonc-parser-npm-3.2.1-776f636a18-656d9027b9.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/lit-element-npm-4.0.5-4f984c8a4f-c6dac74ea4.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/lit-html-npm-3.1.3-f1b10aa915-b079d78586.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/lit-npm-3.1.3-fa38fcf7cd-17b33c2e6a.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/local-pkg-npm-0.5.0-c126c7ec8b-b0a6931e58.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/loupe-npm-2.3.7-f294c2ef33-96c058ec71.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/lru-cache-npm-10.2.0-b9f6b44740-eee7ddda4a.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/lru-cache-npm-6.0.0-b4c8668fe1-f97f499f89.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/magic-string-npm-0.30.9-0b1be34daa-a97b9a706b.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/make-fetch-happen-npm-13.0.0-f87a92bb87-7c7a6d381c.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/merge-stream-npm-2.0.0-2ac83efea5-6fa4dcc8d8.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/mimic-fn-npm-4.0.0-feaeda79f7-995dcece15.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/minimatch-npm-9.0.4-7be5a33efc-cf717f597e.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/minipass-collect-npm-2.0.1-73d3907e40-b251bceea6.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/minipass-fetch-npm-3.0.4-200ac7c66d-af7aad15d5.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/minipass-flush-npm-1.0.5-efe79d9826-56269a0b22.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/minipass-npm-3.3.6-b8d93a945b-a30d083c80.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/minipass-npm-5.0.0-c64fb63c92-425dab2887.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/minipass-npm-7.0.4-eacb4e042e-87585e258b.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/minipass-pipeline-npm-1.2.4-5924cb077f-b14240dac0.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/minipass-sized-npm-1.0.3-306d86f432-79076749fc.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/minizlib-npm-2.1.2-ea89cd0cfb-f1fdeac0b0.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/mkdirp-npm-1.0.4-37f6ef56b9-a96865108c.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/mlly-npm-1.6.1-947df259c8-c40a547dba.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/ms-npm-2.1.2-ec0c1512ff-673cdb2c31.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/nanoid-npm-3.3.7-98824ba130-d36c427e53.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/negotiator-npm-0.6.3-9d50e36171-b8ffeb1e26.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/node-fetch-npm-2.7.0-587d57004e-d76d2f5edb.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/node-gyp-npm-10.1.0-bdea7d2ece-72e2ab4b23.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/nopt-npm-7.2.0-dd734b678d-a9c0f57fb8.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/npm-run-path-npm-5.3.0-193efca236-ae8e7a89da.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/onetime-npm-6.0.0-4f3684e29a-0846ce78e4.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/p-limit-npm-5.0.0-cc102b17d7-87bf5837de.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/p-map-npm-4.0.0-4677ae07c7-cb0ab21ec0.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/path-key-npm-3.1.1-0e66ea8321-55cd7a9dd4.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/path-key-npm-4.0.0-2bce99f089-8e6c314ae6.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/path-scurry-npm-1.10.2-676482c764-6739b4290f.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/pathe-npm-1.1.2-b80d94db55-ec5f778d97.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/pathval-npm-1.1.1-ce0311d7e0-090e314771.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/picocolors-npm-1.0.0-d81e0b1927-a2e8092dd8.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/pkg-types-npm-1.0.3-dce22a705c-4b305c834b.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/postcss-npm-8.4.38-495621b279-649f9e60a7.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/pretty-format-npm-29.7.0-7d330b2ea2-032c160238.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/proc-log-npm-3.0.0-a8c21c2f0f-02b64e1b39.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/promise-retry-npm-2.0.1-871f0b01b7-f96a3f6d90.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/react-is-npm-18.2.0-0cc5edb910-e72d0ba81b.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/regenerator-runtime-npm-0.14.1-a6c97c609a-9f57c93277.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/retry-npm-0.12.0-72ac7fb4cc-623bd7d2e5.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/rollup-npm-4.14.3-28fe395e65-f5077037e8.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/safer-buffer-npm-2.1.2-8d5c0b705e-cab8f25ae6.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/semver-npm-7.6.0-f4630729f6-7427f05b70.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/shebang-command-npm-2.0.0-eb2b01921d-6b52fe8727.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/shebang-regex-npm-3.0.0-899a0cd65e-1a2bcae50d.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/siginfo-npm-2.0.0-9bbac931f8-8aa5a98640.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/signal-exit-npm-4.1.0-61fb957687-64c757b498.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/smart-buffer-npm-4.2.0-5ac3f668bb-b5167a7142.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/socks-npm-2.8.3-3532b59899-7a6b7f6eed.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/socks-proxy-agent-npm-8.0.3-30471cff1b-8fab38821c.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/source-map-js-npm-1.2.0-6e63f357e5-791a43306d.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/sprintf-js-npm-1.1.3-b99efd75b2-a3fdac7b49.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/ssri-npm-10.0.5-1a7557d04d-0a31b65f21.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/stackback-npm-0.0.2-73273dc92e-2d4dc4e64e.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/std-env-npm-3.7.0-5261c3c3c3-4f489d13ff.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/string-width-npm-4.2.3-2c27177bae-e52c10dc3f.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/string-width-npm-5.1.2-bf60531341-7369deaa29.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/strip-ansi-npm-6.0.1-caddc7cb40-f3cd25890a.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/strip-ansi-npm-7.1.0-7453b80b79-859c73fcf2.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/strip-final-newline-npm-3.0.0-7972cbec8b-23ee263adf.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/strip-literal-npm-2.1.0-3503c34c5f-37c2072634.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/tar-npm-6.2.1-237800bb20-f1322768c9.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/tinybench-npm-2.7.0-5fed377a2b-3a5061fa71.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/tinypool-npm-0.8.4-043dfecb16-d40c40e062.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/tinyspy-npm-2.2.1-1079b8de54-170d6232e8.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/tr46-npm-0.0.3-de53018915-726321c5ea.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/type-detect-npm-4.0.8-8d8127b901-62b5628bff.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/typescript-npm-5.4.5-8568a42232-53c879c6fa.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/typescript-patch-1ee941d5bd-2373c693f3.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/ufo-npm-1.5.3-8c9d710312-2f54fa543b.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/unique-filename-npm-3.0.0-77d68e0a45-8e2f59b356.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/unique-slug-npm-4.0.0-e6b08f28aa-0884b58365.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/vite-node-npm-1.5.0-231bd83051-7313d1f616.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/vite-npm-5.2.9-69707cedc5-7a97f9547a.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/vitest-npm-1.5.0-9d3c1fee8a-566d81639e.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/webidl-conversions-npm-3.0.1-60310f6a2b-c92a0a6ab9.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/webidl-conversions-npm-7.0.0-e8c8e30c68-f05588567a.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/whatwg-encoding-npm-2.0.0-d7451f51b4-7087810c41.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/whatwg-mimetype-npm-3.0.0-5b617710c1-ce08bbb36b.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/whatwg-url-npm-5.0.0-374fb45e60-b8daed4ad3.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/which-npm-2.0.2-320ddf72f7-1a5c563d3c.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/which-npm-4.0.0-dd31cd4928-f17e84c042.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/why-is-node-running-npm-2.2.2-881f898bf3-50820428f6.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/wrap-ansi-npm-7.0.0-ad6e1a0554-a790b846fd.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/wrap-ansi-npm-8.1.0-26a4e6ae28-371733296d.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/yallist-npm-4.0.0-b493d9e907-343617202a.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/yocto-queue-npm-1.0.0-7b502f1987-2cac84540f.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs is excluded by !**/.yarn/**
  • .yarn/releases/yarn-3.2.0.cjs is excluded by !**/.yarn/**
  • .yarn/sdks/integrations.yml is excluded by !**/.yarn/**
  • .yarn/sdks/typescript/bin/tsc is excluded by !**/.yarn/**
  • .yarn/sdks/typescript/bin/tsserver is excluded by !**/.yarn/**
  • .yarn/sdks/typescript/lib/tsc.js is excluded by !**/.yarn/**
  • .yarn/sdks/typescript/lib/tsserver.js is excluded by !**/.yarn/**
  • .yarn/sdks/typescript/lib/tsserverlibrary.js is excluded by !**/.yarn/**
  • .yarn/sdks/typescript/lib/typescript.js is excluded by !**/.yarn/**
  • .yarn/sdks/typescript/package.json is excluded by !**/.yarn/**
  • package-lock.json is excluded by !**/package-lock.json
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (18)
  • .circleci/config.yml (0 hunks)
  • .github/workflows/publish.yaml (1 hunks)
  • .github/workflows/test-build.yaml (1 hunks)
  • .gitignore (1 hunks)
  • .yarnrc.yml (0 hunks)
  • package.json (1 hunks)
  • packages/esroute-lit/.npmignore (1 hunks)
  • packages/esroute-lit/package.json (1 hunks)
  • packages/esroute-lit/tsconfig-check.json (0 hunks)
  • packages/esroute-lit/tsconfig.json (1 hunks)
  • packages/esroute/.npmignore (1 hunks)
  • packages/esroute/package.json (1 hunks)
  • packages/esroute/src/nav-opts.ts (1 hunks)
  • packages/esroute/src/router.spec.ts (5 hunks)
  • packages/esroute/src/router.ts (1 hunks)
  • packages/esroute/tsconfig-check.json (0 hunks)
  • packages/esroute/tsconfig.json (1 hunks)
  • tsconfig.json (1 hunks)
💤 Files with no reviewable changes (4)
  • packages/esroute-lit/tsconfig-check.json
  • .yarnrc.yml
  • packages/esroute/tsconfig-check.json
  • .circleci/config.yml
🧰 Additional context used
🧬 Code Graph Analysis (2)
packages/esroute/src/router.spec.ts (1)
packages/esroute/src/route-resolver.ts (1)
  • resolve (19-44)
packages/esroute/src/router.ts (1)
packages/esroute/src/nav-opts.ts (1)
  • href (68-75)
🔇 Additional comments (24)
.gitignore (1)

5-5: Good addition for TypeScript incremental builds

Adding *.tsbuildinfo to the ignore list is appropriate when using TypeScript with incremental compilation. These files contain cache information to speed up subsequent builds and shouldn't be committed to version control.

package.json (4)

4-6: Good metadata additions

Adding the private, license, and author fields improves the package metadata and follows npm best practices.


8-10: Successfully migrated from Yarn to npm workspace commands

The script commands have been properly updated from Yarn workspace syntax to npm workspace syntax.


13-17: Updated test dependencies

The dependency updates look good, including the addition of coverage support and version upgrades.


22-24: Added Volta configuration

Using Volta for Node.js version management is a good practice to ensure consistent development environments across the team.

Note: Node.js 22.14.0 is very recent. Make sure all team members can use this version.

packages/esroute-lit/.npmignore (1)

3-5: Improved npm package optimization

Good additions to exclude unnecessary files from the published npm package:

  • Source maps aren't needed in production and increase package size
  • Test files shouldn't be included in the published package
  • TypeScript build info files are only needed for development

These changes will result in a cleaner, more optimized package for consumers.

packages/esroute/.npmignore (1)

3-6: Improved npm package optimization

Good additions to exclude unnecessary files from the published npm package:

  • Source maps aren't needed in production
  • Test files shouldn't be included in the published package
  • The demo directory is for development purposes only
  • TypeScript build info files are only needed for development

These changes will result in a cleaner, more optimized package for consumers.

packages/esroute/src/nav-opts.ts (1)

60-64: Improved handling of nullish values in NavOpts constructor

The changes from !== undefined to != null mean these properties will only be assigned when their values are neither null nor undefined, which aligns with the router's updated state handling mentioned in the summary.

This change makes the behavior more consistent across the codebase, but note that it's a subtle change that affects how the library treats null navigation options.

packages/esroute/tsconfig.json (1)

4-9: Improved TypeScript configuration for better project structure

The changes to the TypeScript configuration are well-structured and follow best practices:

  1. The composite: true flag enables project references for improved incremental builds
  2. Setting rootDir explicitly ensures proper output structure
  3. Using include/exclude patterns instead of explicitly listing files improves maintainability

These changes align with modern TypeScript project organization and will make the build process more efficient.

packages/esroute/package.json (4)

3-3: Version bump appropriate for the implemented changes

The minor version increase (0.9.1 to 0.10.0) correctly reflects the behavior changes in how nullish values are handled in the Nav class.


7-10: Added proper package metadata

The added license, author, repository, and homepage fields follow npm package standards and improve package documentation.


11-14: Simplified build process

The build scripts have been streamlined to use TypeScript's built-in build command (tsc -b), which aligns with the composite project configuration.

This simplification makes the build process more maintainable and leverages TypeScript's incremental compilation features.


19-21: Reduced development dependencies

Removing unnecessary dependencies like esbuild and vite while keeping only TypeScript aligns with the simplified build approach. This makes the package lighter and easier to maintain.

tsconfig.json (1)

3-11: TypeScript configuration modernized for better compatibility and development experience.

The changes to the TypeScript configuration align with modern best practices:

  • Switching to "bundler" for moduleResolution is appropriate for ESM-based projects
  • Adding "moduleDetection": "force" ensures consistent module behavior for all .ts files
  • Including source maps and declaration maps improves debugging capabilities
  • The configuration is more streamlined by removing unnecessary options

These changes appear to be part of the broader migration from Yarn to npm mentioned in the PR summary.

packages/esroute/src/router.ts (1)

184-185: Bug fix: Ensuring consistent History API behavior by normalizing undefined states to null.

This change fixes the issue mentioned in the PR title "fix search overridden by href" by ensuring that null is always passed to the History API when state is undefined. This is important because:

  1. The Web History API spec expects the state parameter to be serializable
  2. Some browsers treat undefined differently than null when passed to the History API
  3. This ensures consistent cross-browser behavior

Previously, if state was undefined, it would be directly passed to history.pushState/replaceState, which could cause inconsistent behavior across browsers.

packages/esroute-lit/tsconfig.json (2)

4-6: Improved TypeScript project configuration for better build performance.

The addition of "composite": true enables incremental builds, which can significantly improve compilation speed for large projects. Setting an explicit rootDir also provides clearer project structure.


8-10: Enhanced TypeScript project structure with proper references and file management.

This configuration:

  1. Uses include/exclude patterns instead of listing individual files
  2. Properly excludes test files from production builds
  3. Establishes a proper build dependency on the esroute package through project references

This approach is more maintainable and aligns with TypeScript best practices for monorepo setups.

packages/esroute/src/router.spec.ts (4)

3-3: Minor import order change without functional impact.

The import order was changed but doesn't affect functionality.


27-27: Improved timer mechanism for asynchronous test flow.

Replacing new Promise(setImmediate) with setTimeout improves cross-environment compatibility, as setImmediate is not available in all JavaScript environments.

Also applies to: 46-46


59-59: Test assertions updated to match implementation changes.

These assertions have been updated to expect null instead of undefined for the state parameter, aligning with the fix in the router implementation that passes state ?? null to the History API.

Also applies to: 65-65, 71-71, 81-83


86-91: New test case for mapping function behavior.

This new test verifies that when using a mapping function for navigation targets, the router properly:

  1. Replaces the state by default (using history.replaceState)
  2. Passes null as the state parameter
  3. Preserves the path while updating the search parameters

This is an important test case that ensures the router behaves correctly when modifying only parts of the current navigation state.

packages/esroute-lit/package.json (3)

3-3: Bump package version to match release cycle.
Version has been updated to 0.10.0. Ensure that CI workflows and other dependent packages are in sync with this new version.


11-13: Streamline build and publish scripts.
Replacing the multi-step build process with tsc -b and adding a prepublishOnly script is a solid simplification that leverages TypeScript project references correctly.


23-23: Update dependency version.
Bumping "esroute": "^0.10.0" aligns with the package version. Confirm there are no breaking changes in esroute@0.10.0 that affect this package.

@sv2dev sv2dev force-pushed the 16-fix-search-overridden-by-href branch from 10a551d to 97c7bdd Compare April 17, 2025 14:33
@sv2dev sv2dev merged commit dbf55a7 into main Apr 17, 2025
2 checks passed
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.

Fix search overridden by href

2 participants