@chaosity/location-client-react 0.1.10 → 0.1.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chaosity/location-client-react",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "React bindings for Chaosity Location Service client",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -8,9 +8,10 @@
8
8
  "scripts": {
9
9
  "build": "tsc",
10
10
  "dev": "tsc --watch",
11
- "test": "vitest run",
11
+ "test": "vitest run --passWithNoTests",
12
12
  "test:watch": "vitest",
13
- "prepublishOnly": "npm run build"
13
+ "prepublishOnly": "npm run build",
14
+ "prepare": "husky"
14
15
  },
15
16
  "keywords": [
16
17
  "react",
@@ -30,7 +31,7 @@
30
31
  "url": "https://github.com/chaosity-io/location-service-client-react/issues"
31
32
  },
32
33
  "dependencies": {
33
- "@chaosity/location-client": "file:../location-service-client",
34
+ "@chaosity/location-client": "^0.1.0",
34
35
  "debug": "^4.4.3"
35
36
  },
36
37
  "peerDependencies": {
@@ -47,7 +48,9 @@
47
48
  "@testing-library/user-event": "^14.0.0",
48
49
  "@types/debug": "^4.1.12",
49
50
  "@types/react": "^19.0.0",
51
+ "@vitest/coverage-v8": "^3.0.0",
50
52
  "happy-dom": "^17.0.0",
53
+ "husky": "^9.0.0",
51
54
  "maplibre-gl": "^5.0.0",
52
55
  "react": "^19.0.0",
53
56
  "typescript": "^5.0.0",
@@ -1,10 +0,0 @@
1
- import { GeoPlacesClient, ClientConfig } from '@chaosity/location-client';
2
- export interface UseLocationClientOptions {
3
- getConfig: () => Promise<ClientConfig>;
4
- }
5
- export declare function useLocationClient(options: UseLocationClientOptions): {
6
- config: ClientConfig | null;
7
- client: GeoPlacesClient | null;
8
- loading: boolean;
9
- error: string | null;
10
- };
@@ -1,21 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- import { GeoPlacesClient } from '@chaosity/location-client';
3
- export function useLocationClient(options) {
4
- const [config, setConfig] = useState(null);
5
- const [client, setClient] = useState(null);
6
- const [loading, setLoading] = useState(true);
7
- const [error, setError] = useState(null);
8
- useEffect(() => {
9
- options.getConfig()
10
- .then((cfg) => {
11
- setConfig(cfg);
12
- setClient(new GeoPlacesClient(cfg));
13
- setLoading(false);
14
- })
15
- .catch((err) => {
16
- setError(err instanceof Error ? err.message : 'Failed to initialize client');
17
- setLoading(false);
18
- });
19
- }, []);
20
- return { config, client, loading, error };
21
- }