Skip to content

Commit

Permalink
Add wp- prefix to the project
Browse files Browse the repository at this point in the history
Signed-off-by: guido <dev@guidoscialfa.com>
  • Loading branch information
widoz committed Jan 20, 2024
1 parent 090374d commit ee3a1fd
Show file tree
Hide file tree
Showing 17 changed files with 60 additions and 41 deletions.
18 changes: 17 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,21 @@
"group": "Default"
}
],
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"sqltools.connections": [
{
"mysqlOptions": {
"authProtocol": "default",
"enableSsl": "Disabled"
},
"previewLimit": 50,
"server": "0.0.0.0",
"port": 52693,
"driver": "MariaDB",
"name": "WordPress",
"database": "wordpress",
"username": "root",
"password": "password"
}
]
}
2 changes: 1 addition & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"development": {
"phpVersion": "8.0",
"mappings": {
"wp-content/plugins/entities-search": "."
"wp-content/plugins/wp-entities-search": "."
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "widoz/entities-search",
"name": "widoz/wp-entities-search",
"description": "A WordPress package to search Entities including Rest API Endpoints and React Components",
"type": "library",
"license": "GPL-v2-or-later",
"version": "1.0.0",
"autoload": {
"psr-4": {
"Widoz\\EntitiesSearch\\": "sources/server/src/"
"Widoz\\Wp\\EntitiesSearch\\": "sources/server/src/"
}
},
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "entities-search",
"name": "wp-entities-search",
"version": "1.0.0",
"description": "A WordPress package to search Entities including Rest API Endpoints and React Components",
"author": "guido scialfa <dev@guidoscialfa.com>",
Expand Down
1 change: 1 addition & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<arg name="colors"/>
<arg name="extensions" value="php,inc"/>

<config name="text_domain" value="wp-entities-search"/>
<config name="testVersion" value="8.0-"/>
<config name="ignore_warnings_on_exit" value="1"/>

Expand Down
8 changes: 5 additions & 3 deletions plugin.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<?php

/**
* Plugin Name: Entities Search
* Plugin Name: Wp Entities Search
* Author: Guido Scialfa
* Description: The WordPress plugin to develop the Wp Search Entities library.
* Author URI: https://guidoscialfa.com/
*/

declare(strict_types=1);

use Inpsyde\Modularity;
use Widoz\EntitiesSearch;
use Widoz\Wp\EntitiesSearch;

function package(): Modularity\Package
{
Expand Down Expand Up @@ -36,6 +38,6 @@ function autoload(string $projectRoot): void
\add_action(
'plugins_loaded',
fn() => package()
->addModule(Widoz\EntitiesSearch\Modules\E2e\Module::new())
->addModule(EntitiesSearch\Modules\E2e\Module::new())
->boot()
);
4 changes: 2 additions & 2 deletions sources/client/src/components/no-options-message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { __ } from '@wordpress/i18n';

export function NoOptionsMessage(): JSX.Element {
return (
<p className="wz-entities-search-no-option-message">
{__('No options', 'wz-entities-search')}
<p className="wp-entities-search-no-option-message">
{__('No options', 'wp-entities-search')}
</p>
);
}
2 changes: 1 addition & 1 deletion sources/client/src/components/search-control.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function SearchControl(
return (
<Container>
<label htmlFor={props.id}>
{__('Search', 'wz-entities-search')}
{__('Search', 'wp-entities-search')}
<input id={props.id} {...inputProps} />
</label>
</Container>
Expand Down
2 changes: 1 addition & 1 deletion sources/server/src/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Widoz\EntitiesSearch;
namespace Widoz\Wp\EntitiesSearch;

use Inpsyde\Modularity;

Expand Down
4 changes: 2 additions & 2 deletions sources/server/src/Modules/BlockEditor/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Widoz\EntitiesSearch\Modules\BlockEditor;
namespace Widoz\Wp\EntitiesSearch\Modules\BlockEditor;

use Inpsyde\Modularity;
use Psr\Container;
Expand Down Expand Up @@ -38,7 +38,7 @@ public function run(Container\ContainerInterface $container): bool
$version = $properties->isDebug() ? $asset['version'] : $properties->version();

\wp_register_script(
'widoz-entities-search',
'wp-entities-search',
"{$baseUrl}/build/main.js",
$asset['dependencies'],
$version,
Expand Down
10 changes: 5 additions & 5 deletions sources/server/src/Modules/E2e/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Widoz\EntitiesSearch\Modules\E2e;
namespace Widoz\Wp\EntitiesSearch\Modules\E2e;

use Inpsyde\Modularity;
use Psr\Container;
Expand Down Expand Up @@ -89,17 +89,17 @@ private static function postTypesExample(Modularity\Properties\Properties $prope
);

\wp_register_script(
'widoz-entities-search-e2e-post-types-example-block',
'wp-entities-search-e2e-post-types-example-block',
"{$baseUrl}/sources/server/src/Modules/E2e/resources/js/post-types-example-block/index.js",
['widoz-entities-search', 'immutable'],
['wp-entities-search', 'immutable'],
'0.0.0',
true,
);

\wp_register_script(
'widoz-entities-search-e2e-taxonomies-example-block',
'wp-entities-search-e2e-taxonomies-example-block',
"{$baseUrl}/sources/server/src/Modules/E2e/resources/js/taxonomies-example-block/index.js",
['widoz-entities-search', 'immutable'],
['wp-entities-search', 'immutable'],
'0.0.0',
true,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"apiVersion": 3,
"title": "Post Types Example Block",
"name": "widoz-entities-search/post-types-example-block",
"category": "uncategorized",
"icon": "wordpress",
"editorScript": "widoz-entities-search-e2e-post-types-example-block",
"attributes": {
"apiVersion": 3,
"title": "Post Types Example Block",
"name": "wp-entities-search/post-types-example-block",
"category": "uncategorized",
"icon": "wordpress",
"editorScript": "wp-entities-search-e2e-post-types-example-block",
"attributes": {
"postType": {
"type": "array",
"default": ["post"]
Expand All @@ -14,5 +14,5 @@
"type": "array",
"default": []
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
document.addEventListener('DOMContentLoaded', () => {
const UNSUPPORTED_CPTS = ['attachment'];

const { wp, entitiesSearch, Immutable } = window;
const { wp, wpEntitiesSearch, Immutable } = window;

const { createElement } = wp.element;
const { registerBlockType } = wp.blocks;
Expand All @@ -16,18 +16,18 @@ document.addEventListener('DOMContentLoaded', () => {
CompositeEntitiesByKind,
useQueryViewablePostTypes,
convertEntitiesToControlOptions,
} = entitiesSearch;
} = wpEntitiesSearch;

// TODO Check why the object form does not work.
registerBlockType('widoz-entities-search/post-types-example-block', {
registerBlockType('wp-entities-search/post-types-example-block', {
apiVersion: 2,
title: 'Post Types Example Block',
category: 'uncategorized',
icon: 'wordpress',
editorScript: 'widoz-entities-search-e2e-post-types-example-block',
editorScript: 'wp-entities-search-e2e-post-types-example-block',
edit: function Edit(props) {
const blockProps = useBlockProps({
className: 'widoz-entities-search-e2e-post-types-example-block',
className: 'wp-entities-search-e2e-post-types-example-block',
});

const postTypesEntities = useQueryViewablePostTypes();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"apiVersion": 3,
"title": "Taxonomies Example Block",
"name": "widoz-entities-search/taxonomies-example-block",
"name": "wp-entities-search/taxonomies-example-block",
"category": "uncategorized",
"icon": "wordpress",
"editorScript": "widoz-entities-search-e2e-taxonomies-example-block",
"editorScript": "wp-entities-search-e2e-taxonomies-example-block",
"attributes": {
"taxonomy": {
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
document.addEventListener('DOMContentLoaded', () => {
const { wp, entitiesSearch, Immutable } = window;
const { wp, wpEntitiesSearch, Immutable } = window;

const { createElement } = wp.element;
const { registerBlockType } = wp.blocks;
Expand All @@ -14,18 +14,18 @@ document.addEventListener('DOMContentLoaded', () => {
CompositeEntitiesByKind,
useQueryViewableTaxonomies,
convertEntitiesToControlOptions,
} = entitiesSearch;
} = wpEntitiesSearch;

// TODO Check why the object form does not work.
registerBlockType('widoz-entities-search/taxonomies-example-block', {
registerBlockType('wp-entities-search/taxonomies-example-block', {
apiVersion: 2,
title: 'Taxonomies Example Block',
category: 'uncategorized',
icon: 'wordpress',
editorScript: 'widoz-entities-search-e2e-taxonomies-example-block',
editorScript: 'wp-entities-search-e2e-taxonomies-example-block',
edit: function Edit(props) {
const blockProps = useBlockProps({
className: 'widoz-entities-search-e2e-taxonomies-example-block',
className: 'wp-entities-search-e2e-taxonomies-example-block',
});

const taxonomiesEntities = useQueryViewableTaxonomies();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ exports[`EntitiesToggleControl renders correctly 1`] = `

exports[`EntitiesToggleControl renders the NoOptionsMessage when there are no options 1`] = `
<p
class="wz-entities-search-no-option-message"
class="wp-entities-search-no-option-message"
>
No options
</p>
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = {
output: {
...baseConfiguration.output,
library: {
name: 'entitiesSearch',
name: 'wpEntitiesSearch',
type: 'window',
},
},
Expand Down

0 comments on commit ee3a1fd

Please sign in to comment.