Skip to content

Commit 04d3ba1

Browse files
authored
Merge branch 'main' into typos
2 parents f4b551d + 167414d commit 04d3ba1

File tree

71 files changed

+13941
-17609
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+13941
-17609
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build Artifacts
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
if: ${{ !contains(github.event.head_commit.message, '--skip-assets-artifacts') }}
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
16+
- name: Setup Node
17+
uses: actions/setup-node@v2
18+
with:
19+
cache: 'yarn'
20+
node-version: '20'
21+
22+
- name: Install Dependencies
23+
run: yarn install
24+
25+
- name: Build Artifacts
26+
uses: widoz/github-artifacts-action@v1
27+
env:
28+
GIT_USER: ${{ secrets.GIT_USER }}
29+
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
30+
HUSKY: 0

.github/workflows/js-qa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
uses: actions/setup-node@v2
2727
with:
2828
cache: 'yarn'
29-
node-version: '16'
29+
node-version: '20'
3030

3131
- name: Install
3232
run: yarn install

.github/workflows/php-qa.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
if: "!contains(github.event.head_commit.message, '--skip ci') && !github.event.pull_request.draft"
1515
strategy:
1616
matrix:
17-
php-versions: [ '8.0' ]
17+
php-versions: [ '8.1', '8.2', '8.3' ]
1818
steps:
1919
- name: Checkout
2020
uses: actions/checkout@v3
@@ -28,7 +28,7 @@ jobs:
2828
run: find ./src/ ./tests/ -type f -name '*.php' -print0 | xargs -0 -L 1 -P 4 -- php -l
2929

3030
- name: Install dependencies
31-
uses: "ramsey/composer-install@v1"
31+
uses: ramsey/composer-install@v3
3232

3333
- name: Check code styles
3434
run: composer cs

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/.idea/
2+
/.vscode/
23
/build/
34
/coverage
45
/vendor/

.vscode/settings.json

Lines changed: 0 additions & 37 deletions
This file was deleted.

.wp-env.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"core": "./vendor/roots/wordpress-no-content",
3-
"plugins": ["."],
4-
"env": {
5-
"development": {
6-
"phpVersion": "8.0",
7-
"mappings": {
8-
"wp-content/plugins/wp-entities-search": "."
9-
}
10-
}
11-
},
12-
"config": {
13-
"WP_ENVIRONMENT_TYPE": "local"
14-
}
2+
"core": "./vendor/roots/wordpress-no-content",
3+
"plugins": ["."],
4+
"env": {
5+
"development": {
6+
"phpVersion": "8.1",
7+
"mappings": {
8+
"wp-content/plugins/wp-entities-search": "."
9+
}
10+
}
11+
},
12+
"config": {
13+
"WP_ENVIRONMENT_TYPE": "local"
14+
}
1515
}

.yarnrc.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

