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
41eaa9cf
Unverified
Commit
41eaa9cf
authored
Feb 27, 2019
by
Joe Haddad
Committed by
GitHub
Feb 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run ncc on unistore to fix install warning (#6459)
ncc unistore to fix install warning
parent
88388f79
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
20 deletions
+77
-20
index.ts
packages/next/build/output/index.ts
+1
-1
store.ts
packages/next/build/output/store.ts
+1
-1
package.json
packages/next/package.json
+2
-2
taskfile-ncc.js
packages/next/taskfile-ncc.js
+59
-15
taskfile.js
packages/next/taskfile.js
+14
-1
No files found.
packages/next/build/output/index.ts
View file @
41eaa9cf
import
createStore
from
'unistore'
import
createStore
from
'
next/dist/compiled/
unistore'
import
{
store
,
OutputState
}
from
'./store'
import
{
store
,
OutputState
}
from
'./store'
import
formatWebpackMessages
from
'../../client/dev-error-overlay/format-webpack-messages'
import
formatWebpackMessages
from
'../../client/dev-error-overlay/format-webpack-messages'
...
...
packages/next/build/output/store.ts
View file @
41eaa9cf
import
chalk
from
'chalk'
import
chalk
from
'chalk'
import
createStore
from
'unistore'
import
createStore
from
'
next/dist/compiled/
unistore'
import
readline
from
'readline'
import
readline
from
'readline'
import
{
onExit
}
from
'./exit'
import
{
onExit
}
from
'./exit'
...
...
packages/next/package.json
View file @
41eaa9cf
...
@@ -83,7 +83,6 @@
...
@@ -83,7 +83,6 @@
"terser"
:
"3.16.1"
,
"terser"
:
"3.16.1"
,
"tty-aware-progress"
:
"1.0.3"
,
"tty-aware-progress"
:
"1.0.3"
,
"unfetch"
:
"3.0.0"
,
"unfetch"
:
"3.0.0"
,
"unistore"
:
"3.2.1"
,
"url"
:
"0.11.0"
,
"url"
:
"0.11.0"
,
"webpack"
:
"4.29.0"
,
"webpack"
:
"4.29.0"
,
"webpack-dev-middleware"
:
"3.4.0"
,
"webpack-dev-middleware"
:
"3.4.0"
,
...
@@ -117,7 +116,8 @@
...
@@ -117,7 +116,8 @@
"@types/rimraf"
:
"2.0.2"
,
"@types/rimraf"
:
"2.0.2"
,
"@zeit/ncc"
:
"0.15.2"
,
"@zeit/ncc"
:
"0.15.2"
,
"taskr"
:
"1.1.0"
,
"taskr"
:
"1.1.0"
,
"typescript"
:
"3.1.6"
"typescript"
:
"3.1.6"
,
"unistore"
:
"3.2.1"
},
},
"engines"
:
{
"engines"
:
{
"node"
:
">= 8.0.0"
"node"
:
">= 8.0.0"
...
...
packages/next/taskfile-ncc.js
View file @
41eaa9cf
'use strict'
'use strict'
const
ncc
=
require
(
'@zeit/ncc'
)
const
ncc
=
require
(
'@zeit/ncc'
)
const
basename
=
require
(
'path'
).
basename
const
{
existsSync
,
copyFileSync
}
=
require
(
'fs'
)
const
dirname
=
require
(
'path'
).
dirname
const
{
basename
,
dirname
,
extname
,
join
,
relative
}
=
require
(
'path'
)
const
join
=
require
(
'path'
).
join
module
.
exports
=
function
(
task
)
{
module
.
exports
=
function
(
task
)
{
task
.
plugin
(
'ncc'
,
{},
function
*
(
file
,
options
)
{
task
.
plugin
(
'ncc'
,
{},
function
*
(
file
,
options
)
{
return
ncc
(
return
ncc
(
join
(
__dirname
,
file
.
dir
,
file
.
base
),
{
join
(
__dirname
,
file
.
dir
,
file
.
base
),
{
// cannot bundle
// cannot bundle
externals
:
[
'chokidar'
],
externals
:
[
'chokidar'
],
...
options
...
options
}
}).
then
(({
code
,
assets
})
=>
{
).
then
(({
code
,
assets
})
=>
{
Object
.
keys
(
assets
).
forEach
(
key
=>
Object
.
keys
(
assets
).
forEach
((
key
)
=>
this
.
_
.
files
.
push
({
this
.
_
.
files
.
push
({
dir
:
join
(
file
.
dir
,
dirname
(
key
)),
dir
:
join
(
file
.
dir
,
dirname
(
key
)),
base
:
basename
(
key
),
base
:
basename
(
key
),
data
:
assets
[
key
].
source
data
:
assets
[
key
].
source
}))
})
)
if
(
options
&&
options
.
packageName
)
{
writePackageManifest
.
call
(
this
,
options
.
packageName
)
}
file
.
data
=
Buffer
.
from
(
code
,
'utf8'
)
file
.
data
=
Buffer
.
from
(
code
,
'utf8'
)
})
})
})
})
}
}
// This function writes a minimal `package.json` file for a compiled package.
// It defines `name`, `main`, `author`, and `license`. It also defines `types`.
// n.b. types intended for development usage only.
function
writePackageManifest
(
packageName
)
{
const
packagePath
=
require
.
resolve
(
packageName
+
'/package.json'
)
let
{
name
,
main
,
author
,
license
,
types
,
typings
}
=
require
(
packagePath
)
if
(
!
main
)
{
main
=
'index.js'
}
let
typesFile
=
types
||
typings
if
(
typesFile
)
{
typesFile
=
require
.
resolve
(
join
(
packageName
,
typesFile
))
}
const
compiledPackagePath
=
join
(
__dirname
,
`dist/compiled/
${
packageName
}
`
)
const
potentialLicensePath
=
join
(
dirname
(
packagePath
),
'./LICENSE'
)
if
(
existsSync
(
potentialLicensePath
))
{
copyFileSync
(
potentialLicensePath
,
join
(
compiledPackagePath
,
'./LICENSE'
))
}
this
.
_
.
files
.
push
({
dir
:
compiledPackagePath
,
base
:
'package.json'
,
data
:
JSON
.
stringify
(
Object
.
assign
(
{},
{
name
,
main
:
`
${
basename
(
main
,
'.'
+
extname
(
main
))}
`
},
author
?
{
author
}
:
undefined
,
license
?
{
license
}
:
undefined
,
typesFile
?
{
types
:
relative
(
compiledPackagePath
,
typesFile
)
}
:
undefined
)
)
+
'
\
n'
})
}
packages/next/taskfile.js
View file @
41eaa9cf
const
notifier
=
require
(
'node-notifier'
)
const
notifier
=
require
(
'node-notifier'
)
const
relative
=
require
(
'path'
).
relative
const
babelOpts
=
{
const
babelOpts
=
{
presets
:
[
presets
:
[
[
'@babel/preset-env'
,
{
[
'@babel/preset-env'
,
{
...
@@ -18,6 +20,17 @@ const babelOpts = {
...
@@ -18,6 +20,17 @@ const babelOpts = {
]
]
}
}
export
async
function
nccunistore
(
task
,
opts
)
{
await
task
.
source
(
opts
.
src
||
relative
(
__dirname
,
require
.
resolve
(
'unistore'
)))
.
ncc
({
packageName
:
'unistore'
})
.
target
(
'dist/compiled/unistore'
)
}
export
async
function
precompile
(
task
)
{
await
task
.
parallel
([
'nccunistore'
])
}
export
async
function
compile
(
task
)
{
export
async
function
compile
(
task
)
{
await
task
.
parallel
([
'cli'
,
'bin'
,
'server'
,
'nextbuild'
,
'nextbuildstatic'
,
'pages'
,
'lib'
,
'client'
])
await
task
.
parallel
([
'cli'
,
'bin'
,
'server'
,
'nextbuild'
,
'nextbuildstatic'
,
'pages'
,
'lib'
,
'client'
])
}
}
...
@@ -63,7 +76,7 @@ export async function pages (task, opts) {
...
@@ -63,7 +76,7 @@ export async function pages (task, opts) {
}
}
export
async
function
build
(
task
)
{
export
async
function
build
(
task
)
{
await
task
.
serial
([
'compile'
])
await
task
.
serial
([
'
precompile'
,
'
compile'
])
}
}
export
default
async
function
(
task
)
{
export
default
async
function
(
task
)
{
...
...
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