Skip to content

refactor: remove analytics-types from workspace - #1906

Draft
daniel-graham-amplitude wants to merge 2 commits into
SDK-144-migrate-common-to-corefrom
SDK-144-remove-analytics-types
Draft

refactor: remove analytics-types from workspace#1906
daniel-graham-amplitude wants to merge 2 commits into
SDK-144-migrate-common-to-corefrom
SDK-144-remove-analytics-types

Conversation

@daniel-graham-amplitude

@daniel-graham-amplitude daniel-graham-amplitude commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Delete packages/analytics-types
  • Replace any references to "analytics-types: workspace" with the latest version in npm (2.11.1)

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: No

Note

Medium Risk
Monorepo-wide type source changes (workspace vs fixed npm) can cause subtle type or duplicate-package issues at build time, though runtime behavior should match 2.11.1.

Overview
Removes the in-repo packages/analytics-types package entirely and stops treating shared SDK types as a workspace member.

plugin-global-user-properties, plugin-session-replay-browser, plugin-web-attribution-browser, session-replay-browser, and targeting now depend on the published npm package @amplitude/analytics-types@2.11.1 instead of workspace:*, with pnpm-lock.yaml updated to match.

scripts/check-deprecated-packages.sh no longer fails PRs that touch packages/analytics-types, since that directory is gone; it still blocks new deprecated package dependencies in package.json.

Reviewed by Cursor Bugbot for commit 59570ce. Bugbot is set up for automated code reviews on this repo. Configure here.

@daniel-graham-amplitude
daniel-graham-amplitude requested review from a team as code owners July 23, 2026 23:57
@linear-code

linear-code Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

SDK-144

@daniel-graham-amplitude
daniel-graham-amplitude changed the base branch from main to SDK-144-migrate-common-to-core July 23, 2026 23:58
@daniel-graham-amplitude
daniel-graham-amplitude force-pushed the SDK-144-remove-analytics-types branch from 333655e to 59570ce Compare July 23, 2026 23:59

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Deprecated package path check removed
    • Restored the deprecated directory diff guard while allowing the intentional deletion of packages/analytics-types.

Create PR

Or push these changes by commenting:

@cursor push c902e9e7ac
Preview (c902e9e7ac)
diff --git a/scripts/check-deprecated-packages.sh b/scripts/check-deprecated-packages.sh
--- a/scripts/check-deprecated-packages.sh
+++ b/scripts/check-deprecated-packages.sh
@@ -8,10 +8,25 @@
 set -e
 
 DEPRECATED_PACKAGES=("@amplitude/analytics-types" "@amplitude/analytics-remote-config")
+DEPRECATED_PACKAGE_DIRS=("packages/analytics-types")
 FAILED=0
 
 echo "Checking for new usage of deprecated packages..."
 
+# Allow deprecated packages to be deleted, but reject all other changes.
+echo "Checking for code changes in deprecated packages..."
+for DIR in "${DEPRECATED_PACKAGE_DIRS[@]}"; do
+  CHANGED_IN_DIR=$(git diff --diff-filter=d --name-only origin/${GITHUB_BASE_REF:-main}...HEAD | grep "^$DIR/" || true)
+
+  if [ -n "$CHANGED_IN_DIR" ]; then
+    echo "❌ ERROR: Code changes detected in deprecated package '$DIR'"
+    echo "Changed files:"
+    echo "$CHANGED_IN_DIR" | sed 's/^/   - /'
+    echo ""
+    FAILED=1
+  fi
+done
+
 # Get the list of changed package.json files
 CHANGED_FILES=$(git diff --name-only origin/${GITHUB_BASE_REF:-main}...HEAD | grep 'package.json$' || true)

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 59570ce. Configure here.

FAILED=1
fi
done

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecated package path check removed

Medium Severity

The deprecated-package CI script no longer inspects git diffs for changes under packages/analytics-types/, but the header and success output still claim that policy is enforced. A follow-up PR could reintroduce or edit that tree without failing check-deprecated-packages, even though CONTRIBUTING and the failure text still forbid it.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 59570ce. Configure here.

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

size-limit report 📦

Path Size
packages/analytics-browser/lib/scripts/amplitude-min.js.gz 61.24 KB (0%)
packages/session-replay-browser/lib/scripts/session-replay-browser-min.js.gz 134.97 KB (0%)
packages/unified/lib/scripts/amplitude-min.umd.js.gz 215.29 KB (0%)
@amplitude/element-selector (gzipped esm) 2.67 KB (0%)

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

Session Replay Browser E2E Results

passed  153 passed
flaky  1 flaky

Details

stats  154 tests across 17 suites
duration  4 minutes, 30 seconds
commit  59570ce

Flaky tests

chromium › e2e/trc-url-rule.spec.ts › TRC URL rule — happy path › starts recording after SPA navigation to a matching URL

@Mercy811

Copy link
Copy Markdown
Contributor

@daniel-graham-amplitude
daniel-graham-amplitude marked this pull request as draft July 24, 2026 16:18
@daniel-graham-amplitude
daniel-graham-amplitude force-pushed the SDK-144-migrate-common-to-core branch from 664db0a to ed1890f Compare July 29, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants