diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0c6bbe8ec9..b079cf05c5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,6 +44,7 @@ repos: .*boilerplate.*| frappe/www/website_script.js| frappe/templates/includes/.*| + .*telemetry.bundle.js| frappe/public/js/lib/.* )$ diff --git a/frappe/hooks.py b/frappe/hooks.py index a3355d5455..5967486824 100644 --- a/frappe/hooks.py +++ b/frappe/hooks.py @@ -29,6 +29,7 @@ app_include_js = [ "form.bundle.js", "controls.bundle.js", "report.bundle.js", + "telemetry.bundle.js", ] app_include_css = [ "desk.bundle.css", @@ -419,3 +420,7 @@ after_job = [ "frappe.monitor.stop", "frappe.utils.file_lock.release_document_locks", ] + +extend_bootinfo = [ + "frappe.utils.telemetry.add_bootinfo", +] diff --git a/frappe/public/js/lib/posthog.js b/frappe/public/js/lib/posthog.js new file mode 100644 index 0000000000..34ecee9799 --- /dev/null +++ b/frappe/public/js/lib/posthog.js @@ -0,0 +1 @@ +!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags".split(" "),n=0;n