Skip to content

chore(web): remove dead staging environment artifacts#14325

Merged
dylanjeffers merged 4 commits into
mainfrom
claude/sharp-rubin-9fcb5a
May 15, 2026
Merged

chore(web): remove dead staging environment artifacts#14325
dylanjeffers merged 4 commits into
mainfrom
claude/sharp-rubin-9fcb5a

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

@dylanjeffers dylanjeffers commented May 15, 2026

Summary

Staging is no longer a deployment target. The Environment type at packages/common/src/services/env.ts:3 is 'development' | 'production' only, and the env loader at packages/web/src/services/env/index.ts throws for any other value. The leftover staging-related scripts and dead switch arms were misleading.

This is purely dead-code/config cleanup. No runtime behavior changes.

Rebased onto current origin/main. During rebase, several originally-removed scripts (web:stage, start:stage, start:ssr:stage, desktop:stage) had already been dropped on main as part of an unrelated script restructure (web/web:local, desktop/desktop:local). Those parts of the diff went away cleanly. The PR is now scoped to what's actually still needed.

Web (commit 1) — 3ea3edec09

Desktop (commit 2) — 8044dd330e

  • Removed stale "prod & stage" comment in packages/web/scripts/dist.js; the --env CLI flag is restricted to /^(production)$/i and electron.js only handles localhost and production.

Embed (commit 3) — 23b0dc9d29

  • Deleted packages/embed/.env.stage
  • Dropped staging URLs from packages/embed/.env.dev:
    • VITE_HOSTNAME_REDIRECT: redirect.staging.audius.coaudius.co
    • VITE_IDENTITY_ENDPOINT: staging URL → http://audius-identity-service-1 (matches local docker pattern)
  • Removed embed:stage from root package.json — was already broken (called nonexistent start:stage -w embed)
  • Removed npx wrangler publish --env staging example from packages/embed/README.md
  • Removed build-staging from packages/embed/.gitignore and .eslintignore

Pre-existing lint fixes (commit 4) — 9770c0ad43

npm run verify from repo root surfaced pre-existing lint errors on origin/main in 6 files unrelated to staging cleanup. All were either auto-fixable (import order, prettier) or trivial (one duplicate export * line). Bundled here so the verify gate stays green:

  • packages/common/src/api/tan-query/events/index.ts (duplicate export * from './useUserRemixContests')
  • packages/common/src/api/tan-query/events/useAllRemixContests.ts
  • packages/common/src/api/tan-query/notifications/useNotifications.ts
  • packages/common/src/api/tan-query/remixes/useRemixes.ts
  • packages/common/src/api/tan-query/remixes/useRemixesLineup.ts
  • packages/common/src/store/playback/slice.test.ts

Verification

npm run verify from repo root: 20/20 tasks succeeded (typecheck + lint + stylelint + lint:env across all packages).

Related staging artifacts left untouched (out of scope)

  • packages/protocol-dashboard/.env.stage and root dashboard:stage script
  • Mobile android:stage / ios:stage scripts
  • packages/discovery-provider/scripts/createSenderPublic.ts staging discovery URLs
  • monitoring/README.md doc reference

Test plan

  • Branch rebased cleanly onto origin/main
  • npm run verify from repo root passes (20/20 tasks)
  • CI passes
  • npm run web still starts cleanly (post-restructure on main)
  • npm run embed:prod still starts cleanly

🤖 Generated with Claude Code

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 15, 2026

⚠️ No Changeset found

Latest commit: 9770c0a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

dylanjeffers and others added 4 commits May 15, 2026 10:47
Staging is no longer a deployment target. The Environment type in
packages/common/src/services/env.ts is already 'development' | 'production'
only, and the env loader at packages/web/src/services/env/index.ts throws
for any other value. The staging-related scripts and dead switch arms
were misleading — invoking npm run web:stage would crash the app at
startup.

- Delete packages/web/env/.env.stage
- Delete packages/web/bundlesize.stage.config.json (unused)
- Remove start:stage and start:ssr:stage from packages/web/package.json
- Remove web:stage from root package.json
- Remove unreachable case 'staging' arms from SSR helpers:
  metaTags.ts, contest/+onBeforeRender.tsx, remixes/+onBeforeRender.tsx
  (track/collection/profile already had this case removed)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The desktop app is Electron wrapping packages/web; there is no separate
packages/desktop/. Remaining staging references after the prior commit:

- desktop:stage script in root package.json — invoked the now-removed
  start:stage -w @audius/web (already non-functional before that
  removal, since the env loader throws for VITE_ENVIRONMENT=staging).
- Stale comment in packages/web/scripts/dist.js referencing "prod & stage"
  in code that has only production constants (the --env CLI flag is
  already restricted to /^(production)$/i).

electron.js already only handles 'localhost' and 'production' envs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The embed package had several staging references but no actual staging
target — embed:stage in root package.json invoked start:stage -w embed,
which never existed in packages/embed/package.json. Wrangler config has
only test and production environments.

- Delete packages/embed/.env.stage
- Drop staging URLs from packages/embed/.env.dev:
  - VITE_HOSTNAME_REDIRECT: redirect.staging.audius.co -> audius.co
  - VITE_IDENTITY_ENDPOINT: staging URL -> http://audius-identity-service-1
    (matches local docker pattern in web .env.dev)
- Remove embed:stage from root package.json (already broken)
- Remove "npx wrangler publish --env staging" from packages/embed/README.md
- Remove build-staging from packages/embed/.gitignore and .eslintignore
  (no script outputs to that directory)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pre-existing lint violations on origin/main were blocking
npm run verify. All mechanical eslint --fix / single-line cleanup —
no behavior changes. Bundled here so the verify gate is green.

Files (all unrelated to the staging cleanup in earlier commits):
- packages/common/src/api/tan-query/events/index.ts
  Removed duplicate `export * from './useUserRemixContests'` line
- packages/common/src/api/tan-query/events/useAllRemixContests.ts
- packages/common/src/api/tan-query/notifications/useNotifications.ts
- packages/common/src/api/tan-query/remixes/useRemixes.ts
- packages/common/src/api/tan-query/remixes/useRemixesLineup.ts
- packages/common/src/store/playback/slice.test.ts

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dylanjeffers dylanjeffers force-pushed the claude/sharp-rubin-9fcb5a branch from 79b00d2 to 9770c0a Compare May 15, 2026 17:54
@pull-request-size pull-request-size Bot added size/M and removed size/L labels May 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🌐 Web preview ready

Preview URL: https://audius-web-preview-pr-14325.audius.workers.dev

Unique preview for this PR (deployed from this branch).
Workflow run

@dylanjeffers dylanjeffers merged commit 5632898 into main May 15, 2026
14 checks passed
@dylanjeffers dylanjeffers deleted the claude/sharp-rubin-9fcb5a branch May 15, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant