chore(web): remove dead staging environment artifacts#14325
Merged
Conversation
|
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>
79b00d2 to
9770c0a
Compare
Contributor
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-14325.audius.workers.dev Unique preview for this PR (deployed from this branch). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Staging is no longer a deployment target. The
Environmenttype 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.
Web (commit 1) — 3ea3edec09
packages/web/env/.env.stage(setsVITE_ENVIRONMENT=staging, would crash the app)packages/web/bundlesize.stage.config.json(orphaned)case 'staging':arms in 3 SSR helpers:getPublicUrl)getApiUrl)getApiUrl)Desktop (commit 2) — 8044dd330e
--envCLI flag is restricted to/^(production)$/iandelectron.jsonly handleslocalhostandproduction.Embed (commit 3) — 23b0dc9d29
packages/embed/.env.stagepackages/embed/.env.dev:VITE_HOSTNAME_REDIRECT:redirect.staging.audius.co→audius.coVITE_IDENTITY_ENDPOINT: staging URL →http://audius-identity-service-1(matches local docker pattern)embed:stagefrom root package.json — was already broken (called nonexistentstart:stage -w embed)npx wrangler publish --env stagingexample from packages/embed/README.mdbuild-stagingfrompackages/embed/.gitignoreand.eslintignorePre-existing lint fixes (commit 4) — 9770c0ad43
npm run verifyfrom repo root surfaced pre-existing lint errors onorigin/mainin 6 files unrelated to staging cleanup. All were either auto-fixable (import order, prettier) or trivial (one duplicateexport *line). Bundled here so the verify gate stays green:packages/common/src/api/tan-query/events/index.ts(duplicateexport * from './useUserRemixContests')packages/common/src/api/tan-query/events/useAllRemixContests.tspackages/common/src/api/tan-query/notifications/useNotifications.tspackages/common/src/api/tan-query/remixes/useRemixes.tspackages/common/src/api/tan-query/remixes/useRemixesLineup.tspackages/common/src/store/playback/slice.test.tsVerification
npm run verifyfrom 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.stageand rootdashboard:stagescriptandroid:stage/ios:stagescriptspackages/discovery-provider/scripts/createSenderPublic.tsstaging discovery URLsmonitoring/README.mddoc referenceTest plan
origin/mainnpm run verifyfrom repo root passes (20/20 tasks)npm run webstill starts cleanly (post-restructure on main)npm run embed:prodstill starts cleanly🤖 Generated with Claude Code