@intlayer/analytics 9.3.2 → 9.4.0-canary.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/README.md CHANGED
@@ -327,4 +327,4 @@ Contribute on [GitHub](https://github.com/aymericzip/intlayer), [GitLab](https:/
327
327
 
328
328
  If you like Intlayer, give us a ⭐ on GitHub. It helps others discover the project! [See why GitHub Stars matter](https://github.com/aymericzip/intlayer/blob/main/CONTRIBUTING.md#why-github-stars-matter-).
329
329
 
330
- [![Star History Chart](https://api.star-history.com/svg?repos=aymericzip/intlayer&type=Date)](https://star-history.com/#aymericzip/intlayer&Date)
330
+ [![Star History Chart](https://star-history.dera.page/svg?repos=aymericzip/intlayer&type=Date)](https://star-history.dera.page/#aymericzip/intlayer&Date)
@@ -5,8 +5,9 @@ let _intlayer_config_built = require("@intlayer/config/built");
5
5
  /**
6
6
  * Compile-time kill switch. Bundlers replace `process.env.INTLAYER_ANALYTICS_ENABLED`
7
7
  * (set to `'false'` by `@intlayer/config` unless `analytics.enabled` is `true`
8
- * AND an `editor.clientId` is configured) so the whole analytics integration is
9
- * dead-code-eliminated for apps that don't opt in.
8
+ * — the default once this package is installed — AND an `editor.clientId` is
9
+ * configured) so the whole analytics integration is dead-code-eliminated for
10
+ * apps that opted out.
10
11
  */
11
12
  const TREE_SHAKE_ANALYTICS = process.env.INTLAYER_ANALYTICS_ENABLED === "false";
12
13
  /**
@@ -17,7 +18,7 @@ const TREE_SHAKE_ANALYTICS = process.env.INTLAYER_ANALYTICS_ENABLED === "false";
17
18
  *
18
19
  * Enabled when:
19
20
  * - the bundler did not tree-shake analytics away, and
20
- * - the user opted in (`analytics.enabled === true`), and
21
+ * - the user did not opt out (`analytics.enabled === true`, the default), and
21
22
  * - a project key is configured (`editor.clientId`), and
22
23
  * - we are on the client, and
23
24
  * - we are the top window (not embedded in the editor).
@@ -1 +1 @@
1
- {"version":3,"file":"isEnabled.cjs","names":["analytics","editor"],"sources":["../../src/isEnabled.ts"],"sourcesContent":["import { analytics, editor } from '@intlayer/config/built';\n\n/**\n * Compile-time kill switch. Bundlers replace `process.env.INTLAYER_ANALYTICS_ENABLED`\n * (set to `'false'` by `@intlayer/config` unless `analytics.enabled` is `true`\n * AND an `editor.clientId` is configured) so the whole analytics integration is\n * dead-code-eliminated for apps that don't opt in.\n */\nconst TREE_SHAKE_ANALYTICS = process.env.INTLAYER_ANALYTICS_ENABLED === 'false';\n\n/**\n * Runtime guard mirroring `@intlayer/editor`'s `isEnabled`, but inverted with\n * respect to the iframe: analytics runs for real end users on the **top**\n * window and stays off inside the editor/CMS preview iframe so editor sessions\n * are never counted as traffic.\n *\n * Enabled when:\n * - the bundler did not tree-shake analytics away, and\n * - the user opted in (`analytics.enabled === true`), and\n * - a project key is configured (`editor.clientId`), and\n * - we are on the client, and\n * - we are the top window (not embedded in the editor).\n */\nexport const isEnabled =\n !TREE_SHAKE_ANALYTICS &&\n analytics?.enabled === true &&\n Boolean(editor?.clientId) &&\n typeof window !== 'undefined' &&\n window.self === window.top;\n"],"mappings":";;;;;;;;;;AAQA,MAAM,uBAAuB,QAAQ,IAAI,+BAA+B;;;;;;;;;;;;;;AAexE,MAAa,YACX,CAAC,wBACDA,kCAAW,YAAY,QACvB,QAAQC,+BAAQ,QAAQ,KACxB,OAAO,WAAW,eAClB,OAAO,SAAS,OAAO"}
1
+ {"version":3,"file":"isEnabled.cjs","names":["analytics","editor"],"sources":["../../src/isEnabled.ts"],"sourcesContent":["import { analytics, editor } from '@intlayer/config/built';\n\n/**\n * Compile-time kill switch. Bundlers replace `process.env.INTLAYER_ANALYTICS_ENABLED`\n * (set to `'false'` by `@intlayer/config` unless `analytics.enabled` is `true`\n * — the default once this package is installed — AND an `editor.clientId` is\n * configured) so the whole analytics integration is dead-code-eliminated for\n * apps that opted out.\n */\nconst TREE_SHAKE_ANALYTICS = process.env.INTLAYER_ANALYTICS_ENABLED === 'false';\n\n/**\n * Runtime guard mirroring `@intlayer/editor`'s `isEnabled`, but inverted with\n * respect to the iframe: analytics runs for real end users on the **top**\n * window and stays off inside the editor/CMS preview iframe so editor sessions\n * are never counted as traffic.\n *\n * Enabled when:\n * - the bundler did not tree-shake analytics away, and\n * - the user did not opt out (`analytics.enabled === true`, the default), and\n * - a project key is configured (`editor.clientId`), and\n * - we are on the client, and\n * - we are the top window (not embedded in the editor).\n */\nexport const isEnabled =\n !TREE_SHAKE_ANALYTICS &&\n analytics?.enabled === true &&\n Boolean(editor?.clientId) &&\n typeof window !== 'undefined' &&\n window.self === window.top;\n"],"mappings":";;;;;;;;;;;AASA,MAAM,uBAAuB,QAAQ,IAAI,+BAA+B;;;;;;;;;;;;;;AAexE,MAAa,YACX,CAAC,wBACDA,kCAAW,YAAY,QACvB,QAAQC,+BAAQ,QAAQ,KACxB,OAAO,WAAW,eAClB,OAAO,SAAS,OAAO"}
@@ -4,8 +4,9 @@ import { analytics, editor } from "@intlayer/config/built";
4
4
  /**
5
5
  * Compile-time kill switch. Bundlers replace `process.env.INTLAYER_ANALYTICS_ENABLED`
6
6
  * (set to `'false'` by `@intlayer/config` unless `analytics.enabled` is `true`
7
- * AND an `editor.clientId` is configured) so the whole analytics integration is
8
- * dead-code-eliminated for apps that don't opt in.
7
+ * — the default once this package is installed — AND an `editor.clientId` is
8
+ * configured) so the whole analytics integration is dead-code-eliminated for
9
+ * apps that opted out.
9
10
  */
10
11
  const TREE_SHAKE_ANALYTICS = process.env.INTLAYER_ANALYTICS_ENABLED === "false";
11
12
  /**
@@ -16,7 +17,7 @@ const TREE_SHAKE_ANALYTICS = process.env.INTLAYER_ANALYTICS_ENABLED === "false";
16
17
  *
17
18
  * Enabled when:
18
19
  * - the bundler did not tree-shake analytics away, and
19
- * - the user opted in (`analytics.enabled === true`), and
20
+ * - the user did not opt out (`analytics.enabled === true`, the default), and
20
21
  * - a project key is configured (`editor.clientId`), and
21
22
  * - we are on the client, and
22
23
  * - we are the top window (not embedded in the editor).
@@ -1 +1 @@
1
- {"version":3,"file":"isEnabled.mjs","names":[],"sources":["../../src/isEnabled.ts"],"sourcesContent":["import { analytics, editor } from '@intlayer/config/built';\n\n/**\n * Compile-time kill switch. Bundlers replace `process.env.INTLAYER_ANALYTICS_ENABLED`\n * (set to `'false'` by `@intlayer/config` unless `analytics.enabled` is `true`\n * AND an `editor.clientId` is configured) so the whole analytics integration is\n * dead-code-eliminated for apps that don't opt in.\n */\nconst TREE_SHAKE_ANALYTICS = process.env.INTLAYER_ANALYTICS_ENABLED === 'false';\n\n/**\n * Runtime guard mirroring `@intlayer/editor`'s `isEnabled`, but inverted with\n * respect to the iframe: analytics runs for real end users on the **top**\n * window and stays off inside the editor/CMS preview iframe so editor sessions\n * are never counted as traffic.\n *\n * Enabled when:\n * - the bundler did not tree-shake analytics away, and\n * - the user opted in (`analytics.enabled === true`), and\n * - a project key is configured (`editor.clientId`), and\n * - we are on the client, and\n * - we are the top window (not embedded in the editor).\n */\nexport const isEnabled =\n !TREE_SHAKE_ANALYTICS &&\n analytics?.enabled === true &&\n Boolean(editor?.clientId) &&\n typeof window !== 'undefined' &&\n window.self === window.top;\n"],"mappings":";;;;;;;;;AAQA,MAAM,uBAAuB,QAAQ,IAAI,+BAA+B;;;;;;;;;;;;;;AAexE,MAAa,YACX,CAAC,wBACD,WAAW,YAAY,QACvB,QAAQ,QAAQ,QAAQ,KACxB,OAAO,WAAW,eAClB,OAAO,SAAS,OAAO"}
1
+ {"version":3,"file":"isEnabled.mjs","names":[],"sources":["../../src/isEnabled.ts"],"sourcesContent":["import { analytics, editor } from '@intlayer/config/built';\n\n/**\n * Compile-time kill switch. Bundlers replace `process.env.INTLAYER_ANALYTICS_ENABLED`\n * (set to `'false'` by `@intlayer/config` unless `analytics.enabled` is `true`\n * — the default once this package is installed — AND an `editor.clientId` is\n * configured) so the whole analytics integration is dead-code-eliminated for\n * apps that opted out.\n */\nconst TREE_SHAKE_ANALYTICS = process.env.INTLAYER_ANALYTICS_ENABLED === 'false';\n\n/**\n * Runtime guard mirroring `@intlayer/editor`'s `isEnabled`, but inverted with\n * respect to the iframe: analytics runs for real end users on the **top**\n * window and stays off inside the editor/CMS preview iframe so editor sessions\n * are never counted as traffic.\n *\n * Enabled when:\n * - the bundler did not tree-shake analytics away, and\n * - the user did not opt out (`analytics.enabled === true`, the default), and\n * - a project key is configured (`editor.clientId`), and\n * - we are on the client, and\n * - we are the top window (not embedded in the editor).\n */\nexport const isEnabled =\n !TREE_SHAKE_ANALYTICS &&\n analytics?.enabled === true &&\n Boolean(editor?.clientId) &&\n typeof window !== 'undefined' &&\n window.self === window.top;\n"],"mappings":";;;;;;;;;;AASA,MAAM,uBAAuB,QAAQ,IAAI,+BAA+B;;;;;;;;;;;;;;AAexE,MAAa,YACX,CAAC,wBACD,WAAW,YAAY,QACvB,QAAQ,QAAQ,QAAQ,KACxB,OAAO,WAAW,eAClB,OAAO,SAAS,OAAO"}
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Enabled when:
9
9
  * - the bundler did not tree-shake analytics away, and
10
- * - the user opted in (`analytics.enabled === true`), and
10
+ * - the user did not opt out (`analytics.enabled === true`, the default), and
11
11
  * - a project key is configured (`editor.clientId`), and
12
12
  * - we are on the client, and
13
13
  * - we are the top window (not embedded in the editor).
@@ -1 +1 @@
1
- {"version":3,"file":"isEnabled.d.ts","names":[],"sources":["../../src/isEnabled.ts"],"mappings":";;;;;;;;;;;;;;cAuBa"}
1
+ {"version":3,"file":"isEnabled.d.ts","names":[],"sources":["../../src/isEnabled.ts"],"mappings":";;;;;;;;;;;;;;cAwBa"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/analytics",
3
- "version": "9.3.2",
3
+ "version": "9.4.0-canary.0",
4
4
  "private": false,
5
5
  "description": "Collects which Intlayer content is shown (page/locale + node-level) and powers content A/B testing. Optional, lazily-imported companion to @intlayer/editor.",
6
6
  "keywords": [
@@ -80,9 +80,9 @@
80
80
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
81
81
  },
82
82
  "dependencies": {
83
- "@intlayer/config": "9.3.2",
84
- "@intlayer/core": "9.3.2",
85
- "@intlayer/types": "9.3.2"
83
+ "@intlayer/config": "9.4.0-canary.0",
84
+ "@intlayer/core": "9.4.0-canary.0",
85
+ "@intlayer/types": "9.4.0-canary.0"
86
86
  },
87
87
  "devDependencies": {
88
88
  "@types/node": "26.2.0",
@@ -92,7 +92,7 @@
92
92
  "rimraf": "6.1.3",
93
93
  "tsdown": "0.22.14",
94
94
  "typescript": "7.0.2",
95
- "vitest": "4.1.10"
95
+ "vitest": "4.1.11"
96
96
  },
97
97
  "engines": {
98
98
  "node": ">=14.18"