Uh oh!
There was an error while loading. Please reload this page.
fix(ui): app footer layout and build environment on narrow screens - #1032
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📝 WalkthroughWalkthroughThe PR moves the BuildEnvironment component within AppFooter.vue, changes its DOM placement and rendering order, and adjusts its footer-related responsive CSS classes. BuildEnvironment.vue now accepts an optional Suggested reviewers
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
| if (process.env.TEST) { | ||
| const time = new Date() | ||
| nuxt.options.appConfig.buildInfo = { | ||
| env, | ||
| version: '0.0.0', | ||
| commit: '704987bba88909f3782d792c224bde989569acb9', | ||
| shortCommit: '704987b', | ||
| branch: 'xxx', | ||
| time: time.getTime(), | ||
| privacyPolicyDate: time.toISOString(), | ||
| } satisfies BuildInfo | ||
| } else { | ||
| const [{ env: useEnv, commit, shortCommit, branch }, privacyPolicyDate] = await Promise.all([ | ||
| getEnv(nuxt.options.dev), | ||
| getFileLastUpdated('app/pages/privacy.vue'), | ||
| ]) | ||
| env = useEnv | ||
| nuxt.options.appConfig.env = useEnv |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Search for TEST environment variable configuration
rg -n 'process\.env\.TEST|TEST\s*=' --type ts --type js --type jsonRepository: npmx-dev/npmx.dev
Length of output: 112
🏁 Script executed:
# Check if std-env is in dependencies and availableif [ -f package.json ];thenecho"=== Checking package.json for std-env ==="
rg '"std-env"' package.json
echo""fi# Look for vitest configurationecho"=== Looking for vitest config files ==="
fd -e 'vitest\.config' -e 'vite\.config'2>/dev/null | head -20Repository: npmx-dev/npmx.dev
Length of output: 168
🏁 Script executed:
# Search for vitest setup files and test configuration
rg -n 'TEST|test.*env' --type ts --type js vitest.config 2>/dev/null ||echo"No vitest.config found"Repository: npmx-dev/npmx.dev
Length of output: 83
🏁 Script executed:
# Check if std-env is imported anywhere in the codebaseecho"=== Checking imports of std-env ==="
rg "from\s+['\"]std-env" --type ts --type js
echo""echo"=== Checking process.env.TEST usage across codebase ==="
rg "process\.env\.TEST" --type ts --type js -C 2Repository: npmx-dev/npmx.dev
Length of output: 738
🏁 Script executed:
# Check NODE_ENV usage in test contextecho"=== Checking NODE_ENV usage ==="
rg "NODE_ENV\s*===\s*['\"]test" --type ts --type js
echo""echo"=== Checking test scripts in package.json ==="if [ -f package.json ];then
jq -r '.scripts | to_entries[] | select(.key | contains("test")) | "\(.key): \(.value)"' package.json 2>/dev/null || grep -A 5 '"test"' package.json
fiRepository: npmx-dev/npmx.dev
Length of output: 615
Use isTest from std-env for consistent test-mode detection.
The process.env.TEST flag is not explicitly wired in this repository's test configuration. std-env (v3.10.0) is already available and isTest is already imported and used in modules/lunaria.ts, making this the standard approach. Replace process.env.TEST with isTest to ensure test-mode logic executes reliably.
-import { isCI } from 'std-env'+import { isCI, isTest } from 'std-env'
...
- if (process.env.TEST) {+ if (isTest) {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if(process.env.TEST){ | |
| consttime=newDate() | |
| nuxt.options.appConfig.buildInfo={ | |
| env, | |
| version: '0.0.0', | |
| commit: '704987bba88909f3782d792c224bde989569acb9', | |
| shortCommit: '704987b', | |
| branch: 'xxx', | |
| time: time.getTime(), | |
| privacyPolicyDate: time.toISOString(), | |
| }satisfiesBuildInfo | |
| }else{ | |
| const[{env: useEnv, commit, shortCommit, branch },privacyPolicyDate]=awaitPromise.all([ | |
| getEnv(nuxt.options.dev), | |
| getFileLastUpdated('app/pages/privacy.vue'), | |
| ]) | |
| env=useEnv | |
| nuxt.options.appConfig.env=useEnv | |
| if(isTest){ | |
| consttime=newDate() | |
| nuxt.options.appConfig.buildInfo={ | |
| env, | |
| version: '0.0.0', | |
| commit: '704987bba88909f3782d792c224bde989569acb9', | |
| shortCommit: '704987b', | |
| branch: 'xxx', | |
| time: time.getTime(), | |
| privacyPolicyDate: time.toISOString(), | |
| }satisfiesBuildInfo | |
| }else{ | |
| const[{env: useEnv, commit, shortCommit, branch },privacyPolicyDate]=awaitPromise.all([ | |
| getEnv(nuxt.options.dev), | |
| getFileLastUpdated('app/pages/privacy.vue'), | |
| ]) | |
| env=useEnv | |
| nuxt.options.appConfig.env=useEnv |
Uh oh!
There was an error while loading. Please reload this page.
Footer links on narrow screens displayed below the build info.
This PR just moves the
BuildEnvironment.vueafter links container updating its styles to add some margins:AppFooter.vueandBuildEnvironment.vue: from root runvite test --project nuxt -t BuildEnvironmentI haven't found a way to mock
useAppConfig=> small refactor atBuildEnvironment.vueto acceptBuildInfoand updatedmodules/build-env.tsto mock it (maybe usinguseRuntimeConfig().publicinstead ? ).supersedes #963