@jitsu/js 1.3.0 → 1.3.1-canary.300.20231019125048
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/.turbo/turbo-build.log +95 -95
- package/.turbo/turbo-clean.log +5 -5
- package/__tests__/node/nodejs.test.ts +6 -7
- package/__tests__/playwright/integration.test.ts +2 -2
- package/dist/analytics-plugin.d.ts +0 -1
- package/dist/index.d.ts +1 -0
- package/dist/jitsu.cjs.js +25 -633
- package/dist/jitsu.es.js +25 -633
- package/dist/tlds.d.ts +3 -0
- package/dist/web/p.js.txt +1 -1645
- package/package.json +2 -3
- package/rollup.config.js +1 -1
- package/src/analytics-plugin.ts +3 -14
- package/src/index.ts +1 -0
- package/src/tlds.ts +27 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
@jitsu/js:build: cache hit, replaying output [
|
|
2
|
-
[
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
[
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
34
|
-
[
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
[
|
|
56
|
-
[
|
|
57
|
-
[
|
|
58
|
-
[
|
|
59
|
-
[
|
|
60
|
-
[
|
|
61
|
-
[
|
|
62
|
-
[
|
|
63
|
-
[
|
|
64
|
-
[
|
|
65
|
-
[
|
|
66
|
-
[
|
|
67
|
-
[
|
|
68
|
-
[
|
|
69
|
-
[
|
|
70
|
-
[
|
|
71
|
-
[
|
|
72
|
-
[
|
|
73
|
-
[
|
|
74
|
-
[
|
|
75
|
-
[
|
|
76
|
-
[
|
|
77
|
-
[
|
|
78
|
-
[
|
|
79
|
-
[
|
|
80
|
-
[
|
|
81
|
-
[
|
|
82
|
-
[
|
|
83
|
-
[
|
|
84
|
-
[
|
|
85
|
-
[
|
|
86
|
-
[
|
|
87
|
-
[
|
|
88
|
-
[
|
|
89
|
-
[
|
|
90
|
-
[
|
|
91
|
-
[
|
|
92
|
-
[
|
|
93
|
-
[
|
|
94
|
-
[
|
|
95
|
-
[
|
|
1
|
+
@jitsu/js:build: cache hit, replaying output [2me032ba7866b432ba[0m
|
|
2
|
+
[33m@jitsu/js:build: [0m
|
|
3
|
+
[33m@jitsu/js:build: [0m> @jitsu/js@0.0.0 build /Users/ildarnurislamov/Projects/newjitsu/libs/jitsu-js
|
|
4
|
+
[33m@jitsu/js:build: [0m> tsc -p . && rollup -c && cp compiled/src/*.d.ts dist
|
|
5
|
+
[33m@jitsu/js:build: [0m
|
|
6
|
+
[33m@jitsu/js:build: [0m[36m
|
|
7
|
+
[33m@jitsu/js:build: [0m[1m./compiled/src/browser.js[22m → [1mdist/web/p.js.txt[22m...[39m
|
|
8
|
+
[33m@jitsu/js:build: [0m[1m[33m(!) "this" has been rewritten to "undefined"[39m[22m
|
|
9
|
+
[33m@jitsu/js:build: [0m[90mhttps://rollupjs.org/troubleshooting/#error-this-is-undefined[39m
|
|
10
|
+
[33m@jitsu/js:build: [0m[1mcompiled/src/analytics-plugin.js[22m
|
|
11
|
+
[33m@jitsu/js:build: [0m[90m1: /* global analytics */
|
|
12
|
+
[33m@jitsu/js:build: [0m2: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
[33m@jitsu/js:build: [0m ^
|
|
14
|
+
[33m@jitsu/js:build: [0m3: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
[33m@jitsu/js:build: [0m4: return new (P || (P = Promise))(function (resolve, reject) {[39m
|
|
16
|
+
[33m@jitsu/js:build: [0m...and 1 other occurrence
|
|
17
|
+
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins/tag.js[22m
|
|
18
|
+
[33m@jitsu/js:build: [0m[90m1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
19
|
+
[33m@jitsu/js:build: [0m ^
|
|
20
|
+
[33m@jitsu/js:build: [0m2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
21
|
+
[33m@jitsu/js:build: [0m3: return new (P || (P = Promise))(function (resolve, reject) {[39m
|
|
22
|
+
[33m@jitsu/js:build: [0m...and 1 other occurrence
|
|
23
|
+
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins/gtm.js[22m
|
|
24
|
+
[33m@jitsu/js:build: [0m[90m1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
25
|
+
[33m@jitsu/js:build: [0m ^
|
|
26
|
+
[33m@jitsu/js:build: [0m2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
[33m@jitsu/js:build: [0m3: return new (P || (P = Promise))(function (resolve, reject) {[39m
|
|
28
|
+
[33m@jitsu/js:build: [0m...and 1 other occurrence
|
|
29
|
+
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins/logrocket.js[22m
|
|
30
|
+
[33m@jitsu/js:build: [0m[90m1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31
|
+
[33m@jitsu/js:build: [0m ^
|
|
32
|
+
[33m@jitsu/js:build: [0m2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
33
|
+
[33m@jitsu/js:build: [0m3: return new (P || (P = Promise))(function (resolve, reject) {[39m
|
|
34
|
+
[33m@jitsu/js:build: [0m...and 1 other occurrence
|
|
35
|
+
[33m@jitsu/js:build: [0m[1m[33m(!) Circular dependencies[39m[22m
|
|
36
|
+
[33m@jitsu/js:build: [0mcompiled/src/index.js -> compiled/src/analytics-plugin.js -> compiled/src/index.js
|
|
37
|
+
[33m@jitsu/js:build: [0mcompiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/tag.js -> compiled/src/destination-plugins/index.js
|
|
38
|
+
[33m@jitsu/js:build: [0mcompiled/src/analytics-plugin.js -> compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/tag.js -> compiled/src/analytics-plugin.js
|
|
39
|
+
[33m@jitsu/js:build: [0mcompiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/logrocket.js -> compiled/src/destination-plugins/index.js
|
|
40
|
+
[33m@jitsu/js:build: [0mcompiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/gtm.js -> compiled/src/destination-plugins/index.js
|
|
41
|
+
[33m@jitsu/js:build: [0m[1m[33m(!) Use of eval is strongly discouraged[39m[22m
|
|
42
|
+
[33m@jitsu/js:build: [0m[90mhttps://rollupjs.org/troubleshooting/#avoiding-eval[39m
|
|
43
|
+
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins/tag.js[22m
|
|
44
|
+
[33m@jitsu/js:build: [0m[90m68: })()`;
|
|
45
|
+
[33m@jitsu/js:build: [0m69: try {
|
|
46
|
+
[33m@jitsu/js:build: [0m70: eval(iif);
|
|
47
|
+
[33m@jitsu/js:build: [0m ^
|
|
48
|
+
[33m@jitsu/js:build: [0m71: }
|
|
49
|
+
[33m@jitsu/js:build: [0m72: catch (e) {[39m
|
|
50
|
+
[33m@jitsu/js:build: [0m[32mcreated [1mdist/web/p.js.txt[22m in [1m517ms[22m[39m
|
|
51
|
+
[33m@jitsu/js:build: [0m[36m
|
|
52
|
+
[33m@jitsu/js:build: [0m[1m./compiled/src/index.js, ./compiled/src/jitsu.js, ./compiled/src/analytics-plugin.js[22m → [1mdist/jitsu.es.js, dist/jitsu.cjs.js[22m...[39m
|
|
53
|
+
[33m@jitsu/js:build: [0m[1m[33m(!) "this" has been rewritten to "undefined"[39m[22m
|
|
54
|
+
[33m@jitsu/js:build: [0m[90mhttps://rollupjs.org/troubleshooting/#error-this-is-undefined[39m
|
|
55
|
+
[33m@jitsu/js:build: [0m[1mcompiled/src/analytics-plugin.js[22m
|
|
56
|
+
[33m@jitsu/js:build: [0m[90m1: /* global analytics */
|
|
57
|
+
[33m@jitsu/js:build: [0m2: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
58
|
+
[33m@jitsu/js:build: [0m ^
|
|
59
|
+
[33m@jitsu/js:build: [0m3: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
60
|
+
[33m@jitsu/js:build: [0m4: return new (P || (P = Promise))(function (resolve, reject) {[39m
|
|
61
|
+
[33m@jitsu/js:build: [0m...and 1 other occurrence
|
|
62
|
+
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins/tag.js[22m
|
|
63
|
+
[33m@jitsu/js:build: [0m[90m1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
64
|
+
[33m@jitsu/js:build: [0m ^
|
|
65
|
+
[33m@jitsu/js:build: [0m2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
66
|
+
[33m@jitsu/js:build: [0m3: return new (P || (P = Promise))(function (resolve, reject) {[39m
|
|
67
|
+
[33m@jitsu/js:build: [0m...and 1 other occurrence
|
|
68
|
+
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins/logrocket.js[22m
|
|
69
|
+
[33m@jitsu/js:build: [0m[90m1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
70
|
+
[33m@jitsu/js:build: [0m ^
|
|
71
|
+
[33m@jitsu/js:build: [0m2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
72
|
+
[33m@jitsu/js:build: [0m3: return new (P || (P = Promise))(function (resolve, reject) {[39m
|
|
73
|
+
[33m@jitsu/js:build: [0m...and 1 other occurrence
|
|
74
|
+
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins/gtm.js[22m
|
|
75
|
+
[33m@jitsu/js:build: [0m[90m1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
76
|
+
[33m@jitsu/js:build: [0m ^
|
|
77
|
+
[33m@jitsu/js:build: [0m2: function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
78
|
+
[33m@jitsu/js:build: [0m3: return new (P || (P = Promise))(function (resolve, reject) {[39m
|
|
79
|
+
[33m@jitsu/js:build: [0m...and 1 other occurrence
|
|
80
|
+
[33m@jitsu/js:build: [0m[1m[33m(!) Circular dependencies[39m[22m
|
|
81
|
+
[33m@jitsu/js:build: [0mcompiled/src/index.js -> compiled/src/analytics-plugin.js -> compiled/src/index.js
|
|
82
|
+
[33m@jitsu/js:build: [0mcompiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/tag.js -> compiled/src/destination-plugins/index.js
|
|
83
|
+
[33m@jitsu/js:build: [0mcompiled/src/analytics-plugin.js -> compiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/tag.js -> compiled/src/analytics-plugin.js
|
|
84
|
+
[33m@jitsu/js:build: [0mcompiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/logrocket.js -> compiled/src/destination-plugins/index.js
|
|
85
|
+
[33m@jitsu/js:build: [0mcompiled/src/destination-plugins/index.js -> compiled/src/destination-plugins/gtm.js -> compiled/src/destination-plugins/index.js
|
|
86
|
+
[33m@jitsu/js:build: [0m[1m[33m(!) Use of eval is strongly discouraged[39m[22m
|
|
87
|
+
[33m@jitsu/js:build: [0m[90mhttps://rollupjs.org/troubleshooting/#avoiding-eval[39m
|
|
88
|
+
[33m@jitsu/js:build: [0m[1mcompiled/src/destination-plugins/tag.js[22m
|
|
89
|
+
[33m@jitsu/js:build: [0m[90m68: })()`;
|
|
90
|
+
[33m@jitsu/js:build: [0m69: try {
|
|
91
|
+
[33m@jitsu/js:build: [0m70: eval(iif);
|
|
92
|
+
[33m@jitsu/js:build: [0m ^
|
|
93
|
+
[33m@jitsu/js:build: [0m71: }
|
|
94
|
+
[33m@jitsu/js:build: [0m72: catch (e) {[39m
|
|
95
|
+
[33m@jitsu/js:build: [0m[32mcreated [1mdist/jitsu.es.js, dist/jitsu.cjs.js[22m in [1m171ms[22m[39m
|
package/.turbo/turbo-clean.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
@jitsu/js:clean: cache hit, replaying output [
|
|
2
|
-
[
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
1
|
+
@jitsu/js:clean: cache hit, replaying output [2m275761415adc1ac6[0m
|
|
2
|
+
[33m@jitsu/js:clean: [0m
|
|
3
|
+
[33m@jitsu/js:clean: [0m> @jitsu/js@0.0.0 clean /Users/ildarnurislamov/Projects/newjitsu/libs/jitsu-js
|
|
4
|
+
[33m@jitsu/js:clean: [0m> rm -rf ./dist
|
|
5
|
+
[33m@jitsu/js:clean: [0m
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createServer, SimpleSyrup } from "../simple-syrup";
|
|
2
2
|
import { AnalyticsClientEvent, AnalyticsInterface } from "@jitsu/protocols/analytics";
|
|
3
|
-
import {
|
|
3
|
+
import { getTopLevelDomain } from "../../src/tlds";
|
|
4
4
|
|
|
5
5
|
const jitsuAnalytics = require("../../dist/jitsu.cjs.js").jitsuAnalytics;
|
|
6
6
|
const fetchImpl = require("node-fetch-commonjs");
|
|
@@ -92,12 +92,11 @@ describe("Test Jitsu NodeJS client", () => {
|
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
test("tld", async () => {
|
|
95
|
-
expect(
|
|
96
|
-
expect(
|
|
97
|
-
expect(
|
|
98
|
-
expect(
|
|
99
|
-
expect(
|
|
100
|
-
expect(parse("use.jitsu.com").domain).toBe("jitsu.com");
|
|
95
|
+
expect(getTopLevelDomain("www.google.com")).toBe("google.com");
|
|
96
|
+
expect(getTopLevelDomain("www.trendstyle.com.au")).toBe("trendstyle.com.au");
|
|
97
|
+
expect(getTopLevelDomain("localhost:3000")).toBe("localhost");
|
|
98
|
+
expect(getTopLevelDomain("use.jitsu.com")).toBe("jitsu.com");
|
|
99
|
+
expect(getTopLevelDomain("use.jitsu.com")).toBe("jitsu.com");
|
|
101
100
|
//console.log(parse("http://localhost:3000"));
|
|
102
101
|
});
|
|
103
102
|
});
|
|
@@ -179,7 +179,7 @@ test("segment-reference", async ({ browser }) => {
|
|
|
179
179
|
test("basic", async ({ browser }) => {
|
|
180
180
|
const browserContext = await browser.newContext();
|
|
181
181
|
|
|
182
|
-
const { page: firstPage, uncaughtErrors:
|
|
182
|
+
const { page: firstPage, uncaughtErrors: firstPageErrors } = await createLoggingPage(browserContext);
|
|
183
183
|
const [pageResult] = await Promise.all([
|
|
184
184
|
firstPage.goto(`${server.baseUrl}/basic.html?utm_source=source&utm_medium=medium&utm_campaign=campaign`),
|
|
185
185
|
]);
|
|
@@ -197,7 +197,7 @@ test("basic", async ({ browser }) => {
|
|
|
197
197
|
{}
|
|
198
198
|
);
|
|
199
199
|
console.log("🍪 Jitsu Cookies", cookies);
|
|
200
|
-
expect(
|
|
200
|
+
expect(firstPageErrors.length).toEqual(0);
|
|
201
201
|
const anonymousId = cookies["__eventn_id"];
|
|
202
202
|
expect(anonymousId).toBeDefined();
|
|
203
203
|
expect(cookies["__eventn_uid"]).toBe("user1");
|
|
@@ -2,7 +2,6 @@ import { JitsuOptions, PersistentStorage, RuntimeFacade } from "./jitsu";
|
|
|
2
2
|
import { AnalyticsPlugin } from "analytics";
|
|
3
3
|
export declare const parseQuery: (qs?: string) => Record<string, string>;
|
|
4
4
|
export type StorageFactory = (cookieDomain: string, cookie2key: Record<string, string>) => PersistentStorage;
|
|
5
|
-
export declare function getTopLevelDomain(opts?: JitsuOptions): string;
|
|
6
5
|
export declare function windowRuntime(opts: JitsuOptions): RuntimeFacade;
|
|
7
6
|
export declare const emptyRuntime: (config: JitsuOptions) => RuntimeFacade;
|
|
8
7
|
export declare function isInBrowser(): boolean;
|
package/dist/index.d.ts
CHANGED