Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CoCo_Code_Op2
next.js
提交
210dca8d
N
next.js
项目概览
CoCo_Code_Op2
/
next.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
next.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
210dca8d
编写于
11月 06, 2019
作者:
T
Tim Neutkens
提交者:
Joe Haddad
11月 06, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Ensure we correctly decide on which packages need better interopt (#9327)
上级
b9c71d37
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
172 deletion
+29
-172
packages/next/telemetry/events/plugins.ts
packages/next/telemetry/events/plugins.ts
+29
-172
未找到文件。
packages/next/telemetry/events/plugins.ts
浏览文件 @
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
[]
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录