@serwist/google-analytics 8.3.0 → 8.4.1
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 +4 -4
- package/dist/index.js +4 -4
- package/dist/initialize.cjs +4 -4
- package/dist/initialize.js +4 -4
- package/package.json +9 -8
package/dist/index.cjs
CHANGED
|
@@ -35,7 +35,7 @@ const COLLECT_PATHS_REGEX = /^\/(\w+\/)?collect/;
|
|
|
35
35
|
* @private
|
|
36
36
|
*/ const createOnSyncCallback = (config)=>{
|
|
37
37
|
return async ({ queue })=>{
|
|
38
|
-
let entry;
|
|
38
|
+
let entry = undefined;
|
|
39
39
|
while(entry = await queue.shiftRequest()){
|
|
40
40
|
const { request, timestamp } = entry;
|
|
41
41
|
const url = new URL(request.url);
|
|
@@ -72,18 +72,18 @@ const COLLECT_PATHS_REGEX = /^\/(\w+\/)?collect/;
|
|
|
72
72
|
}
|
|
73
73
|
}));
|
|
74
74
|
if (process.env.NODE_ENV !== "production") {
|
|
75
|
-
internal.logger.log(`Request for '${internal.getFriendlyURL(url.href)}'
|
|
75
|
+
internal.logger.log(`Request for '${internal.getFriendlyURL(url.href)}' has been replayed`);
|
|
76
76
|
}
|
|
77
77
|
} catch (err) {
|
|
78
78
|
await queue.unshiftRequest(entry);
|
|
79
79
|
if (process.env.NODE_ENV !== "production") {
|
|
80
|
-
internal.logger.log(`Request for '${internal.getFriendlyURL(url.href)}'
|
|
80
|
+
internal.logger.log(`Request for '${internal.getFriendlyURL(url.href)}' failed to replay, putting it back in the queue.`);
|
|
81
81
|
}
|
|
82
82
|
throw err;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
if (process.env.NODE_ENV !== "production") {
|
|
86
|
-
internal.logger.log(
|
|
86
|
+
internal.logger.log("All Google Analytics request successfully replayed; " + "the queue is now empty!");
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
89
|
};
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ const COLLECT_PATHS_REGEX = /^\/(\w+\/)?collect/;
|
|
|
33
33
|
* @private
|
|
34
34
|
*/ const createOnSyncCallback = (config)=>{
|
|
35
35
|
return async ({ queue })=>{
|
|
36
|
-
let entry;
|
|
36
|
+
let entry = undefined;
|
|
37
37
|
while(entry = await queue.shiftRequest()){
|
|
38
38
|
const { request, timestamp } = entry;
|
|
39
39
|
const url = new URL(request.url);
|
|
@@ -70,18 +70,18 @@ const COLLECT_PATHS_REGEX = /^\/(\w+\/)?collect/;
|
|
|
70
70
|
}
|
|
71
71
|
}));
|
|
72
72
|
if (process.env.NODE_ENV !== "production") {
|
|
73
|
-
logger.log(`Request for '${getFriendlyURL(url.href)}'
|
|
73
|
+
logger.log(`Request for '${getFriendlyURL(url.href)}' has been replayed`);
|
|
74
74
|
}
|
|
75
75
|
} catch (err) {
|
|
76
76
|
await queue.unshiftRequest(entry);
|
|
77
77
|
if (process.env.NODE_ENV !== "production") {
|
|
78
|
-
logger.log(`Request for '${getFriendlyURL(url.href)}'
|
|
78
|
+
logger.log(`Request for '${getFriendlyURL(url.href)}' failed to replay, putting it back in the queue.`);
|
|
79
79
|
}
|
|
80
80
|
throw err;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
if (process.env.NODE_ENV !== "production") {
|
|
84
|
-
logger.log(
|
|
84
|
+
logger.log("All Google Analytics request successfully replayed; " + "the queue is now empty!");
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
87
|
};
|
package/dist/initialize.cjs
CHANGED
|
@@ -35,7 +35,7 @@ const COLLECT_PATHS_REGEX = /^\/(\w+\/)?collect/;
|
|
|
35
35
|
* @private
|
|
36
36
|
*/ const createOnSyncCallback = (config)=>{
|
|
37
37
|
return async ({ queue })=>{
|
|
38
|
-
let entry;
|
|
38
|
+
let entry = undefined;
|
|
39
39
|
while(entry = await queue.shiftRequest()){
|
|
40
40
|
const { request, timestamp } = entry;
|
|
41
41
|
const url = new URL(request.url);
|
|
@@ -72,18 +72,18 @@ const COLLECT_PATHS_REGEX = /^\/(\w+\/)?collect/;
|
|
|
72
72
|
}
|
|
73
73
|
}));
|
|
74
74
|
if (process.env.NODE_ENV !== "production") {
|
|
75
|
-
internal.logger.log(`Request for '${internal.getFriendlyURL(url.href)}'
|
|
75
|
+
internal.logger.log(`Request for '${internal.getFriendlyURL(url.href)}' has been replayed`);
|
|
76
76
|
}
|
|
77
77
|
} catch (err) {
|
|
78
78
|
await queue.unshiftRequest(entry);
|
|
79
79
|
if (process.env.NODE_ENV !== "production") {
|
|
80
|
-
internal.logger.log(`Request for '${internal.getFriendlyURL(url.href)}'
|
|
80
|
+
internal.logger.log(`Request for '${internal.getFriendlyURL(url.href)}' failed to replay, putting it back in the queue.`);
|
|
81
81
|
}
|
|
82
82
|
throw err;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
if (process.env.NODE_ENV !== "production") {
|
|
86
|
-
internal.logger.log(
|
|
86
|
+
internal.logger.log("All Google Analytics request successfully replayed; " + "the queue is now empty!");
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
89
|
};
|
package/dist/initialize.js
CHANGED
|
@@ -33,7 +33,7 @@ const COLLECT_PATHS_REGEX = /^\/(\w+\/)?collect/;
|
|
|
33
33
|
* @private
|
|
34
34
|
*/ const createOnSyncCallback = (config)=>{
|
|
35
35
|
return async ({ queue })=>{
|
|
36
|
-
let entry;
|
|
36
|
+
let entry = undefined;
|
|
37
37
|
while(entry = await queue.shiftRequest()){
|
|
38
38
|
const { request, timestamp } = entry;
|
|
39
39
|
const url = new URL(request.url);
|
|
@@ -70,18 +70,18 @@ const COLLECT_PATHS_REGEX = /^\/(\w+\/)?collect/;
|
|
|
70
70
|
}
|
|
71
71
|
}));
|
|
72
72
|
if (process.env.NODE_ENV !== "production") {
|
|
73
|
-
logger.log(`Request for '${getFriendlyURL(url.href)}'
|
|
73
|
+
logger.log(`Request for '${getFriendlyURL(url.href)}' has been replayed`);
|
|
74
74
|
}
|
|
75
75
|
} catch (err) {
|
|
76
76
|
await queue.unshiftRequest(entry);
|
|
77
77
|
if (process.env.NODE_ENV !== "production") {
|
|
78
|
-
logger.log(`Request for '${getFriendlyURL(url.href)}'
|
|
78
|
+
logger.log(`Request for '${getFriendlyURL(url.href)}' failed to replay, putting it back in the queue.`);
|
|
79
79
|
}
|
|
80
80
|
throw err;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
if (process.env.NODE_ENV !== "production") {
|
|
84
|
-
logger.log(
|
|
84
|
+
logger.log("All Google Analytics request successfully replayed; " + "the queue is now empty!");
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
87
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/google-analytics",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Queues failed requests and uses the Background Sync API to replay them when the network is available",
|
|
6
6
|
"files": [
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"repository": "serwist/serwist",
|
|
22
22
|
"bugs": "https://github.com/serwist/serwist/issues",
|
|
23
|
-
"homepage": "https://serwist.
|
|
23
|
+
"homepage": "https://serwist.pages.dev",
|
|
24
24
|
"module": "./dist/index.js",
|
|
25
25
|
"main": "./dist/index.cjs",
|
|
26
26
|
"types": "./dist/index.d.ts",
|
|
@@ -48,18 +48,19 @@
|
|
|
48
48
|
"./package.json": "./package.json"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@serwist/background-sync": "8.
|
|
52
|
-
"@serwist/core": "8.
|
|
53
|
-
"@serwist/routing": "8.
|
|
54
|
-
"@serwist/strategies": "8.
|
|
51
|
+
"@serwist/background-sync": "8.4.1",
|
|
52
|
+
"@serwist/core": "8.4.1",
|
|
53
|
+
"@serwist/routing": "8.4.1",
|
|
54
|
+
"@serwist/strategies": "8.4.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"rollup": "4.9.1",
|
|
58
|
-
"@serwist/constants": "8.
|
|
58
|
+
"@serwist/constants": "8.4.1"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "rimraf dist && cross-env NODE_ENV=production rollup --config rollup.config.js",
|
|
62
|
-
"
|
|
62
|
+
"dev": "rollup --config rollup.config.js --watch",
|
|
63
|
+
"lint": "biome lint ./src",
|
|
63
64
|
"typecheck": "tsc"
|
|
64
65
|
}
|
|
65
66
|
}
|