Conversation
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
|
|
||
| if (characterName.endsWith(", First>")) { | ||
| rangeStart = codePoint; | ||
| rangeName = characterName.replace(", First>", "").replace("<", ""); |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 19 days ago
In general, to avoid incomplete escaping or cleaning when using String.prototype.replace, use a global regular expression (/.../g) or another method that processes all occurrences (e.g., split/join) instead of passing a plain string, which only affects the first occurrence.
Here, the goal is to normalize rangeName by stripping the trailing ", First>" marker and removing all < characters from the remaining name. The current code:
if (characterName.endsWith(", First>")) {
rangeStart = codePoint;
rangeName = characterName.replace(", First>", "").replace("<", "");
continue;
}only removes the first <. The most direct, non-functional-change fix is to change the second .replace to use a global regular expression:
rangeName = characterName.replace(", First>", "").replace(/</g, "");This preserves the existing behavior for typical inputs (with a single <), but correctly handles any unexpected extra < characters. No new imports or helpers are needed, and the change is localized to line 48 in packages/pipelines/pipeline-presets/src/parsers/unicode-data.ts.
| @@ -45,7 +45,7 @@ | ||
|
|
||
| if (characterName.endsWith(", First>")) { | ||
| rangeStart = codePoint; | ||
| rangeName = characterName.replace(", First>", "").replace("<", ""); | ||
| rangeName = characterName.replace(", First>", "").replace(/</g, ""); | ||
| continue; | ||
| } | ||
|
|
🌏 Preview Deployments
Built from commit: 🤖 This comment will be updated automatically when you push new commits to this PR. |
9bc07f8 to
1f887f7
Compare
908f584 to
e3a429c
Compare
- Created `README.md` for documentation. - Added `package.json` with dependencies and scripts. - Configured TypeScript with `tsconfig.json` and `tsconfig.build.json`. - Set up `tsdown` for building the package. - Updated `pnpm-lock.yaml` to include new package dependencies. - Modified `pnpm-workspace.yaml` to include all packages under `packages/**`.
- Introduced `standard.ts` for parsing standard Unicode data. - Added `unicode-data.ts` for parsing detailed Unicode character metadata. - Created pipelines for basic, emoji, and full Unicode data processing. - Implemented resolvers for grouped and property JSON outputs. - Added various transforms including deduplication, range expansion, and filtering. - Established HTTP and memory sources for data retrieval. - Configured TypeScript settings for building and testing.
Modified the `build` and `dev` script filters in `package.json` to use double asterisks (`**`) for better matching of package directories.
Updated `@luxass/eslint-config` from version `7.0.0-beta.1` to `7.0.0-beta.2` for improved linting rules. Added `tinyglobby` package at version `0.2.15` to enhance globbing capabilities in the project.
- Updated `definePipeline` to use `Omit` for better type safety. - Adjusted type inference tests to validate expected types. - Added `definePipelineRoute` to the playground example for improved routing functionality.
- Introduced `vitest-testdirs` in `package.json` for improved testing capabilities. - Added comprehensive tests for pipeline file handling in `loader.test.ts`.
Refactor `findPipelineFiles` to accept an options object for improved flexibility. Update related function calls throughout the codebase to use the new structure.
- Refactored `pipeline-detail`, `pipeline-graph`, and `pipeline-sidebar` components to use new color schemes and styles. - Added search functionality to `PipelineSidebar` for improved user experience. - Enhanced `usePipelines` and `useExecute` hooks to support search queries. - Introduced global CSS styles for consistent theming across the application. - Updated types in `types.ts` to reflect changes in pipeline structure and execution results. BREAKING CHANGE: The structure of the `PipelineDetails` and `ExecuteResult` types has been modified to include new fields.
…pelineEventInput type
- Introduced `InlineJsonView`, `LogDetailPanel`, and `SimpleTimeline` components for enhanced log visualization. - Implemented `ViewModeToggle` for switching between JSON and compact views. - Created `useLogView` hook to manage log view state and actions. - Updated `PipelineLogsPage` to integrate new components and improve user experience.
e88e6c6 to
be30171
Compare
…e `catalog:build`
Introduce `PipelineCommandPalette`, `PipelineSidebarContextMenu`, and `VersionPickerDialog` components to enhance user interaction with pipelines. Implement keyboard shortcuts for opening the command palette and streamline pipeline execution and navigation.
…mponent and improve context menu interactivity
- Added detailed JSDoc comments for `definePipelineTransform` and `applyTransforms` functions to improve documentation. - Refactored type inference for transform definitions to ensure better type safety. - Updated tests to validate type parameters and ensure correct behavior of transform functions.
…r functionality - Updated `package.json` to include `oxc-transform` as a dependency. - Enhanced `loader.ts` with new functions for loading pipelines from content and finding remote pipeline files. - Expanded type exports in `index.ts` to include new options for remote sources.
Added new exports for `pipeline-sidebar-errors`, `pipeline-sidebar-header`, `pipeline-sidebar-item`, and `pipeline-sidebar-list` in the `package.json`. Updated hooks exports to include `useCommandPalette`, `useExecute`, `usePipeline`, and `usePipelines`. Introduced `@icons-pack/react-simple-icons` and `lucide-react` as dependencies in `pnpm-lock.yaml` and `pnpm-workspace.yaml`.
| useEffect(() => { | ||
| if (highlightRoute && codeRef.current) { | ||
| // Find the route definition in the code and scroll to it | ||
| const routePattern = new RegExp(`route\\s*:\s*["\']${highlightRoute}["\']`, "i"); |
Check failure
Code scanning / CodeQL
Useless regular-expression character escape High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 1 day ago
In general, when building a regular expression via a string (including template literals), any regex escape like \s, \d, \w, etc., must be written with a double backslash (\\s, \\d, \\w) so that the JavaScript string literal produces a single backslash for the regex engine. Here, the pattern is intended to match something like route : "some/path" with optional whitespace around the colon. Currently it uses \s* in a template string, which evaluates to s*, so the regular expression does not match whitespace as intended.
The best minimal fix that preserves existing functionality is to escape the backslash before s, changing \s* to \\s* inside the template literal. We only adjust the whitespace sequences and leave all other parts of the pattern as-is. Specifically, in packages/pipelines/pipeline-server/src/client/routes/pipelines.$id.code.tsx at line 51, update the RegExp construction to:
const routePattern = new RegExp(`route\\s*:\\s*["']${highlightRoute}["']`, "i");This change requires no new imports or helpers; it simply corrects the escape sequence in the existing string.
| @@ -48,7 +48,7 @@ | ||
| useEffect(() => { | ||
| if (highlightRoute && codeRef.current) { | ||
| // Find the route definition in the code and scroll to it | ||
| const routePattern = new RegExp(`route\\s*:\s*["\']${highlightRoute}["\']`, "i"); | ||
| const routePattern = new RegExp(`route\\s*:\\s*["\']${highlightRoute}["\']`, "i"); | ||
| const match = code.match(routePattern); | ||
| if (match) { | ||
| const lines = code.substring(0, match.index).split("\n"); |
🔗 Linked issue
📚 Description