@types/index.d.ts

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ declare namespace EntitiesSearch {
1717
type Options<V> = Set<ControlOption<V>>;
1818
type Value = string | number;
1919

20-
interface QueryArguments<V>
20+
// TODO Can we convert QueryArguments to an Immutable Map?
21+
interface QueryArguments
2122
extends Partial<
2223
Readonly<{
23-
exclude: Set<V>;
24-
include: Set<V>;
24+
exclude: Set<string | number>;
25+
include: Set<string | number>;
2526
fields: EntitiesSearch.SearchQueryFields;
2627
[p: string]: unknown;
2728
}>
@@ -34,6 +35,8 @@ declare namespace EntitiesSearch {
3435
url: string;
3536
type: string;
3637
subtype: string;
38+
post_content: string;
39+
post_excerpt: string;
3740
}> {}
3841

3942
type SearchEntitiesFunction<E, K> = (
@@ -42,11 +45,6 @@ declare namespace EntitiesSearch {
4245
queryArguments?: EntitiesSearch.QueryArguments<E>
4346
) => Promise<Options<E>>;
4447

45-
type ControlOption<V extends any> = Readonly<{
46-
value: V;
47-
label: string;
48-
}>;
49-
5048
type SingularControl<V> = {
5149
[K in keyof BaseControl<V>]: K extends 'value'
5250
? V
@@ -55,6 +53,20 @@ declare namespace EntitiesSearch {
5553
: BaseControl<V>[K];
5654
};
5755

56+
interface Record<T> {
57+
get<F>(key: string, fallback?: F): T | F | undefined;
58+
set(key: string, value: T): Record<T>;
59+
}
60+
61+
interface ControlOption<V extends any> extends Readonly<{
62+
value: V;
63+
label: string;
64+
}> {}
65+
66+
interface EnrichedControlOption<V extends any> extends ControlOption<V>, Readonly<{
67+
readonly extra: Record<string, unknown>;
68+
}> {}
69+
5870
interface BaseControl<V>
5971
extends Readonly<{
6072
value: Set<V>;
@@ -90,6 +102,7 @@ declare namespace EntitiesSearch {
90102
/*
91103
* Api
92104
*/
105+
// TODO Better to convert the SearchQueryFields to a Set.
93106
type SearchQueryFields = ReadonlyArray<
94107
keyof EntitiesSearch.SearchEntityFields
95108
>;
@@ -104,7 +117,6 @@ declare namespace EntitiesSearch {
104117
> extends Readonly<{
105118
entities: Entities<E>;
106119
kind: Kind<K>;
107-
contextualEntitiesOptions: OptionSet;
108120
currentEntitiesOptions: OptionSet;
109121
selectedEntitiesOptions: OptionSet;
110122
searchPhrase: string;
@@ -126,13 +138,6 @@ declare namespace EntitiesSearch {
126138
K
127139
>['currentEntitiesOptions'];
128140
}
129-
| {
130-
type: 'UPDATE_CONTEXTUAL_ENTITIES_OPTIONS';
131-
contextualEntitiesOptions: EntitiesState<
132-
E,
133-
K
134-
>['contextualEntitiesOptions'];
135-
}
136141
| {
137142
type: 'UPDATE_SELECTED_ENTITIES_OPTIONS';
138143
selectedEntitiesOptions: EntitiesState<

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
# WordPress Entities Search
1+
# Wp Entities Search
2+
3+
> A WordPress package to search Entities including Rest API Endpoints and React Components
4+
5+
[![JS Quality Assurance](https://github.com/widoz/wp-entities-search/actions/workflows/js-qa.yml/badge.svg)](https://github.com/widoz/wp-entities-search/actions/workflows/js-qa.yml)
6+
[![PHP Quality Assurance](https://github.com/widoz/wp-entities-search/actions/workflows/php-qa.yml/badge.svg)](https://github.com/widoz/wp-entities-search/actions/workflows/php-qa.yml)
27

38
This package is a library exposing reusable Components and Utilities to help you build Entities searching and storage.
49

510
At it's core it permits to build components and reuse the WordPress Rest API to search for Posts associated to one or
611
more Post Types but also, to search for Terms belonging to one or more Taxonomies.
712

8-
## Table of Content
13+
## Documentation
914

10-
1. [Installation](./docs/installation.md)
11-
2. [Development](./docs/development.md)
12-
3. [Api](./docs/api.md)
13-
4. [Components](./docs/components.md)
14-
5. [Hooks](./docs/hooks.md)
15-
6. [Logging](./docs/logging.md)
16-
7. [Storage](./docs/storage.md)
15+
Go to [documentation](./docs) or visit the site [wp-entities-search](https://widoz.github.io/wp-entities-search/).
1716

1817
## License
1918

composer.json

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
{
2-
"name": "widoz/wp-entities-search",
3-
"description": "A WordPress package to search Entities including Rest API Endpoints and React Components",
4-
"type": "library",
5-
"license": "GPL-v2-or-later",
6-
"autoload": {
7-
"psr-4": {
8-
"Widoz\\Wp\\EntitiesSearch\\": "sources/server/src/"
9-
}
10-
},
11-
"authors": [
12-
{
13-
"name": "guido scialfa",
14-
"email": "[email protected]"
15-
}
16-
],
17-
"minimum-stability": "stable",
18-
"require": {
19-
"php": ">=8.0"
20-
},
21-
"require-dev": {
22-
"inpsyde/modularity": "^1.5",
23-
"inpsyde/php-coding-standards": "^1.0",
24-
"roots/wordpress-no-content": "^6.3"
25-
},
26-
"config": {
27-
"platform": {
28-
"php": "8.0"
29-
},
30-
"allow-plugins": {
31-
"dealerdirect/phpcodesniffer-composer-installer": true
32-
}
33-
},
34-
"scripts": {
35-
"cs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs",
36-
"cs:fix": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf"
37-
}
2+
"name": "widoz/wp-entities-search",
3+
"description": "A WordPress package to search Entities including Rest API Endpoints and React Components",
4+
"type": "library",
5+
"license": "GPL-2.0-or-later",
6+
"autoload": {
7+
"psr-4": {
8+
"Widoz\\Wp\\EntitiesSearch\\": "sources/server/src/"
9+
}
10+
},
11+
"authors": [
12+
{
13+
"name": "guido scialfa",
14+
"email": "[email protected]"
15+
}
16+
],
17+
"minimum-stability": "stable",
18+
"require": {
19+
"php": ">=8.1"
20+
},
21+
"require-dev": {
22+
"inpsyde/modularity": "^1.5",
23+
"inpsyde/php-coding-standards": "^1.0",
24+
"roots/wordpress-no-content": "^6.3"
25+
},
26+
"config": {
27+
"platform": {
28+
"php": "8.1"
29+
},
30+
"allow-plugins": {
31+
"dealerdirect/phpcodesniffer-composer-installer": true
32+
}
33+
},
34+
"scripts": {
35+
"cs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs",
36+
"cs:fix": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf"
37+
}
3838
}

0 commit comments

Comments
 (0)