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
210dca8d
Commit
210dca8d
authored
Nov 07, 2019
by
Tim Neutkens
Committed by
Joe Haddad
Nov 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure we correctly decide on which packages need better interopt (#9327)
parent
b9c71d37
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
172 deletions
+29
-172
plugins.ts
packages/next/telemetry/events/plugins.ts
+29
-172
No files found.
packages/next/telemetry/events/plugins.ts
View file @
210dca8d
import
findUp
from
'find-up'
const
EVENT_PLUGIN_PRESENT
=
'NEXT_PACKAGE_DETECTED'
type
EventPackageDetected
=
{
packageName
:
string
packageVersion
:
string
type
NextPluginsEvent
=
{
eventName
:
string
payload
:
{
packageName
:
string
packageVersion
:
string
}
}
const
plugins
=
[
// CSS-in-JS solutions
'styled-components'
,
'radium'
,
'aphrodite'
,
'emotion'
,
'glamorous'
,
'glamor'
,
'fela'
,
'react-jss'
,
'linaria'
,
'typestyle'
,
// Modern Plugins
'@next/bundle-analyzer'
,
'@next/mdx'
,
// Legacy Plugins
'@zeit/next-bundle-analyzer'
,
'@zeit/next-css'
,
'@zeit/next-less'
,
'@zeit/next-mdx'
,
'@zeit/next-preact'
,
'@zeit/next-sass'
,
'@zeit/next-source-maps'
,
'@zeit/next-stylus'
,
'@zeit/next-typescript'
,
'@zeit/next-workers'
,
// Community Plugins
'next-env'
,
'next-offline'
,
'next-optimized-images'
,
'next-runtime-dotenv'
,
'next-progressbar'
,
'next-transpile-modules'
,
'next-react-svg'
,
'@weco/next-plugin-transpile-modules'
,
'next-images'
,
'next-videos'
,
'next-compose-plugins'
,
'next-build-id'
,
'next-routes'
,
'next-router'
,
'next-mdx-enhanced'
,
'next-docify'
,
'next-i18next'
,
'next-redux-saga'
,
'nookies'
,
'next-aws-lambda'
,
'serverless-nextjs-plugin'
,
'next-plugin-styled-icons'
,
'@ematipico/terraform-nextjs-plugin'
,
'next-mui-helper'
,
'nextjs-mui-helper'
,
'next-router-events'
,
'@moxy/next-runtime-env'
,
'next-session'
,
'next-apollo'
,
'next-minimal-routes'
,
'next-router-components'
,
'next-page-loading-bar'
,
'next-flexible-routes'
,
'next-apollo-hoc'
,
'routex.js'
,
'nextron'
,
'next-ga'
,
'nextjs-redirect'
,
'next-mobx-wrapper'
,
'next-ym'
,
'next-contentful'
,
'f-next-ga'
,
'next-plugin-yaml'
,
'data-prefetch-link'
,
'next-helpers'
,
'next-plugin-modernizr'
,
'nextjs-wp'
,
'nextjs-middleware'
,
'nextscript'
,
'next-fbq'
,
'next-analytics'
,
'@engineerapart/nextscript'
,
'next-data-link'
,
'@blunck/next-alias'
,
'@blunck/next-html'
,
'next-universal-redirect'
,
'create-next-app-lite'
,
'next-babel-minify'
,
'@rpominov/reason-next'
,
'create-next-library'
,
'nextscriptnew'
,
'nextjs-sitemap-generator'
,
'@dmartss/with-nprogress'
,
'create-react-next-app'
,
'hapi-nextjs'
,
'@cotype/serverless-next'
,
'nextjs-auth-hoc'
,
'@preco21/next-fonts'
,
'@dmartss/next-hoc'
,
'@xiphe/serverless-nextjs-plugin'
,
'@yellowiki/next-nprogress'
,
'@hashicorp/next-prebuild'
,
'next-i18next2.0'
,
'@futpib/next-ga'
,
'next-url-prettifier'
,
'next-plugin-custom-babel-config'
,
'fastify-nextjs'
,
'@yolkai/next-routes'
,
'trovit-next-routes'
,
'next-routify'
,
'wtp-next-routes'
,
'@whatoplay/next-routes'
,
'@ninetynine/next-routes'
,
'electron-next'
,
'@palmabit/sacajawea'
,
'advanced-next-routes'
,
'next-useragent'
,
'next-routes-with-locale'
,
'next-cookie'
,
'next-i18n-routes'
,
'next-graphql-react'
,
'next-flash-messages'
,
'next-manifest'
,
'next-purgecss'
,
'next-theme-webpack-plugin'
,
'next-serverless'
,
'connected-next-router'
,
'cookies-next'
,
'bs-next-alt'
,
'bs-next'
,
'next-redux'
,
'next-awesome-typescript'
,
'next-applicationinsights'
,
'next-routes-2'
,
'next-spa'
,
'next-precache'
,
'next-dynamic-routes'
,
'next-lambda'
,
'next-workbox'
,
'next-inferno'
,
'next-isserver'
,
'@alicd/next-locale-provider'
,
'shower-next'
,
'next-md'
,
'@primer/next'
,
'next-pages'
,
'amplify-next'
,
'create-next-app'
,
'neutron'
,
'react-intl'
,
'react-intl-universal'
,
'@lingui/react'
,
'@apollo/react-ssr'
,
]
export
async
function
eventNextPlugins
(
dir
:
string
):
Promise
<
Array
<
{
eventName
:
string
;
payload
:
EventPackageDetected
}
>>
{
):
Promise
<
Array
<
NextPluginsEvent
>>
{
try
{
const
packageJsonPath
=
await
findUp
(
'package.json'
,
{
cwd
:
dir
})
if
(
!
packageJsonPath
)
{
...
...
@@ -168,23 +19,29 @@ export async function eventNextPlugins(
}
const
{
dependencies
=
{},
devDependencies
=
{}
}
=
require
(
packageJsonPath
)
return
(
plugins
.
map
(
plugin
=>
{
const
version
=
dependencies
[
plugin
]
||
devDependencies
[
plugin
]
if
(
version
)
{
return
{
pluginName
:
plugin
,
pluginVersion
:
version
}
const
deps
=
{
...
devDependencies
,
...
dependencies
}
return
Object
.
keys
(
deps
).
reduce
(
(
events
:
NextPluginsEvent
[],
plugin
:
string
):
NextPluginsEvent
[]
=>
{
const
version
=
deps
[
plugin
]
// Don't add deps without a version set
if
(
!
version
)
{
return
events
}
})
.
filter
(
Boolean
)
as
{
pluginName
:
string
pluginVersion
:
string
}[]).
map
(({
pluginName
,
pluginVersion
})
=>
({
eventName
:
EVENT_PLUGIN_PRESENT
,
payload
:
{
packageName
:
pluginName
,
packageVersion
:
pluginVersion
,
}
as
EventPackageDetected
,
}))
events
.
push
({
eventName
:
EVENT_PLUGIN_PRESENT
,
payload
:
{
packageName
:
plugin
,
packageVersion
:
version
,
},
})
return
events
},
[]
)
}
catch
(
_
)
{
return
[]
}
...
...
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