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
0036a3d1
Unverified
Commit
0036a3d1
authored
Jul 11, 2022
by
OJ Kwon
Committed by
GitHub
Jul 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(next/build): correct payload for plugin telemetry (#38468)
parent
0797b1a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
12 deletions
+10
-12
swc-plugins.ts
packages/next/telemetry/events/swc-plugins.ts
+4
-4
index.test.js
test/integration/telemetry/test/index.test.js
+6
-8
No files found.
packages/next/telemetry/events/swc-plugins.ts
View file @
0036a3d1
...
@@ -5,8 +5,8 @@ const EVENT_SWC_PLUGIN_PRESENT = 'NEXT_SWC_PLUGIN_DETECTED'
...
@@ -5,8 +5,8 @@ const EVENT_SWC_PLUGIN_PRESENT = 'NEXT_SWC_PLUGIN_DETECTED'
type
SwcPluginsEvent
=
{
type
SwcPluginsEvent
=
{
eventName
:
string
eventName
:
string
payload
:
{
payload
:
{
p
ackage
Name
:
string
p
lugin
Name
:
string
p
ackage
Version
?:
string
p
lugin
Version
?:
string
}
}
}
}
...
@@ -34,8 +34,8 @@ export async function eventSwcPlugins(
...
@@ -34,8 +34,8 @@ export async function eventSwcPlugins(
events
.
push
({
events
.
push
({
eventName
:
EVENT_SWC_PLUGIN_PRESENT
,
eventName
:
EVENT_SWC_PLUGIN_PRESENT
,
payload
:
{
payload
:
{
p
ackage
Name
:
plugin
,
p
lugin
Name
:
plugin
,
p
ackage
Version
:
version
,
p
lugin
Version
:
version
,
},
},
})
})
...
...
test/integration/telemetry/test/index.test.js
View file @
0036a3d1
...
@@ -843,19 +843,17 @@ describe('Telemetry CLI', () => {
...
@@ -843,19 +843,17 @@ describe('Telemetry CLI', () => {
const
regex
=
/NEXT_SWC_PLUGIN_DETECTED
[\s\S]
+
?
{
([\s\S]
+
?)
}/g
const
regex
=
/NEXT_SWC_PLUGIN_DETECTED
[\s\S]
+
?
{
([\s\S]
+
?)
}/g
const
coverage
=
regex
.
exec
(
stderr
).
pop
()
const
coverage
=
regex
.
exec
(
stderr
).
pop
()
expect
(
coverage
).
toContain
(
expect
(
coverage
).
toContain
(
`"pluginName": "swc-plugin-coverage-instrument"`
)
`"packageName": "swc-plugin-coverage-instrument"`
expect
(
coverage
).
toContain
(
`"pluginVersion": "0.0.6"`
)
)
expect
(
coverage
).
toContain
(
`"packageVersion": "0.0.6"`
)
const
relay
=
regex
.
exec
(
stderr
).
pop
()
const
relay
=
regex
.
exec
(
stderr
).
pop
()
expect
(
relay
).
toContain
(
`"p
ackage
Name": "@swc/plugin-relay"`
)
expect
(
relay
).
toContain
(
`"p
lugin
Name": "@swc/plugin-relay"`
)
expect
(
relay
).
toContain
(
`"p
ackage
Version": "0.2.0"`
)
expect
(
relay
).
toContain
(
`"p
lugin
Version": "0.2.0"`
)
const
absolute
=
regex
.
exec
(
stderr
).
pop
()
const
absolute
=
regex
.
exec
(
stderr
).
pop
()
expect
(
absolute
).
toContain
(
expect
(
absolute
).
toContain
(
`"p
ackage
Name": "/test/absolute_path/plugin.wasm"`
`"p
lugin
Name": "/test/absolute_path/plugin.wasm"`
)
)
expect
(
absolute
).
not
.
toContain
(
`p
ackage
Version`
)
expect
(
absolute
).
not
.
toContain
(
`p
lugin
Version`
)
})
})
})
})
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