Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename the Project #57

Merged
merged 4 commits into from
Jul 25, 2024
Merged

Rename the Project #57

merged 4 commits into from
Jul 25, 2024

Conversation

widoz
Copy link
Member

@widoz widoz commented Jul 20, 2024

Summary by CodeRabbit

  • New Features

    • Rebranding of the project from "Wp Entities Search" to "Kensaku" across the platform.
    • Namespace changes from EntitiesSearch to Kensaku, enhancing clarity and consistency.
    • Updated documentation to reflect new branding and ensure accuracy.
  • Bug Fixes

    • Resolved issues in component references and imports related to the new naming conventions.
  • Documentation

    • Comprehensive updates to README, API docs, and other documentation files to reflect the rebranding.
  • Chores

    • Adjusted configuration files for consistency with the new project name.

Copy link

coderabbitai bot commented Jul 20, 2024

Walkthrough

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.

Changes

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.

Sequence Diagram(s)

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
Loading

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3a5a51a and f444c95.

Files ignored due to path filters (5)
  • tests/client/integration/components/__snapshots__/preset-posts-types.markup.test.tsx.snap is excluded by !**/*.snap
  • tests/client/unit/components/__snapshots__/plural-select-control.test.tsx.snap is excluded by !**/*.snap
  • tests/client/unit/components/__snapshots__/radio-control.test.tsx.snap is excluded by !**/*.snap
  • tests/client/unit/components/__snapshots__/search-control.test.tsx.snap is excluded by !**/*.snap
  • tests/client/unit/components/__snapshots__/toggle-control.test.tsx.snap is excluded by !**/*.snap
Files selected for processing (57)
  • .eslintrc.js (1 hunks)
  • .wp-env.json (1 hunks)
  • @types/index.d.ts (6 hunks)
  • README.md (2 hunks)
  • composer.json (1 hunks)
  • docs/_config.yml (1 hunks)
  • docs/api.md (4 hunks)
  • docs/components.md (5 hunks)
  • docs/control-option.md (3 hunks)
  • docs/development.md (1 hunks)
  • docs/hooks.md (3 hunks)
  • docs/installation.md (1 hunks)
  • docs/logging.md (1 hunks)
  • docs/readme.md (1 hunks)
  • package.json (1 hunks)
  • phpcs.xml (1 hunks)
  • plugin.php (3 hunks)
  • sources/client/src/api/create-search-entities-options.ts (2 hunks)
  • sources/client/src/api/search-entities-options.ts (2 hunks)
  • sources/client/src/api/search-entities.ts (4 hunks)
  • sources/client/src/components/composite-entities-by-kind.tsx (6 hunks)
  • sources/client/src/components/no-options-message.tsx (1 hunks)
  • sources/client/src/components/plural-select-control.tsx (3 hunks)
  • sources/client/src/components/preset-entities-by-kind.tsx (6 hunks)
  • sources/client/src/components/radio-control.tsx (3 hunks)
  • sources/client/src/components/search-control.tsx (3 hunks)
  • sources/client/src/components/singular-select-control.tsx (3 hunks)
  • sources/client/src/components/toggle-control.tsx (4 hunks)
  • sources/client/src/hooks/use-entities-options-storage.ts (4 hunks)
  • sources/client/src/hooks/use-entity-records.ts (2 hunks)
  • sources/client/src/hooks/use-query-viewable-post-types.ts (2 hunks)
  • sources/client/src/hooks/use-query-viewable-taxonomies.ts (2 hunks)
  • sources/client/src/hooks/use-search.ts (4 hunks)
  • sources/client/src/logging/index.ts (3 hunks)
  • sources/client/src/models/immutable-record.ts (1 hunks)
  • sources/client/src/storage/entities/initial-state.ts (1 hunks)
  • sources/client/src/storage/entities/reducer.ts (3 hunks)
  • sources/client/src/utils/convert-entities-to-control-options.ts (2 hunks)
  • sources/client/src/utils/is-control-option.ts (1 hunks)
  • sources/client/src/utils/order-selected-options-at-the-top.ts (1 hunks)
  • sources/client/src/utils/unique-control-options.ts (2 hunks)
  • sources/client/src/value-objects/control-option.ts (1 hunks)
  • sources/server/src/Library.php (1 hunks)
  • sources/server/src/Modules/BlockEditor/Module.php (2 hunks)
  • sources/server/src/Modules/E2e/Module.php (2 hunks)
  • sources/server/src/Modules/E2e/resources/js/post-types-example-block/block.json (1 hunks)
  • sources/server/src/Modules/E2e/resources/js/post-types-example-block/index.js (2 hunks)
  • sources/server/src/Modules/E2e/resources/js/taxonomies-example-block/block.json (1 hunks)
  • sources/server/src/Modules/E2e/resources/js/taxonomies-example-block/index.js (2 hunks)
  • sources/server/src/Modules/Logging/Module.php (2 hunks)
  • tests/client/integration/components/composite-entities-by-kind.test.tsx (19 hunks)
  • tests/client/integration/components/preset-posts-types.markup.test.tsx (3 hunks)
  • tests/client/unit/api/search-entities.test.ts (3 hunks)
  • tests/client/unit/api/search-posts.test.ts (2 hunks)
  • tests/client/unit/components/plural-select-control.test.tsx (5 hunks)
  • tests/client/unit/components/preset-posts-types.test.tsx (3 hunks)
  • tests/client/unit/components/radio-control.test.tsx (2 hunks)
Files not processed due to max files limit (13)
  • tests/client/unit/components/singular-select-control.test.tsx
  • tests/client/unit/components/toggle-control.test.tsx
  • tests/client/unit/hooks/use-entities-options-storage.test.tsx
  • tests/client/unit/hooks/use-entity-records.test.ts
  • tests/client/unit/hooks/use-query-viewable-post-types.test.ts
  • tests/client/unit/hooks/use-query-viewable-taxonomies.test.ts
  • tests/client/unit/hooks/use-search.test.ts
  • tests/client/unit/storage/reducer.test.ts
  • tests/client/unit/utils.ts
  • tests/client/unit/utils/convert-entities-to-control-options.test.ts
  • tests/client/unit/utils/ordered-selected-options-at-the-top.test.ts
  • tests/client/unit/utils/unique-control-options.test.ts
  • webpack.config.js
Files skipped from review due to trivial changes (4)
  • package.json
  • sources/client/src/components/no-options-message.tsx
  • sources/server/src/Modules/E2e/resources/js/taxonomies-example-block/block.json
  • tests/client/integration/components/preset-posts-types.markup.test.tsx
Files skipped from review as they are similar to previous changes (39)
  • .eslintrc.js
  • .wp-env.json
  • @types/index.d.ts
  • README.md
  • composer.json
  • docs/_config.yml
  • docs/components.md
  • docs/hooks.md
  • docs/installation.md
  • docs/readme.md
  • phpcs.xml
  • sources/client/src/api/search-entities-options.ts
  • sources/client/src/api/search-entities.ts
  • sources/client/src/components/composite-entities-by-kind.tsx
  • sources/client/src/components/plural-select-control.tsx
  • sources/client/src/components/preset-entities-by-kind.tsx
  • sources/client/src/components/radio-control.tsx
  • sources/client/src/components/search-control.tsx
  • sources/client/src/components/singular-select-control.tsx
  • sources/client/src/components/toggle-control.tsx
  • sources/client/src/hooks/use-entity-records.ts
  • sources/client/src/hooks/use-query-viewable-post-types.ts
  • sources/client/src/hooks/use-query-viewable-taxonomies.ts
  • sources/client/src/hooks/use-search.ts
  • sources/client/src/logging/index.ts
  • sources/client/src/models/immutable-record.ts
  • sources/client/src/storage/entities/reducer.ts
  • sources/client/src/utils/convert-entities-to-control-options.ts
  • sources/client/src/utils/is-control-option.ts
  • sources/server/src/Library.php
  • sources/server/src/Modules/BlockEditor/Module.php
  • sources/server/src/Modules/E2e/Module.php
  • sources/server/src/Modules/E2e/resources/js/post-types-example-block/block.json
  • sources/server/src/Modules/E2e/resources/js/post-types-example-block/index.js
  • sources/server/src/Modules/E2e/resources/js/taxonomies-example-block/index.js
  • sources/server/src/Modules/Logging/Module.php
  • tests/client/unit/api/search-entities.test.ts
  • tests/client/unit/api/search-posts.test.ts
  • tests/client/unit/components/plural-select-control.test.tsx
Additional context used
Biome
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)

Markdownlint
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)

LanguageTool
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)

Additional comments not posted (47)
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.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/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:

#!/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: 3329


12-12: Verify the class implementation.

Ensure that the ControlOption class correctly implements Kensaku.EnrichedControlOption. Verify that all methods and properties are correctly defined.

Verification 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.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/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:

#!/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: 2819


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.

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

#!/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:

#!/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:

#!/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:

#!/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:

#!/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: 4325

sources/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
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/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: 1060


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.

Verification 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
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/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:

#!/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: 9491


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.

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

#!/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:

#!/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:

#!/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:

#!/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: 17818

docs/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:

#!/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:

#!/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:

#!/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:

#!/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: 134

Tools
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-71

tests/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<any>.


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<any>.


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<string>.


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<string, string>.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

@widoz
Copy link
Member Author

widoz commented Jul 20, 2024

@coderabbitai I've made some fixes regarding ESLint and Unit Tests.

Copy link

coderabbitai bot commented Jul 20, 2024

@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!

Analysis chain
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for changes in ESLint configuration files
git diff --name-only HEAD~1 HEAD | grep -E '(\.eslintrc|\.eslintignore|eslint-config|eslint)'

# Check for changes in unit test files
git diff --name-only HEAD~1 HEAD | grep -E '(\.test\.js|\.spec\.js|__tests__|test|spec)'

Length of output: 888

Actions performed

Comments resolved and changes approved.

@widoz
Copy link
Member Author

widoz commented Jul 20, 2024

@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

  • Php Namespaces are all changed and there are no issues
  • Strings are also correctly updated
  • Js modules are referring to the right directories and TS is update correctly with the new name
  • The react components do not break

Copy link

coderabbitai bot commented Jul 20, 2024

@widoz, I have verified the changes as requested:

  1. PHP Namespaces:

    • The namespaces have been updated to Kensaku in the PHP files, as seen in files like plugin.php and sources/server/src/Library.php.
  2. Strings:

    • Strings reflecting the old project name have been correctly updated to "Kensaku". This is evident in files like plugin.php and README.md.
  3. 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.
  4. 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 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.

Analysis chain

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for PHP namespace changes
rg --files-with-matches 'namespace WpEntitiesSearch' -g '*.php' -A 3

# Check for string updates from "Wp Entities Search" to "Kensaku"
rg --files-with-matches 'Wp Entities Search' -A 3

# Check for JS module updates and TypeScript updates
rg --files-with-matches 'WpEntitiesSearch' -g '*.{js,ts,tsx}' -A 3

# Check for React component updates
rg --files-with-matches 'WpEntitiesSearch' -g '*.tsx' -A 3

Length of output: 248


Script:

#!/bin/bash
# Check for PHP namespace changes
rg 'namespace WpEntitiesSearch' -g '*.php' -A 5

# Check for string updates from "Wp Entities Search" to "Kensaku"
rg 'Wp Entities Search' -A 5

# Check for JS module updates and TypeScript updates
rg 'WpEntitiesSearch' -g '*.{js,ts,tsx}' -A 5

# Check for React component updates
rg 'WpEntitiesSearch' -g '*.tsx' -A 5

Length of output: 164


Script:

#!/bin/bash
# Check for PHP namespace changes to "Kensaku"
rg 'namespace Kensaku' -g '*.php' -A 5

# Check for string updates to "Kensaku"
rg 'Kensaku' -A 5

# Check for JS module updates and TypeScript updates to "Kensaku"
rg 'Kensaku' -g '*.{js,ts,tsx}' -A 5

# Check for React component updates to "Kensaku"
rg 'Kensaku' -g '*.tsx' -A 5

Length of output: 173687

Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@widoz
Copy link
Member Author

widoz commented Jul 20, 2024

@widoz, I have verified the changes as requested:

  1. PHP Namespaces:

    • The namespaces have been updated to Kensaku in the PHP files, as seen in files like plugin.php and sources/server/src/Library.php.
  2. Strings:

    • Strings reflecting the old project name have been correctly updated to "Kensaku". This is evident in files like plugin.php and README.md.
  3. 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.
  4. 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 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.

Analysis chain
Scripts executed
Actions performed

@coderabbitai Yes, I want to be sure I've not missed any text replacement, for instance

  • "WP Entities Search" to "Kensaku"
  • "wp-entities-search" to "kensaku"
  • "wpEntitiesSearch" to "kensaku"

Also ensuring there are no "WP Kensaku" or "wp-kensaku" or "wpKensaku" where it is not appropiate.

Copy link

coderabbitai bot commented Jul 20, 2024

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:

  1. Replacements Verified:

    • "WP Entities Search" has been correctly replaced with "Kensaku".
    • "wp-entities-search" has been correctly replaced with "kensaku".
    • "wpEntitiesSearch" has been correctly replaced with "kensaku".
  2. No Inappropriate Replacements:

    • There are no instances of "WP Kensaku".
    • There are no instances of "wp-kensaku".
    • There are no instances of "wpKensaku".

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

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for instances of "WP Entities Search" that should be replaced with "Kensaku"
rg 'WP Entities Search' -A 3

# Check for instances of "wp-entities-search" that should be replaced with "kensaku"
rg 'wp-entities-search' -A 3

# Check for instances of "wpEntitiesSearch" that should be replaced with "kensaku"
rg 'wpEntitiesSearch' -A 3

# Ensure there are no inappropriate replacements like "WP Kensaku"
rg 'WP Kensaku' -A 3

# Ensure there are no inappropriate replacements like "wp-kensaku"
rg 'wp-kensaku' -A 3

# Ensure there are no inappropriate replacements like "wpKensaku"
rg 'wpKensaku' -A 3

Length of output: 150


Script:

#!/bin/bash
# Check for instances of "WP Entities Search" that should be replaced with "Kensaku"
rg 'WP Entities Search' -A 5

# Check for instances of "wp-entities-search" that should be replaced with "kensaku"
rg 'wp-entities-search' -A 5

# Check for instances of "wpEntitiesSearch" that should be replaced with "kensaku"
rg 'wpEntitiesSearch' -A 5

# Ensure there are no inappropriate replacements like "WP Kensaku"
rg 'WP Kensaku' -A 5

# Ensure there are no inappropriate replacements like "wp-kensaku"
rg 'wp-kensaku' -A 5

# Ensure there are no inappropriate replacements like "wpKensaku"
rg 'wpKensaku' -A 5

Length of output: 150


Script:

#!/bin/bash
# Check for instances of "Kensaku" to confirm the replacements
rg 'Kensaku' -A 5

Length of output: 76724


If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!

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

Outside diff range, codebase verification and nitpick comments (3)
sources/client/src/utils/unique-control-options.ts (1)

Line range hint 9-9:
Avoid shadowing the global Set property.

Consider renaming the imported Set to avoid confusion with the global Set property.

- import { Set } from '../models/set';
+ import { Set as CustomSet } from '../models/set';
sources/client/src/components/radio-control.tsx (2)

60-60: Class name update verification failed.

The CSS styles for the class kensaku-radio-control-item are not defined in the codebase. Please ensure that the corresponding styles are added to maintain consistent styling.

  • kensaku-radio-control-item class usage found in: sources/client/src/components/radio-control.tsx
Analysis chain

Class name update.

The class name has been updated to kensaku-radio-control-item. Ensure that the corresponding CSS styles are correctly defined.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the CSS styles for `kensaku-radio-control-item` are correctly defined.

# Test: Search for the CSS styles. Expect: The styles are found.
rg --type css 'kensaku-radio-control-item'

Length of output: 191


Script:

#!/bin/bash
# Description: Verify that the CSS styles for `kensaku-radio-control-item` are correctly defined.

# Test: Search for the CSS styles in all files to ensure they are found.
rg 'kensaku-radio-control-item' --debug

Length of output: 4210


Script:

#!/bin/bash
# Description: Verify that the CSS styles for `kensaku-radio-control-item` are correctly defined in various file types.

# Test: Search for the CSS styles in CSS, SCSS, LESS, JS, and TS files to ensure they are found.
rg 'kensaku-radio-control-item' --type-add 'scss:*.scss' --type-add 'less:*.less' --type-add 'js:*.js' --type-add 'ts:*.ts'

Length of output: 256


24-24: Missing CSS styles for kensaku-radio-control.

The class name kensaku-radio-control has been added, but there are no corresponding CSS styles defined for this class or related classes (kensaku-radio-control-item). This could lead to potential UI issues.

  • sources/client/src/components/radio-control.tsx:
    • kensaku-radio-control
    • kensaku-radio-control-item

Please ensure that the necessary CSS styles are defined for these classes.

Analysis chain

Class name update.

The class name has been updated to kensaku-radio-control. Ensure that the corresponding CSS styles are correctly defined.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the CSS styles for `kensaku-radio-control` are correctly defined.

# Test: Search for the CSS styles. Expect: The styles are found.
rg --type css 'kensaku-radio-control'

Length of output: 186


Script:

#!/bin/bash
# Description: Verify that the CSS styles for `kensaku-radio-control` are correctly defined.

# Test: Search for the CSS styles with debug information to understand why files are being skipped.
rg --type css 'kensaku-radio-control' --debug

Length of output: 22897


Script:

#!/bin/bash
# Description: Verify that the CSS styles for `kensaku-radio-control` are correctly defined.

# Test: Search for the CSS styles without ignoring any files and include all file types.
rg 'kensaku-radio-control' --no-ignore

Length of output: 408


Script:

#!/bin/bash
# Description: Verify that the CSS styles for `kensaku-radio-control` and related classes are correctly defined.

# Test: Search for the CSS styles in CSS, SCSS, and LESS files.
rg 'kensaku-radio-control' --type-add 'scss:*.scss' --type-add 'less:*.less' --type css --type scss --type less

Length of output: 260


Script:

#!/bin/bash
# Description: Verify that the CSS styles for `kensaku-radio-control` and related classes are correctly defined.

# Test: Search for the CSS styles across all file types without any filters.
rg 'kensaku-radio-control' --no-ignore --hidden

Length of output: 417

docs/logging.md Show resolved Hide resolved
docs/hooks.md Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Guido Scialfa <[email protected]>
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

Outside diff range, codebase verification and nitpick comments (1)
sources/client/src/storage/entities/initial-state.ts (1)

9-9: Avoid shadowing the global Set property.

Consider renaming the imported Set to avoid confusion with the global Set property.

- import { Set } from '../../models/set';
+ import { Set as CustomSet } from '../../models/set';
Tools
Biome

[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)

@widoz widoz merged commit 721cd87 into main Jul 25, 2024
4 checks passed
@widoz widoz deleted the refactor/rename-the-project branch July 25, 2024 17:45
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.

1 participant