Closed widoz closed 1 month ago
The project underwent a significant rebranding from "Wp Entities Search" to "Kensaku." This change affected various files, including configuration, documentation, and source code, updating references, namespaces, and identifiers to reflect the new name. The updates aimed to maintain consistency throughout the codebase and documentation, ensuring that all instances of the previous name were replaced, which impacts both the frontend and backend components of the application.
Files | Change Summary |
---|---|
.eslintrc.js , .wp-env.json , composer.json , phpcs.xml , plugin.php |
Updated configurations to change from wp-entities-search to kensaku , reflecting the new project name in ESLint rules, environment settings, Composer package, and PHP CodeSniffer. |
@types/index.d.ts , sources/... , tests/... |
Refactored type definitions and component implementations to replace EntitiesSearch with Kensaku , ensuring all relevant types are consistently updated. |
README.md , docs/... , docs/api.md |
Comprehensive documentation updates, including project name changes, URLs, and links, to align with the new branding. |
sources/server/src/Modules/... , sources/server/src/Library.php |
Namespace adjustments in module files and main library file, transitioning from SpaghettiDojo\Wp\EntitiesSearch to SpaghettiDojo\Kensaku . |
sources/server/src/Modules/E2e/... , block.json |
Updated identifiers and script registrations in block-related files to reflect the new namespace, ensuring compatibility with the rebranded structure. |
sources/client/src/components/... , sources/client/src/hooks/... |
Component and hook implementations were modified to use the new Kensaku namespace and types, ensuring functionality remains consistent with the new naming conventions. |
sequenceDiagram
participant User
participant Frontend
participant Backend
User->>Frontend: Initiate search
Frontend->>Backend: Call searchEntities with query
Backend-->>Frontend: Return search results
Frontend-->>User: Display results
sources/client/src/storage/entities/initial-state.ts
[error] 9-9: Do not shadow the global "Set" property. Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global. (lint/suspicious/noShadowRestrictedNames)sources/client/src/utils/order-selected-options-at-the-top.ts
[error] 9-9: Do not shadow the global "Set" property. Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global. (lint/suspicious/noShadowRestrictedNames)
docs/logging.md
21-21: Column: 1 Hard tabs (MD010, no-hard-tabs) --- 22-22: Column: 1 Hard tabs (MD010, no-hard-tabs)docs/development.md
12-12: null Dollar signs used before commands without showing output (MD014, commands-show-output) --- 13-13: null Dollar signs used before commands without showing output (MD014, commands-show-output)
docs/api.md
[uncategorized] ~19-~19: Possible missing comma found. Context: ...d internally. The idea is to follow the Tell don't Ask principle and let the consume... (AI_HYDRA_LEO_MISSING_COMMA)
sources/client/src/api/create-search-entities-options.ts (3)
`4-4`: **LGTM! Ensure the new import is correctly referenced.** The import statement has been correctly updated to `Kensaku`. --- `15-16`: **LGTM! Ensure the new types are correctly referenced.** The types for `postTypes` and `queryArguments` have been correctly updated to use `Kensaku` types. --- `17-17`: **LGTM! Ensure the new return type is correctly referenced.** The return type has been correctly updated to use `Kensaku` types.sources/client/src/utils/unique-control-options.ts (3)
`4-4`: **LGTM! Ensure the new import is correctly referenced.** The import statement has been correctly updated to `Kensaku`. --- `13-14`: **LGTM! Ensure the new type is correctly referenced.** The type for the `set` parameter has been correctly updated to use `Kensaku` types. --- `15-15`: **LGTM! Ensure the new type is correctly referenced.** The type for the `uniqueOptions` variable has been correctly updated to use `Kensaku` types.sources/client/src/storage/entities/initial-state.ts (3)
`4-4`: **LGTM! Ensure the new import is correctly referenced.** The import statement has been correctly updated to `Kensaku`. --- `11-11`: **LGTM! Ensure the new type alias is correctly referenced.** The type alias `Options` has been correctly updated to use `Kensaku` types. --- `18-19`: **LGTM! Ensure the new types are correctly referenced.** The types for the `initialState` parameter and the return type have been correctly updated to use `Kensaku` types.sources/client/src/value-objects/control-option.ts (3)
`15-20`: **Verify the property and constructor updates.** Ensure that the `extra` property and its corresponding constructor parameter are correctly updated to use `Kensaku.Record`. Verify that the default value assignment is correct.Verification successful
--- **Verified the property and constructor updates.** The `extra` property and its corresponding constructor parameter are correctly updated to use `Kensaku.Record`. The default value assignment with `ImmutableRecord` is valid and consistent. - `Kensaku.Record` is correctly imported from `@types`. - `ImmutableRecord` is correctly imported from `../models/immutable-record` and implements `Kensaku.Record`.--- `12-12`: **Verify the class implementation.** Ensure that the `ControlOption` class correctly implements `Kensaku.EnrichedControlOption`. Verify that all methods and properties are correctly defined.Scripts executed
The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Verify the property and constructor updates for `ControlOption`. # Test: Search for the property and constructor updates. Expect: Correct usage of `Kensaku.Record`. rg --type ts -A 10 $'public readonly extra: Kensaku.Record< unknown >' ``` Length of output: 884 --- Script: ```shell #!/bin/bash # Verify the definition and import of `Kensaku.Record` and `ImmutableRecord`. # Search for the import statements in the file rg --type ts 'import' sources/client/src/value-objects/control-option.ts # Search for the definition of `Kensaku.Record` in the codebase rg --type ts 'Record' | rg 'Kensaku' # Search for the definition of `ImmutableRecord` in the codebase rg --type ts 'ImmutableRecord' ``` Length of output: 3329Verification successful
--- **Verified: The `ControlOption` class correctly implements the `Kensaku.EnrichedControlOption` interface.** - The class defines all required properties (`label`, `value`, and `extra`) and initializes them in the constructor. - The `extra` property is marked as `readonly`, which aligns with the interface definition.--- `4-4`: **Verify the correctness of the import statement.** Ensure that the `Kensaku` module is correctly imported from `@types`. Verify that there are no missing dependencies.Scripts executed
The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Verify the class implementation for `ControlOption`. # Test: Search for the class implementation. Expect: Correct implementation of `Kensaku.EnrichedControlOption`. rg --type ts -A 10 $'export class ControlOption< V > implements Kensaku.EnrichedControlOption< V >' ``` Length of output: 976 --- Script: ```shell #!/bin/bash # Retrieve the complete implementation of the ControlOption class rg --type ts -A 50 'export class ControlOption< V > implements Kensaku.EnrichedControlOption< V >' # Retrieve the definition of the Kensaku.EnrichedControlOption interface rg --type ts 'interface EnrichedControlOption' --context 10 ``` Length of output: 2819Verification successful
**Verify the existence and correctness of the `@types` module.** Ensure that the `@types` module is correctly defined and available in the codebase to validate the import statement. --- **Verify the existence and correctness of the `@types` module.** Ensure that the `@types` module is correctly defined and available in the codebase to validate the import statement. --- **Verify the TypeScript configuration for the `@types` module.** Ensure that the TypeScript configuration files correctly reference the `@types` module to validate the import statement. --- **Verify the definition of the `Kensaku` module in `@types/index.d.ts`.** Ensure that the `@types/index.d.ts` file correctly defines the `Kensaku` module to validate the import statement. --- **The import statement is correct.** The `Kensaku` module is correctly defined in the `@types/index.d.ts` file, validating the import statement `import Kensaku from '@types';`. - `@types/index.d.ts`: Contains the declaration of the `Kensaku` module.Scripts executed
The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Verify the import statement for `Kensaku`. # Test: Search for the import statement. Expect: Correct import path. rg --type ts -A 5 $'import Kensaku from \'@types\';' ``` Length of output: 17724 --- Script: ```shell #!/bin/bash # Description: Verify the existence and correctness of the `@types` module. # Test: Search for the definition or declaration of the `@types` module. rg --type ts -A 5 'declare module \'@types\'' ``` Length of output: 93 --- Script: ```shell #!/bin/bash # Description: Verify the existence and correctness of the `@types` module. # Test: Search for the definition or declaration of the `@types` module. rg --type ts -A 5 "declare module '@types'" ``` Length of output: 51 --- Script: ```shell #!/bin/bash # Description: Verify the TypeScript configuration for the `@types` module. # Test: Search for TypeScript configuration files and inspect their contents for references to `@types`. rg --files | grep 'tsconfig.json' | xargs cat ``` Length of output: 1045 --- Script: ```shell #!/bin/bash # Description: Verify the definition of the `Kensaku` module in `@types/index.d.ts`. # Test: Inspect the contents of `@types/index.d.ts` to ensure it defines the `Kensaku` module. rg --files | grep '@types/index.d.ts' | xargs cat ``` Length of output: 4325sources/client/src/utils/order-selected-options-at-the-top.ts (3)
`22-23`: **Verify the internal variable updates.** Ensure that the internal variables `_collection` and `_options` are correctly updated to use `Kensaku.ControlOption`. Verify that the logic for managing these variables remains intact.Verification successful
--- **Verified the internal variable updates.** The internal variables `_collection` and `_options` are correctly updated to use `Kensaku.ControlOption`. The logic for managing these variables remains intact. - sources/client/src/utils/order-selected-options-at-the-top.ts--- `12-14`: **Verify the function signature.** Ensure that the `orderSelectedOptionsAtTheTop` function signature is correctly updated to use `Kensaku.ControlOption`. Verify that all parameters and return types are correctly defined.Scripts executed
The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Verify the internal variable updates for `orderSelectedOptionsAtTheTop`. # Test: Search for the internal variable updates. Expect: Correct usage of `Kensaku.ControlOption`. rg --type ts -A 10 $'let _collection = new Set< Kensaku.ControlOption< V > >()' ``` Length of output: 1060Verification successful
**Verify the definition and usage of `Kensaku.ControlOption`.** Ensure that `Kensaku.ControlOption` is correctly defined and used within the codebase to confirm the correctness of the function signature. --- **The function signature is correctly updated.** The function `orderSelectedOptionsAtTheTop` correctly uses `Kensaku.ControlOption` for its parameters and return type. The usage is consistent with the rest of the codebase. - `sources/client/src/utils/order-selected-options-at-the-top.ts`--- `4-4`: **Verify the correctness of the import statement.** Ensure that the `Kensaku` module is correctly imported from `@types`. Verify that there are no missing dependencies.Scripts executed
The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Verify the function signature for `orderSelectedOptionsAtTheTop`. # Test: Search for the function signature. Expect: Correct usage of `Kensaku.ControlOption`. rg --type ts -A 10 $'export function orderSelectedOptionsAtTheTop< V >' ``` Length of output: 1061 --- Script: ```shell #!/bin/bash # Description: Verify the definition and usage of `Kensaku.ControlOption`. # Test: Search for the definition of `Kensaku.ControlOption`. rg --type ts 'ControlOption' | grep 'Kensaku' # Test: Search for the usage of `Kensaku.ControlOption`. rg --type ts 'Kensaku.ControlOption' ``` Length of output: 9491Verification successful
**Verify the correctness of the `Kensaku` import from `@types`.** Ensure that the `@types` module is correctly defined and that `Kensaku` is properly declared within it. Verify that there are no missing dependencies. --- **The import statement is correct.** The `Kensaku` type is properly defined in `@types/index.d.ts` and is used extensively throughout the codebase. The import statement `import Kensaku from '@types';` is valid and correct. - `@types/index.d.ts`: `export default Kensaku;`Scripts executed
The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Verify the import statement for `Kensaku`. # Test: Search for the import statement. Expect: Correct import path. rg --type ts -A 5 $'import Kensaku from \'@types\';' ``` Length of output: 17724 --- Script: ```shell #!/bin/bash # Description: Verify the definition of `Kensaku` within the `@types` module. # Search for the definition of `Kensaku` in the `@types` module. rg --type ts -A 5 'declare module \'@types\' {' ``` Length of output: 93 --- Script: ```shell #!/bin/bash # Description: Verify the definition of `Kensaku` within the `@types` module. # Search for the definition of `Kensaku` in the `@types` module. rg --type ts -A 5 "declare module '@types' {" ``` Length of output: 167 --- Script: ```shell #!/bin/bash # Description: Verify the definition of `Kensaku` within the `@types` module. # Search for the definition of `Kensaku` in the `@types` module. rg --type ts "Kensaku" ``` Length of output: 17818docs/logging.md (1)
`21-22`: **Verify the logging action updates.** Ensure that the logging actions are correctly updated to use `kensaku`. Verify that there are no remaining references to `wp-entities-search`.Verification successful
--- **Verification successful.** The logging actions have been correctly updated to use `kensaku`, and there are no remaining references to `wp-entities-search`. - `docs/logging.md`: Correct usage of `kensaku.on-change-entities.error`.Scripts executed
The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Verify the logging action updates in `docs/logging.md`. # Test: Search for the logging action updates. Expect: Correct usage of `kensaku`. rg --type md -A 5 $'addAction(\n\t\'kensaku.on-change-entities.error\'' ``` Length of output: 342 --- Script: ```shell #!/bin/bash # Description: Verify the logging action updates in `docs/logging.md`. # Test: Search for the logging action updates. Expect: Correct usage of `kensaku`. rg --type md -A 5 $'addAction(\n\t\'kensaku.on-change-entities.error\'' ``` Length of output: 342 --- Script: ```shell #!/bin/bash # Description: Verify the logging action updates in `docs/logging.md`. # Test: Search for the logging action updates. Expect: Correct usage of `kensaku`. rg --type md -A 5 "addAction\(\s*'kensaku.on-change-entities.error'" ``` Length of output: 76 --- Script: ```shell #!/bin/bash # Description: Verify the logging action updates in `docs/logging.md`. # Test: Search for the new logging action updates. Expect: Correct usage of `kensaku`. rg --type md "kensaku.on-change-entities.error" # Test: Search for any remaining old logging action references. Expect: No references to `wp-entities-search`. rg --type md "wp-entities-search" ``` Length of output: 134Tools
Markdownlint
21-21: Column: 1 Hard tabs (MD010, no-hard-tabs) --- 22-22: Column: 1 Hard tabs (MD010, no-hard-tabs)plugin.php (4)
`4-6`: **Metadata changes approved.** The plugin name and description have been correctly updated to reflect the new project name "Kensaku." --- `12-12`: **Namespace change approved.** The namespace has been correctly updated to `SpaghettiDojo\Kensaku`. --- `15-15`: **Reference change approved.** The reference to `EntitiesSearch\Library` has been correctly updated to `Kensaku\Library`. Also applies to: 36-36 --- `45-45`: **Reference change approved.** The reference to `EntitiesSearch\Modules\E2e\Module` has been correctly updated to `Kensaku\Modules\E2e\Module`.sources/client/src/hooks/use-entities-options-storage.ts (4)
`4-4`: **Import statement change approved.** The import statement has been correctly updated to import `Kensaku` from `@types`. --- `20-21`: **Type definition changes approved.** The type definitions have been correctly updated from `EntitiesSearch` to `Kensaku`. --- `30-33`: **Function signature change approved.** The function signature has been correctly updated to use `Kensaku` types. --- `66-66`: **Error handling logic change approved.** The error handling logic has been correctly updated to use the `kensaku.on-storage-initialization.error` action identifier.docs/development.md (1)
`12-13`: **Repository URL and directory name changes approved.** The repository URL and directory name have been correctly updated to reflect the new project name "Kensaku."Tools
Markdownlint
12-12: null Dollar signs used before commands without showing output (MD014, commands-show-output) --- 13-13: null Dollar signs used before commands without showing output (MD014, commands-show-output)tests/client/unit/components/preset-posts-types.test.tsx (3)
`5-5`: **LGTM! Import statement updated correctly.** The import statement has been updated to reflect the new project name. --- `34-34`: **LGTM! Type reference updated correctly.** The type reference for `entitiesFields` has been updated to reflect the new project name. --- `59-60`: **LGTM! Type references updated correctly.** The type references for `_kind` and `queryArguments` have been updated to reflect the new project name.docs/control-option.md (3)
`21-21`: **LGTM! Type reference updated correctly.** The type reference for the `extra` property has been updated to reflect the new project name. --- `30-30`: **LGTM! Type reference updated correctly.** The type reference for the `value` property has been updated to reflect the new project name. --- `68-68`: **LGTM! Type reference updated correctly.** The type reference for the `entities` parameter has been updated to reflect the new project name. Also applies to: 71-71tests/client/unit/components/radio-control.test.tsx (2)
`4-4`: **LGTM! Import statement updated correctly.** The import statement has been updated to reflect the new project name. --- `38-38`: **LGTM! Type reference updated correctly.** The type reference for the `options` property has been updated to reflect the new project name.docs/api.md (4)
`17-17`: **LGTM!** The type reference has been correctly updated to `Kensaku.QueryArguments`. --- `25-25`: **LGTM!** The type reference has been correctly updated to `Kensaku.SearchEntitiesFunction`. --- `51-51`: **LGTM!** The import statement has been correctly updated to `'kensaku'`. --- `80-80`: **LGTM!** The type reference has been correctly updated to `Kensaku.ControlOptions`.tests/client/integration/components/composite-entities-by-kind.test.tsx (10)
`4-4`: **LGTM!** The import statement has been correctly updated to `Kensaku`. --- `40-40`: **LGTM!** The type reference has been correctly updated to `Kensaku.ControlOption`. --- `70-70`: **LGTM!** The class name has been correctly updated to `.kensaku-select-control`. --- `97-97`: **LGTM!** The type reference has been correctly updated to `Kensaku.ControlOption `. --- `109-109`: **LGTM!** The class name has been correctly updated to `.kensaku-select-control`. --- `163-163`: **LGTM!** The class name has been correctly updated to `.kensaku-select-control--singular`. --- `166-166`: **LGTM!** The class name has been correctly updated to `.kensaku-select-control--plural`. --- `177-177`: **LGTM!** The type reference has been correctly updated to `Kensaku.ControlOption `. --- `308-308`: **LGTM!** The error identifier has been correctly updated to `kensaku.on-change-kind.error`. --- `322-322`: **LGTM!** The type reference has been correctly updated to `Kensaku.SearchEntitiesFunction `.
@coderabbitai I've made some fixes regarding ESLint and Unit Tests.
@widoz, I have reviewed the changes. It appears that you have made updates to several unit test files, including:
tests/client/integration/components/composite-entities-by-kind.test.tsx
tests/client/integration/components/preset-posts-types.markup.test.tsx
tests/client/unit/components/plural-select-control.test.tsx
tests/client/unit/components/singular-select-control.test.tsx
tests/client/unit/components/toggle-control.test.tsx
No changes were detected in ESLint configuration files. Thank you for the updates!
@coderabbitai The main scope of this PR is to change the name of the project from Wp Entities Search to Kensaku.
What we want to check are
@widoz, I have verified the changes as requested:
PHP Namespaces:
Kensaku
in the PHP files, as seen in files like plugin.php
and sources/server/src/Library.php
.Strings:
plugin.php
and README.md
.JS Modules and TypeScript Updates:
import Kensaku from '@types';
is consistently used across various files.React Components:
Kensaku
correctly, as seen in files like tests/client/integration/components/composite-entities-by-kind.test.tsx
.The changes appear to be comprehensive and correctly implemented. If there are any specific areas you would like me to re-check, please let me know.
@widoz, I have verified the changes as requested:
PHP Namespaces:
- The namespaces have been updated to
Kensaku
in the PHP files, as seen in files likeplugin.php
andsources/server/src/Library.php
.Strings:
- Strings reflecting the old project name have been correctly updated to "Kensaku". This is evident in files like
plugin.php
andREADME.md
.JS Modules and TypeScript Updates:
- JavaScript and TypeScript modules have been updated to refer to the new directory structure and name. For example,
import Kensaku from '@types';
is consistently used across various files.React Components:
- React components have been updated and should not break due to the name change. The components now import and use
Kensaku
correctly, as seen in files liketests/client/integration/components/composite-entities-by-kind.test.tsx
.The changes appear to be comprehensive and correctly implemented. If there are any specific areas you would like me to re-check, please let me know.
Analysis chain Scripts executed Actions performed
@coderabbitai Yes, I want to be sure I've not missed any text replacement, for instance
Also ensuring there are no "WP Kensaku" or "wp-kensaku" or "wpKensaku" where it is not appropiate.
[!TIP] For best results, initiate chat on the files or code changes.
@widoz, I have thoroughly checked the codebase for the specified patterns and confirmed the replacements:
Replacements Verified:
No Inappropriate Replacements:
The changes appear to be comprehensive and correctly implemented. If there are any specific areas you would like me to re-check, please let me know.
If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit!
Summary by CodeRabbit
New Features
EntitiesSearch
toKensaku
, enhancing clarity and consistency.Bug Fixes
Documentation
Chores