This directory contains utility scripts for the Amplitude TypeScript monorepo.
Runs in CI to prevent new dependencies on deprecated packages.
Deprecated packages:
@amplitude/analytics-types@amplitude/analytics-client-common@amplitude/analytics-remote-config
Replacements:
- For
@amplitude/analytics-typesand@amplitude/analytics-client-common: Use@amplitude/analytics-core - For
@amplitude/analytics-remote-config: Use the new remote config client in@amplitude/analytics-core
How it works:
- Compares
package.jsonfiles between the base branch and PR branch - Detects new dependencies on deprecated packages
- Allows existing dependencies to remain (grandfathered in)
- Fails the CI build if new usage is detected
Running locally:
# Requires a git repository with a base branch to compare against
GITHUB_BASE_REF=main bash scripts/check-deprecated-packages.shTesting the script: To test if the check would catch a new dependency:
- Add a deprecated package to a
package.jsonfile - Run the script with your base branch:
GITHUB_BASE_REF=main bash scripts/check-deprecated-packages.sh - The script should fail and report the new dependency
- Revert your test changes
CI Integration:
This check runs automatically on all pull requests via the check-deprecated-packages job in .github/workflows/ci-nx.yml.