Skip to content

Commit c625518

Browse files
chore: update tracker
Signed-off-by: Henry Gressmann <[email protected]>
1 parent 859fd75 commit c625518

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

tracker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export type EventOptions = {
7474
* @throws If {@link EventOptions.endpoint} is not provided in server-side environments.
7575
*/
7676
export function event(
77-
name?: string, // = "pageview"
77+
name: string = "pageview",
7878
options?: EventOptions
7979
): Promise<void | {
8080
status: number;

tracker/package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
22
"name": "liwan-tracker",
33
"description": "Tracking script for Liwan, an open-source analytics platform",
4-
"keywords": ["analytics", "tracking", "liwan"],
5-
"version": "1.0.0",
4+
"keywords": [
5+
"analytics",
6+
"tracking",
7+
"liwan"
8+
],
9+
"version": "1.0.1",
610
"homepage": "https://liwan.dev",
711
"repository": {
812
"type": "git",
@@ -22,8 +26,10 @@
2226
"type": "module",
2327
"exports": {
2428
".": {
25-
"import": "./script.min.js",
26-
"types": "./script.d.ts"
29+
"import": {
30+
"types": "./script.d.ts",
31+
"default": "./script.min.js"
32+
}
2733
}
2834
},
2935
"module": "script.min.js",

tracker/script.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const reject = (message: string) => {
8484
* });
8585
* ```
8686
*/
87-
export async function event(name = "pageview", options?: EventOptions): Promise<void> {
87+
export async function event(name: string = "pageview", options?: EventOptions): Promise<void> {
8888
const endpoint_url = options?.endpoint || endpoint;
8989
if (!endpoint_url) return reject("endpoint is required");
9090
if (localStorage?.getItem("disable-liwan")) return ignore("localStorage flag");

0 commit comments

Comments
 (0)