-
Notifications
You must be signed in to change notification settings - Fork 58
Amp 145286 use pnpm #1445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Amp 145286 use pnpm #1445
Conversation
This reverts commit a7cdb0a.
Migrate the repository to PNPM and update CI workflows, Husky hooks, workspace config, and internal package references to use PNPM 10.26.1 with setup-node v4 cachingSwitch build, test, lint, and docs commands from 🖇️ Linked IssuesResolves AMP-145286 under the AMP-145285 epic and supports the AMP-91393 initiative by migrating the monorepo to PNPM. 📍Where to StartStart with the workspace and CI entry points: pnpm-workspace.yaml, package.json, and CI workflows in .github/workflows/ci.yml and .github/workflows/ci-nx.yml; then review the Macroscope summarized 93b19e5. (Automatic summaries will resume when PR exits draft mode or review begins). |
| const targetingResult = await evaluateTargetingPackage({ | ||
| ...targetingParams, | ||
| flag: targetingConfig, | ||
| sessionId: sessionId, | ||
| sessionId: typeof sessionId === 'string' ? parseInt(sessionId, 10) : sessionId, | ||
| apiKey: apiKey, | ||
| loggerProvider: loggerProvider, | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Guard values before parseInt or substring to avoid NaN and runtime errors; skip/omit when inputs are invalid.
- const targetingResult = await evaluateTargetingPackage({
- ...targetingParams,
- flag: targetingConfig,
- sessionId: typeof sessionId === 'string' ? parseInt(sessionId, 10) : sessionId,
- apiKey: apiKey,
- loggerProvider: loggerProvider,
- });
+ const parsedSessionId = typeof sessionId === 'string' ? Number.parseInt(sessionId, 10) : sessionId;
+ const targetingResult = await evaluateTargetingPackage({
+ ...targetingParams,
+ flag: targetingConfig,
+ ...(typeof parsedSessionId === 'number' && !Number.isNaN(parsedSessionId) ? { sessionId: parsedSessionId } : {}),
+ apiKey: apiKey,
+ loggerProvider: loggerProvider,
+ });🚀 Want me to fix this? Reply ex: "fix it for me".
| - name: Lint all packages | ||
| run: | | ||
| yarn lint | ||
| pnpm lint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build action uses pnpm without installing it first
The composite action was updated to use pnpm install, pnpm build, pnpm test, and pnpm lint commands, but no step was added to install pnpm (using pnpm/action-setup@v4). The publish-v2.yml workflow uses this action without setting up pnpm first, which will cause the publish workflow to fail with "command not found" errors. Other workflows like ci.yml and ci-nx.yml were correctly updated to include the pnpm setup step, but this action was not.
| yarn build:vite | ||
| yarn start --port 5173 & | ||
| pnpm build:vite | ||
| pnpm start --port 5173 & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pnpm won’t pass --port to the start script without --. Consider pnpm start -- --port 5173 so the arg reaches the app.
| pnpm start --port 5173 & | |
| pnpm start -- --port 5173 & |
🚀 Want me to fix this? Reply ex: "fix it for me".
Summary
Checklist
Note
Tooling/CI
pnpmacross GitHub Actions, Husky hooks, and docs; addpnpmsetup/caching and upgradeactions/setup-nodeto v4package.jsonnow declarespackageManager: pnpm; all package scripts updated to usepnpmWorkspace/deps
workspace:*and update tests/imports to use@amplitude/analytics-coreinstead of deprecated packagesCore/API surface
InstanceProxyand related types via newanalytics-core/src/types/proxy.ts; re-export inanalytics-core/src/index.tsTests/config
tsconfig.jsonwith Jest/Node types to several packages; adjust React Native JesttransformIgnorePatternsfor pnpmSession Replay
getDebugConfigreturnSessionReplayJoinedConfig; parse stringsessionIdto number in targeting flow with test coverageWorkflows
ci,ci-nx,docs, ande2eworkflows to usepnpmfor install/build/test and docs generationWritten by Cursor Bugbot for commit 93b19e5. This will update automatically on new commits. Configure here.