Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
26f8793e
Unverified
Commit
26f8793e
authored
Mar 24, 2023
by
Steven
Committed by
GitHub
Mar 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: add telemetry for `output: export` (#47464)
fix NEXT-870 ([link](
https://linear.app/vercel/issue/NEXT-870)
)
parent
2a257cef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
version.ts
packages/next/src/telemetry/events/version.ts
+3
-0
config.test.js
test/integration/telemetry/test/config.test.js
+23
-0
No files found.
packages/next/src/telemetry/events/version.ts
View file @
26f8793e
...
...
@@ -26,6 +26,7 @@ type EventCliSessionStarted = {
imageSizes
:
string
|
null
imageLoader
:
string
|
null
imageFormats
:
string
|
null
nextConfigOutput
:
string
|
null
trailingSlashEnabled
:
boolean
reactStrictMode
:
boolean
webpackVersion
:
number
|
null
...
...
@@ -75,6 +76,7 @@ export function eventCliSession(
|
'imageSizes'
|
'imageLoader'
|
'imageFormats'
|
'nextConfigOutput'
|
'trailingSlashEnabled'
|
'reactStrictMode'
>
...
...
@@ -111,6 +113,7 @@ export function eventCliSession(
imageSizes
:
images
?.
imageSizes
?
images
.
imageSizes
.
join
(
','
)
:
null
,
imageLoader
:
images
?.
loader
,
imageFormats
:
images
?.
formats
?
images
.
formats
.
join
(
','
)
:
null
,
nextConfigOutput
:
nextConfig
?.
output
||
null
,
trailingSlashEnabled
:
!!
nextConfig
?.
trailingSlash
,
reactStrictMode
:
!!
nextConfig
?.
reactStrictMode
,
webpackVersion
:
event
.
webpackVersion
||
null
,
...
...
test/integration/telemetry/test/config.test.js
View file @
26f8793e
...
...
@@ -66,6 +66,7 @@ describe('config telemetry', () => {
expect
(
event1
).
toMatch
(
/"imageRemotePatternsCount": 1/
)
expect
(
event1
).
toMatch
(
/"imageSizes": "64,128,256,512,1024"/
)
expect
(
event1
).
toMatch
(
/"imageFormats": "image
\/
avif,image
\/
webp"/
)
expect
(
event1
).
toMatch
(
/"nextConfigOutput": null/
)
expect
(
event1
).
toMatch
(
/"trailingSlashEnabled": false/
)
expect
(
event1
).
toMatch
(
/"reactStrictMode": false/
)
expect
(
event1
).
toMatch
(
/"turboFlag": false/
)
...
...
@@ -105,10 +106,32 @@ describe('config telemetry', () => {
expect
(
event2
).
toMatch
(
/"imageDomainsCount": 2/
)
expect
(
event2
).
toMatch
(
/"imageRemotePatternsCount": 1/
)
expect
(
event2
).
toMatch
(
/"imageSizes": "64,128,256,512,1024"/
)
expect
(
event2
).
toMatch
(
/"nextConfigOutput": null/
)
expect
(
event2
).
toMatch
(
/"trailingSlashEnabled": false/
)
expect
(
event2
).
toMatch
(
/"reactStrictMode": false/
)
})
it
(
'detects output config for session start'
,
async
()
=>
{
await
fs
.
writeFile
(
'./next.config.js'
,
'module.exports = { output: "export" }'
)
try
{
const
{
stderr
}
=
await
nextBuild
(
appDir
,
[],
{
stderr
:
true
,
env
:
{
NEXT_TELEMETRY_DEBUG
:
1
},
})
const
event1
=
/NEXT_CLI_SESSION_STARTED
[\s\S]
+
?
{
([\s\S]
+
?)
}/
.
exec
(
stderr
)
.
pop
()
expect
(
event1
).
toContain
(
'"nextConfigOutput": "export"'
)
}
finally
{
await
fs
.
remove
(
'./next.config.js'
)
}
})
it
(
'emits telemetry for lint during build'
,
async
()
=>
{
await
fs
.
writeFile
(
path
.
join
(
appDir
,
'.eslintrc'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment