@atomic-solutions/wordpress-react 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +87 -0
- package/dist/chunk-3MTIYB4V.js +231 -0
- package/dist/chunk-3MTIYB4V.js.map +1 -0
- package/dist/chunk-S5XNF5RD.js +23 -0
- package/dist/chunk-S5XNF5RD.js.map +1 -0
- package/dist/chunk-WEGZSYNS.js +8 -0
- package/dist/chunk-WEGZSYNS.js.map +1 -0
- package/dist/hooks/index.cjs +273 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.cts +1815 -0
- package/dist/hooks/index.d.ts +1815 -0
- package/dist/hooks/index.js +36 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index-BgFRJIdn.d.cts +54 -0
- package/dist/index-CtTu7gRa.d.ts +54 -0
- package/dist/index.cjs +292 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/provider/index.cjs +51 -0
- package/dist/provider/index.cjs.map +1 -0
- package/dist/provider/index.d.cts +4 -0
- package/dist/provider/index.d.ts +4 -0
- package/dist/provider/index.js +11 -0
- package/dist/provider/index.js.map +1 -0
- package/dist/queryKeys-ByTaglNR.d.cts +51 -0
- package/dist/queryKeys-ByTaglNR.d.ts +51 -0
- package/package.json +89 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { PostParams, CategoryParams } from '@atomic-solutions/wordpress-api-client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* React Query key factory
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Query keys for WordPress API
|
|
9
|
+
*/
|
|
10
|
+
interface QueryKeys {
|
|
11
|
+
/** All WordPress queries */
|
|
12
|
+
all: readonly string[];
|
|
13
|
+
/** Posts queries */
|
|
14
|
+
posts: {
|
|
15
|
+
all: readonly unknown[];
|
|
16
|
+
lists: () => readonly unknown[];
|
|
17
|
+
list: (params?: PostParams) => readonly unknown[];
|
|
18
|
+
details: () => readonly unknown[];
|
|
19
|
+
detail: (id: number) => readonly unknown[];
|
|
20
|
+
bySlug: (slug: string) => readonly unknown[];
|
|
21
|
+
};
|
|
22
|
+
/** Categories queries */
|
|
23
|
+
categories: {
|
|
24
|
+
all: readonly unknown[];
|
|
25
|
+
lists: () => readonly unknown[];
|
|
26
|
+
list: (params?: CategoryParams) => readonly unknown[];
|
|
27
|
+
details: () => readonly unknown[];
|
|
28
|
+
detail: (id: number) => readonly unknown[];
|
|
29
|
+
};
|
|
30
|
+
/** Media queries */
|
|
31
|
+
media: {
|
|
32
|
+
all: readonly unknown[];
|
|
33
|
+
details: () => readonly unknown[];
|
|
34
|
+
detail: (id: number) => readonly unknown[];
|
|
35
|
+
};
|
|
36
|
+
/** Users queries */
|
|
37
|
+
users: {
|
|
38
|
+
all: readonly unknown[];
|
|
39
|
+
me: () => readonly unknown[];
|
|
40
|
+
detail: (id: number) => readonly unknown[];
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Create query keys factory with optional prefix
|
|
45
|
+
*
|
|
46
|
+
* @param prefix - Optional prefix for all query keys
|
|
47
|
+
* @returns Query keys factory
|
|
48
|
+
*/
|
|
49
|
+
declare const createQueryKeys: (prefix?: string[]) => QueryKeys;
|
|
50
|
+
|
|
51
|
+
export { type QueryKeys as Q, createQueryKeys as c };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { PostParams, CategoryParams } from '@atomic-solutions/wordpress-api-client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* React Query key factory
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Query keys for WordPress API
|
|
9
|
+
*/
|
|
10
|
+
interface QueryKeys {
|
|
11
|
+
/** All WordPress queries */
|
|
12
|
+
all: readonly string[];
|
|
13
|
+
/** Posts queries */
|
|
14
|
+
posts: {
|
|
15
|
+
all: readonly unknown[];
|
|
16
|
+
lists: () => readonly unknown[];
|
|
17
|
+
list: (params?: PostParams) => readonly unknown[];
|
|
18
|
+
details: () => readonly unknown[];
|
|
19
|
+
detail: (id: number) => readonly unknown[];
|
|
20
|
+
bySlug: (slug: string) => readonly unknown[];
|
|
21
|
+
};
|
|
22
|
+
/** Categories queries */
|
|
23
|
+
categories: {
|
|
24
|
+
all: readonly unknown[];
|
|
25
|
+
lists: () => readonly unknown[];
|
|
26
|
+
list: (params?: CategoryParams) => readonly unknown[];
|
|
27
|
+
details: () => readonly unknown[];
|
|
28
|
+
detail: (id: number) => readonly unknown[];
|
|
29
|
+
};
|
|
30
|
+
/** Media queries */
|
|
31
|
+
media: {
|
|
32
|
+
all: readonly unknown[];
|
|
33
|
+
details: () => readonly unknown[];
|
|
34
|
+
detail: (id: number) => readonly unknown[];
|
|
35
|
+
};
|
|
36
|
+
/** Users queries */
|
|
37
|
+
users: {
|
|
38
|
+
all: readonly unknown[];
|
|
39
|
+
me: () => readonly unknown[];
|
|
40
|
+
detail: (id: number) => readonly unknown[];
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Create query keys factory with optional prefix
|
|
45
|
+
*
|
|
46
|
+
* @param prefix - Optional prefix for all query keys
|
|
47
|
+
* @returns Query keys factory
|
|
48
|
+
*/
|
|
49
|
+
declare const createQueryKeys: (prefix?: string[]) => QueryKeys;
|
|
50
|
+
|
|
51
|
+
export { type QueryKeys as Q, createQueryKeys as c };
|
package/package.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atomic-solutions/wordpress-react",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "React Query hooks and provider for WordPress REST API",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.cjs"
|
|
13
|
+
},
|
|
14
|
+
"./hooks": {
|
|
15
|
+
"types": "./dist/hooks/index.d.ts",
|
|
16
|
+
"import": "./dist/hooks/index.js",
|
|
17
|
+
"require": "./dist/hooks/index.cjs"
|
|
18
|
+
},
|
|
19
|
+
"./provider": {
|
|
20
|
+
"types": "./dist/provider/index.d.ts",
|
|
21
|
+
"import": "./dist/provider/index.js",
|
|
22
|
+
"require": "./dist/provider/index.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./package.json": "./package.json"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE"
|
|
30
|
+
],
|
|
31
|
+
"keywords": [
|
|
32
|
+
"wordpress",
|
|
33
|
+
"react",
|
|
34
|
+
"react-query",
|
|
35
|
+
"hooks",
|
|
36
|
+
"typescript"
|
|
37
|
+
],
|
|
38
|
+
"author": "Atomic Solutions <dev@atomicsolutions.dev>",
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/atomic-solutions/wordpress-woocommerce-monorepo",
|
|
43
|
+
"directory": "packages/react-wordpress"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@tanstack/react-query": ">=5.0.0",
|
|
50
|
+
"react": ">=18.0.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
|
|
54
|
+
"@tanstack/react-query": "^5.59.19",
|
|
55
|
+
"@testing-library/react": "^14.0.0",
|
|
56
|
+
"@types/node": "^24.10.1",
|
|
57
|
+
"@types/react": "^18.0.0",
|
|
58
|
+
"@types/react-dom": "^18.0.0",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
60
|
+
"@typescript-eslint/parser": "^8.56.1",
|
|
61
|
+
"@vitest/coverage-v8": "^2.0.0",
|
|
62
|
+
"axios-mock-adapter": "^2.0.0",
|
|
63
|
+
"eslint": "^9.35.0",
|
|
64
|
+
"eslint-config-prettier": "^10.1.8",
|
|
65
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
66
|
+
"jsdom": "^27.2.0",
|
|
67
|
+
"prettier": "^3.0.0",
|
|
68
|
+
"react": "^18.0.0",
|
|
69
|
+
"react-dom": "^18.0.0",
|
|
70
|
+
"release-it": "^19.0.6",
|
|
71
|
+
"tsup": "^8.0.0",
|
|
72
|
+
"typescript": "^5.9.0",
|
|
73
|
+
"vitest": "^2.0.0",
|
|
74
|
+
"@atomic-solutions/wordpress-api-client": "0.1.0"
|
|
75
|
+
},
|
|
76
|
+
"sideEffects": false,
|
|
77
|
+
"scripts": {
|
|
78
|
+
"build": "tsup",
|
|
79
|
+
"dev": "tsup --watch",
|
|
80
|
+
"typecheck": "tsc --noEmit",
|
|
81
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
82
|
+
"lint:fix": "eslint src --ext .ts,.tsx --fix",
|
|
83
|
+
"test": "vitest run",
|
|
84
|
+
"test:watch": "vitest",
|
|
85
|
+
"test:coverage": "vitest run --coverage",
|
|
86
|
+
"clean": "rm -rf dist",
|
|
87
|
+
"release": "release-it"
|
|
88
|
+
}
|
|
89
|
+
}
|