@gurulu/cli 0.3.2 → 0.3.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gurulu/cli",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Gurulu.io CLI — setup analytics in seconds",
5
5
  "bin": {
6
6
  "gurulu": "bin/gurulu.js"
@@ -138,7 +138,7 @@ async function runPatchMode(repoRoot, args) {
138
138
  siteId: args['site-id'],
139
139
  tenantId: args['tenant-id'],
140
140
  publishableKey: args['publishable-key'] || '',
141
- scriptSrc: args['script-src'] || '/gurulu-tracker.js',
141
+ scriptSrc: args['script-src'] || 'https://gurulu.io/t.js',
142
142
  });
143
143
  const plan = patcher.plan({ repoRoot, injection });
144
144
  log(`Framework: ${patcher.name}`);
@@ -88,7 +88,7 @@ function buildInjection(opts) {
88
88
  const siteId = opts.siteId || '';
89
89
  const tenantId = opts.tenantId || '';
90
90
  const publishableKey = opts.publishableKey || '';
91
- const src = opts.scriptSrc || '/gurulu-tracker.js';
91
+ const src = opts.scriptSrc || 'https://gurulu.io/t.js';
92
92
  return { siteId, tenantId, publishableKey, scriptSrc: src };
93
93
  }
94
94
 
@@ -61,6 +61,8 @@ function ensureScriptImport(source) {
61
61
 
62
62
  function injectScriptTag(source, injection) {
63
63
  if (source.includes(MARKER)) return source; // idempotent
64
+ // Also detect existing tracker tags (manual or from other install methods)
65
+ if (source.includes('data-site-id=') || source.includes('data-gurulu-site-id=') || source.includes('/t.js')) return source;
64
66
  const tag = buildScriptTag(injection);
65
67
  // Prefer to insert just before </body>. Fall back to before the closing
66
68
  // top-level fragment/element.