@jitsu/js 0.0.1-alpha.122 → 0.0.1-alpha.126
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 +5 -5
- package/.turbo/turbo-clean.log +1 -1
- package/dist/analytics-plugin.d.ts +10 -0
- package/dist/browser.d.ts +7 -0
- package/dist/index.d.ts +5 -0
- package/dist/jitsu.cjs.js +5 -0
- package/dist/jitsu.d.ts +33 -41
- package/dist/jitsu.es.js +1 -1
- package/package.json +6 -6
- package/rollup.config.js +2 -2
- package/src/index.ts +4 -2
- package/src/{jitsu.d.ts → jitsu.ts} +4 -4
- package/tsconfig.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
@jitsu/js:build: cache hit, replaying output [
|
|
1
|
+
@jitsu/js:build: cache hit, replaying output [2m86152f925c86fdcd[0m
|
|
2
2
|
[35m@jitsu/js:build: [0m
|
|
3
3
|
[35m@jitsu/js:build: [0m> @jitsu/js@0.0.0 build /Users/ildarnurislamov/Projects/onetag/libs/jitsu-js
|
|
4
|
-
[35m@jitsu/js:build: [0m> tsc -p . && rollup -c && cp src
|
|
4
|
+
[35m@jitsu/js:build: [0m> tsc -p . && rollup -c && cp compiled/src/*.d.ts dist
|
|
5
5
|
[35m@jitsu/js:build: [0m
|
|
6
6
|
[35m@jitsu/js:build: [0m[36m
|
|
7
7
|
[35m@jitsu/js:build: [0m[1m./compiled/src/browser.js[22m → [1mdist/web/p.js.txt[22m...[39m
|
|
8
8
|
[35m@jitsu/js:build: [0m[1m[33m(!) Circular dependency[39m[22m
|
|
9
9
|
[35m@jitsu/js:build: [0mcompiled/src/index.js -> compiled/src/analytics-plugin.js -> compiled/src/index.js
|
|
10
|
-
[35m@jitsu/js:build: [0m[32mcreated [1mdist/web/p.js.txt[22m in [
|
|
10
|
+
[35m@jitsu/js:build: [0m[32mcreated [1mdist/web/p.js.txt[22m in [1m237ms[22m[39m
|
|
11
11
|
[35m@jitsu/js:build: [0m[36m
|
|
12
|
-
[35m@jitsu/js:build: [0m[1m./compiled/src/index.js[22m → [1mdist/jitsu.es.js, dist/jitsu.cjs.js[22m...[39m
|
|
12
|
+
[35m@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
|
|
13
13
|
[35m@jitsu/js:build: [0m[1m[33m(!) Circular dependency[39m[22m
|
|
14
14
|
[35m@jitsu/js:build: [0mcompiled/src/index.js -> compiled/src/analytics-plugin.js -> compiled/src/index.js
|
|
15
|
-
[35m@jitsu/js:build: [0m[32mcreated [1mdist/jitsu.es.js, dist/jitsu.cjs.js[22m in [
|
|
15
|
+
[35m@jitsu/js:build: [0m[32mcreated [1mdist/jitsu.es.js, dist/jitsu.cjs.js[22m in [1m128ms[22m[39m
|
package/.turbo/turbo-clean.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@jitsu/js:clean: cache hit, replaying output [
|
|
1
|
+
@jitsu/js:clean: cache hit, replaying output [2m918ecf9a7a81d250[0m
|
|
2
2
|
[35m@jitsu/js:clean: [0m
|
|
3
3
|
[35m@jitsu/js:clean: [0m> @jitsu/js@0.0.0 clean /Users/ildarnurislamov/Projects/onetag/libs/jitsu-js
|
|
4
4
|
[35m@jitsu/js:clean: [0m> rm -rf ./dist
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JitsuOptions, PersistentStorage, RuntimeFacade } from "./jitsu";
|
|
2
|
+
import { AnalyticsPlugin } from "analytics";
|
|
3
|
+
export declare const parseQuery: (qs?: string) => Record<string, string>;
|
|
4
|
+
export declare type StorageFactory = (cookieDomain: string, cookie2key: Record<string, string>) => PersistentStorage;
|
|
5
|
+
export declare function getTopLevelDomain(opts?: JitsuOptions): string;
|
|
6
|
+
export declare function windowRuntime(opts: JitsuOptions): RuntimeFacade;
|
|
7
|
+
export declare const emptyRuntime: (config: JitsuOptions) => RuntimeFacade;
|
|
8
|
+
declare const jitsuAnalyticsPlugin: (pluginConfig?: JitsuOptions) => AnalyticsPlugin;
|
|
9
|
+
export declare function randomId(hashString?: string | undefined): string;
|
|
10
|
+
export default jitsuAnalyticsPlugin;
|
package/dist/index.d.ts
ADDED
package/dist/jitsu.cjs.js
CHANGED
|
@@ -459,4 +459,9 @@ function jitsuAnalytics(opts) {
|
|
|
459
459
|
return analytics;
|
|
460
460
|
}
|
|
461
461
|
|
|
462
|
+
exports.emptyRuntime = emptyRuntime;
|
|
463
|
+
exports.getTopLevelDomain = getTopLevelDomain;
|
|
462
464
|
exports.jitsuAnalytics = jitsuAnalytics;
|
|
465
|
+
exports.parseQuery = parseQuery;
|
|
466
|
+
exports.randomId = randomId;
|
|
467
|
+
exports.windowRuntime = windowRuntime;
|
package/dist/jitsu.d.ts
CHANGED
|
@@ -1,50 +1,42 @@
|
|
|
1
|
-
import { AnalyticsInterface } from "@jitsu/protocols/analytics";
|
|
1
|
+
import type { AnalyticsInterface } from "@jitsu/protocols/analytics";
|
|
2
2
|
import type { AnalyticsPlugin } from "analytics";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
runtime?: RuntimeFacade;
|
|
3
|
+
declare type JitsuOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* API Key. Optional. If not set, Jitsu will send event to the server without auth, and server
|
|
6
|
+
* will link the call to configured source by domain name
|
|
7
|
+
*/
|
|
8
|
+
writeKey?: string;
|
|
9
|
+
/**
|
|
10
|
+
* API Host. Default value: same host as script origin
|
|
11
|
+
*/
|
|
12
|
+
host?: string;
|
|
13
|
+
debug?: boolean;
|
|
14
|
+
cookieDomain?: string;
|
|
15
|
+
fetch?: typeof fetch;
|
|
16
|
+
runtime?: RuntimeFacade;
|
|
18
17
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
removeItem: (key: string, options?: any) => void;
|
|
18
|
+
declare type PersistentStorage = {
|
|
19
|
+
getItem: (key: string, options?: any) => any;
|
|
20
|
+
setItem: (key: string, value: any, options?: any) => void;
|
|
21
|
+
removeItem: (key: string, options?: any) => void;
|
|
24
22
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
screen():
|
|
34
|
-
| {
|
|
23
|
+
declare type RuntimeFacade = {
|
|
24
|
+
store(): PersistentStorage;
|
|
25
|
+
userAgent(): string | undefined;
|
|
26
|
+
language(): string | undefined;
|
|
27
|
+
pageUrl(): string | undefined;
|
|
28
|
+
documentEncoding(): string | undefined;
|
|
29
|
+
timezoneOffset(): number | undefined;
|
|
30
|
+
screen(): {
|
|
35
31
|
width: number;
|
|
36
32
|
height: number;
|
|
37
33
|
innerWidth: number;
|
|
38
34
|
innerHeight: number;
|
|
39
35
|
density: number;
|
|
40
|
-
|
|
41
|
-
| undefined;
|
|
42
|
-
|
|
43
|
-
pageTitle(): string | undefined;
|
|
36
|
+
} | undefined;
|
|
37
|
+
referrer(): string | undefined;
|
|
38
|
+
pageTitle(): string | undefined;
|
|
44
39
|
};
|
|
45
|
-
|
|
46
|
-
declare
|
|
47
|
-
|
|
48
|
-
declare const jitsuAnalyticsPlugin: AnalyticsPlugin;
|
|
49
|
-
|
|
50
|
-
export { AnalyticsInterface, JitsuOptions, PersistentStorage, RuntimeFacade, jitsuAnalytics, jitsuAnalyticsPlugin };
|
|
40
|
+
export declare function jitsuAnalytics(opts: JitsuOptions): AnalyticsInterface;
|
|
41
|
+
export declare const jitsuAnalyticsPlugin: AnalyticsPlugin;
|
|
42
|
+
export { AnalyticsInterface, JitsuOptions, PersistentStorage, RuntimeFacade };
|
package/dist/jitsu.es.js
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jitsu/js",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.126",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Jitsu Dev Team <dev@jitsu.com>",
|
|
6
6
|
"main": "dist/jitsu.cjs.js",
|
|
7
7
|
"module": "dist/jitsu.es.js",
|
|
8
|
-
"types": "dist/
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"node-forge": "^1.3.1",
|
|
33
33
|
"raw-loader": "^4.0.2",
|
|
34
34
|
"rollup": "^3.2.5",
|
|
35
|
-
"ts-jest": "^29.0.3"
|
|
36
|
-
"@jitsu/protocols": "0.0.1-alpha.122"
|
|
35
|
+
"ts-jest": "^29.0.3"
|
|
37
36
|
},
|
|
38
37
|
"dependencies": {
|
|
39
|
-
"analytics": "^0.8.1"
|
|
38
|
+
"analytics": "^0.8.1",
|
|
39
|
+
"@jitsu/protocols": "0.0.1-alpha.126"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"clean": "rm -rf ./dist",
|
|
@@ -44,6 +44,6 @@
|
|
|
44
44
|
"test:playwright": "playwright test ./__tests__/playwright",
|
|
45
45
|
"test": "pnpm run test:node && pnpm run test:playwright",
|
|
46
46
|
"compile": "tsc -p .",
|
|
47
|
-
"build": "tsc -p . && rollup -c && cp src
|
|
47
|
+
"build": "tsc -p . && rollup -c && cp compiled/src/*.d.ts dist"
|
|
48
48
|
}
|
|
49
49
|
}
|
package/rollup.config.js
CHANGED
|
@@ -6,7 +6,7 @@ const terser = require("@rollup/plugin-terser");
|
|
|
6
6
|
|
|
7
7
|
module.exports = [
|
|
8
8
|
{
|
|
9
|
-
plugins: [multi(), resolve({ preferBuiltins: false }), commonjs(), rollupJson()
|
|
9
|
+
plugins: [multi(), resolve({ preferBuiltins: false }), commonjs(), rollupJson()],
|
|
10
10
|
input: "./compiled/src/browser.js",
|
|
11
11
|
output: {
|
|
12
12
|
file: `dist/web/p.js.txt`,
|
|
@@ -16,7 +16,7 @@ module.exports = [
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
plugins: [multi(), resolve({ preferBuiltins: false }), commonjs(), rollupJson()],
|
|
19
|
-
input: "./compiled/src/index.js",
|
|
19
|
+
input: ["./compiled/src/index.js", "./compiled/src/jitsu.js", "./compiled/src/analytics-plugin.js"],
|
|
20
20
|
output: [
|
|
21
21
|
{ file: "dist/jitsu.es.js", format: "es" },
|
|
22
22
|
{ file: "dist/jitsu.cjs.js", format: "cjs" },
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AnalyticsInterface } from "@jitsu/protocols/analytics.d";
|
|
2
1
|
import Analytics from "analytics";
|
|
3
|
-
import { JitsuOptions,
|
|
2
|
+
import { JitsuOptions, AnalyticsInterface } from "./jitsu";
|
|
4
3
|
import jitsuAnalyticsPlugin, { emptyRuntime, windowRuntime } from "./analytics-plugin";
|
|
5
4
|
|
|
6
5
|
export default function parse(input) {
|
|
@@ -44,3 +43,6 @@ export function jitsuAnalytics(opts: JitsuOptions): AnalyticsInterface {
|
|
|
44
43
|
};
|
|
45
44
|
return analytics;
|
|
46
45
|
}
|
|
46
|
+
|
|
47
|
+
export * from "./jitsu";
|
|
48
|
+
export * from "./analytics-plugin";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsInterface } from "@jitsu/protocols/analytics";
|
|
1
|
+
import type { AnalyticsInterface } from "@jitsu/protocols/analytics";
|
|
2
2
|
import type { AnalyticsPlugin } from "analytics";
|
|
3
3
|
|
|
4
4
|
type JitsuOptions = {
|
|
@@ -43,8 +43,8 @@ type RuntimeFacade = {
|
|
|
43
43
|
pageTitle(): string | undefined;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
declare function jitsuAnalytics(opts: JitsuOptions): AnalyticsInterface;
|
|
46
|
+
export declare function jitsuAnalytics(opts: JitsuOptions): AnalyticsInterface;
|
|
47
47
|
|
|
48
|
-
declare const jitsuAnalyticsPlugin: AnalyticsPlugin;
|
|
48
|
+
export declare const jitsuAnalyticsPlugin: AnalyticsPlugin;
|
|
49
49
|
|
|
50
|
-
export { AnalyticsInterface, JitsuOptions, PersistentStorage, RuntimeFacade
|
|
50
|
+
export { AnalyticsInterface, JitsuOptions, PersistentStorage, RuntimeFacade };
|