espark-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/dist/index.cjs.js +1282 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.es.js +109739 -0
- package/dist/index.es.js.map +1 -0
- package/dist/src/App.d.ts +14 -0
- package/dist/src/data/dataProvider.d.ts +2 -0
- package/dist/src/data/index.d.ts +1 -0
- package/dist/src/data/models/Device.d.ts +7 -0
- package/dist/src/data/models/Telemetry.d.ts +7 -0
- package/dist/src/data/models/index.d.ts +2 -0
- package/dist/src/i18n/index.d.ts +7 -0
- package/dist/src/index.d.ts +18 -0
- package/dist/src/pages/DeviceEdit.d.ts +1 -0
- package/dist/src/pages/DeviceList.d.ts +1 -0
- package/dist/src/pages/DeviceShow.d.ts +1 -0
- package/dist/src/pages/ResourceEdit.d.ts +10 -0
- package/dist/src/pages/ResourceList.d.ts +19 -0
- package/dist/src/pages/ResourceShow.d.ts +11 -0
- package/dist/src/pages/TelemetryList.d.ts +1 -0
- package/dist/src/pages/index.d.ts +7 -0
- package/dist/src/routes/index.d.ts +31 -0
- package/dist/src/utils/index.d.ts +4 -0
- package/dist/src/utils/strings.d.ts +4 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +96 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ResourceProps } from '@refinedev/core';
|
|
2
|
+
import { type ThemeConfig } from 'antd';
|
|
3
|
+
import { type ReactNode } from 'react';
|
|
4
|
+
import { type RouteObject } from 'react-router';
|
|
5
|
+
export declare const MainApp: ({ themeConfig, title, userResources, userRoutes, apiEndpoint, }: {
|
|
6
|
+
themeConfig?: ThemeConfig;
|
|
7
|
+
title?: {
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
text?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
userResources?: ResourceProps[];
|
|
12
|
+
userRoutes?: RouteObject[];
|
|
13
|
+
apiEndpoint: string;
|
|
14
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createDataProvider, } from './dataProvider';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Resource } from 'i18next';
|
|
2
|
+
export declare const apply: ({ language, supportedLanguages, fallbackLanguage, resources, }: {
|
|
3
|
+
language: string;
|
|
4
|
+
supportedLanguages: string[];
|
|
5
|
+
fallbackLanguage: string;
|
|
6
|
+
resources: Resource;
|
|
7
|
+
}) => Promise<void | import("i18next").TFunction<"translation", undefined>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ResourceProps } from '@refinedev/core';
|
|
2
|
+
import { type ThemeConfig } from 'antd';
|
|
3
|
+
import { type ReactNode } from 'react';
|
|
4
|
+
import { type RouteObject } from 'react-router';
|
|
5
|
+
export declare const EsparkApp: ({ themeConfig, title, userResources, userRoutes, apiEndpoint, }: {
|
|
6
|
+
themeConfig?: ThemeConfig;
|
|
7
|
+
title?: {
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
text?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
userResources?: ResourceProps[];
|
|
12
|
+
userRoutes?: RouteObject[];
|
|
13
|
+
apiEndpoint: string;
|
|
14
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
export type { Device, Telemetry, } from './data/models';
|
|
16
|
+
export { createDataProvider, } from './data';
|
|
17
|
+
export { DeviceEdit, DeviceList, DeviceShow, ResourceEdit, ResourceShow, ResourceList, TelemetryList, } from './pages';
|
|
18
|
+
export { camelCaseToSnakeCase, capitaliseFirstLetter, formatMacAddress, snakeCaseToCamelCase, } from './utils/strings';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DeviceEdit: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DeviceList: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DeviceShow: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type FormInstance } from 'antd';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export declare const ResourceEdit: <T extends {
|
|
4
|
+
id?: number | string;
|
|
5
|
+
}>({ resource, children, }: {
|
|
6
|
+
resource: string;
|
|
7
|
+
children?: ({ form, }: {
|
|
8
|
+
form: FormInstance;
|
|
9
|
+
}) => ReactNode;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type CrudSort, type GetListResponse, type HttpError, type useTableProps } from '@refinedev/core';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
export declare const ResourceList: <T extends {
|
|
4
|
+
id?: number | string;
|
|
5
|
+
}>({ resource, title, extraHeaders, filterProps, sorterProps, children, }: {
|
|
6
|
+
resource: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
extraHeaders?: ({ data, }: {
|
|
9
|
+
data?: GetListResponse<T>;
|
|
10
|
+
}) => ReactNode;
|
|
11
|
+
filterProps?: useTableProps<T, HttpError, T>["filters"];
|
|
12
|
+
sorterProps?: useTableProps<T, HttpError, T>["sorters"];
|
|
13
|
+
children?: ({ isLoading, isSuccess, sorters, data, }: {
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
isSuccess?: boolean;
|
|
16
|
+
sorters: CrudSort[];
|
|
17
|
+
data?: GetListResponse<T>;
|
|
18
|
+
}) => ReactNode;
|
|
19
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GetOneResponse } from '@refinedev/core';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
export declare const ResourceShow: <T extends {
|
|
4
|
+
id?: number | string;
|
|
5
|
+
}>({ resource, children, }: {
|
|
6
|
+
resource: string;
|
|
7
|
+
mutable?: boolean;
|
|
8
|
+
children?: ({ data, }: {
|
|
9
|
+
data?: GetOneResponse<T>;
|
|
10
|
+
}) => ReactNode;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TelemetryList: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { DeviceEdit, } from './DeviceEdit';
|
|
2
|
+
export { DeviceList, } from './DeviceList';
|
|
3
|
+
export { DeviceShow, } from './DeviceShow';
|
|
4
|
+
export { ResourceEdit, } from './ResourceEdit';
|
|
5
|
+
export { ResourceList, } from './ResourceList';
|
|
6
|
+
export { ResourceShow, } from './ResourceShow';
|
|
7
|
+
export { TelemetryList, } from './TelemetryList';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const resources: ({
|
|
2
|
+
name: string;
|
|
3
|
+
meta: {
|
|
4
|
+
icon: import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
list: string;
|
|
8
|
+
edit: string;
|
|
9
|
+
show: string;
|
|
10
|
+
} | {
|
|
11
|
+
name: string;
|
|
12
|
+
meta: {
|
|
13
|
+
icon: import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
label: string;
|
|
15
|
+
};
|
|
16
|
+
list: string;
|
|
17
|
+
edit?: undefined;
|
|
18
|
+
show?: undefined;
|
|
19
|
+
})[];
|
|
20
|
+
export declare const routes: {
|
|
21
|
+
path: string;
|
|
22
|
+
children: ({
|
|
23
|
+
index: boolean;
|
|
24
|
+
Component: () => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
path?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
path: string;
|
|
28
|
+
Component: () => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
index?: undefined;
|
|
30
|
+
})[];
|
|
31
|
+
}[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const camelCaseToSnakeCase: (obj: string | Record<string, any>) => string | Record<string, any>;
|
|
2
|
+
export declare const snakeCaseToCamelCase: (obj: string | Record<string, any>) => string | Record<string, any>;
|
|
3
|
+
export declare const capitaliseFirstLetter: (str: string) => string;
|
|
4
|
+
export declare const formatMacAddress: (mac: string | undefined) => string | undefined;
|
package/package.json
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "espark-react",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "Alan Tai"
|
|
6
|
+
},
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/ayltai/espark.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/ayltai/espark/issues"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"esp32",
|
|
16
|
+
"smart",
|
|
17
|
+
"door",
|
|
18
|
+
"alarm"
|
|
19
|
+
],
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"module": "dist/index.es.js",
|
|
22
|
+
"main": "dist/index.cjs.js",
|
|
23
|
+
"types": "dist/src/index.d.ts",
|
|
24
|
+
"type": "module",
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"react": "^19.2.0",
|
|
30
|
+
"react-dom": "^19.2.0"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@ant-design/icons": "^6.1.0",
|
|
34
|
+
"@fortawesome/fontawesome-svg-core": "^7.1.0",
|
|
35
|
+
"@fortawesome/free-solid-svg-icons": "^7.1.0",
|
|
36
|
+
"@fortawesome/react-fontawesome": "^3.1.1",
|
|
37
|
+
"@refinedev/antd": "^6.0.3",
|
|
38
|
+
"@refinedev/core": "^5.0.6",
|
|
39
|
+
"@refinedev/react-router": "^2.0.3",
|
|
40
|
+
"@tanstack/react-query": "^5.90.11",
|
|
41
|
+
"antd": "^6.1.0",
|
|
42
|
+
"date-fns": "^4.1.0",
|
|
43
|
+
"i18next": "^25.7.2",
|
|
44
|
+
"react-i18next": "^16.4.0",
|
|
45
|
+
"react-redux": "^9.2.0",
|
|
46
|
+
"react-router": "^7.10.1",
|
|
47
|
+
"string-to-color": "^2.2.2"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@eslint/eslintrc": "^3.3.3",
|
|
51
|
+
"@eslint/js": "^9.39.1",
|
|
52
|
+
"@refinedev/cli": "^2.16.50",
|
|
53
|
+
"@stylistic/eslint-plugin": "^5.6.1",
|
|
54
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
55
|
+
"@testing-library/react": "^16.3.0",
|
|
56
|
+
"@types/node": "^24.10.2",
|
|
57
|
+
"@types/react": "^19.2.7",
|
|
58
|
+
"@types/react-dom": "^19.2.3",
|
|
59
|
+
"@types/react-test-renderer": "^19.1.0",
|
|
60
|
+
"@typescript-eslint/parser": "^8.49.0",
|
|
61
|
+
"@vitejs/plugin-react-swc": "^4.2.2",
|
|
62
|
+
"@vitest/coverage-v8": "^4.0.15",
|
|
63
|
+
"@vitest/ui": "^4.0.15",
|
|
64
|
+
"cross-env": "^10.1.0",
|
|
65
|
+
"eslint": "^9.39.1",
|
|
66
|
+
"eslint-plugin-import": "^2.32.0",
|
|
67
|
+
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
68
|
+
"eslint-plugin-react": "^7.37.5",
|
|
69
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
70
|
+
"eslint-plugin-unicorn": "^62.0.0",
|
|
71
|
+
"globals": "^16.5.0",
|
|
72
|
+
"jsdom": "^27.3.0",
|
|
73
|
+
"prop-types": "^15.8.1",
|
|
74
|
+
"typescript": "^5.9.3",
|
|
75
|
+
"typescript-eslint": "^8.49.0",
|
|
76
|
+
"vite": "^7.2.7",
|
|
77
|
+
"vitest": "^4.0.15",
|
|
78
|
+
"vitest-fetch-mock": "^0.4.5"
|
|
79
|
+
},
|
|
80
|
+
"engines": {
|
|
81
|
+
"node": ">=22",
|
|
82
|
+
"pnpm": ">=10"
|
|
83
|
+
},
|
|
84
|
+
"publishConfig": {
|
|
85
|
+
"access": "public"
|
|
86
|
+
},
|
|
87
|
+
"scripts": {
|
|
88
|
+
"clean": "pnpm dlx rimraf --glob **/node_modules/* pnpm-lock.yaml",
|
|
89
|
+
"reset": "pnpm clean && pnpm i && pnpm audit -P",
|
|
90
|
+
"lint": "eslint src",
|
|
91
|
+
"pretest": "pnpm lint",
|
|
92
|
+
"test": "cross-env VITE_COVERAGE=true vitest --run",
|
|
93
|
+
"test:ci": "cross-env NODE_OPTIONS=--max-old-space-size=1536 VITE_COVERAGE=true vitest --run",
|
|
94
|
+
"build": "vite build && tsc -p tsconfig.build.json"
|
|
95
|
+
}
|
|
96
|
+
}
|