Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/next/bin/next.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
import arg from 'arg'
import arg from 'next/dist/compiled/arg/index.js'

['react', 'react-dom'].forEach((dependency) => {
try {
Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path'
import webpack from 'webpack'
import resolve from 'resolve'
import resolve from 'next/dist/compiled/resolve/index.js'
import NextJsSsrImportPlugin from './webpack/plugins/nextjs-ssr-import'
import NextJsSSRModuleCachePlugin from './webpack/plugins/nextjs-ssr-module-cache'
import PagesManifestPlugin from './webpack/plugins/pages-manifest-plugin'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/cli/next-build.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
import { resolve, join } from 'path'
import { existsSync } from 'fs'
import arg from 'arg'
import arg from 'next/dist/compiled/arg/index.js'
import build from '../build'
import { printAndExit } from '../server/lib/utils'
import { cliCommand } from '../bin/next'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/cli/next-dev.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { resolve, join } from 'path'
import arg from 'arg'
import arg from 'next/dist/compiled/arg/index.js'
import { existsSync } from 'fs'
import startServer from '../server/lib/start-server'
import { printAndExit } from '../server/lib/utils'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/cli/next-export.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
import { resolve, join } from 'path'
import { existsSync } from 'fs'
import arg from 'arg'
import arg from 'next/dist/compiled/arg/index.js'
import exportApp from '../export'
import { printAndExit } from '../server/lib/utils'
import { cliCommand } from '../bin/next'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/cli/next-start.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node

import { resolve } from 'path'
import arg from 'arg'
import arg from 'next/dist/compiled/arg/index.js'
import startServer from '../server/lib/start-server'
import { cliCommand } from '../bin/next'

Expand Down
5 changes: 2 additions & 3 deletions packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@
"@babel/preset-react": "7.0.0",
"@babel/runtime": "7.1.2",
"@babel/runtime-corejs2": "7.1.2",
"@babel/template": "7.1.2",
"amphtml-validator": "1.0.23",
"arg": "3.0.0",
"async-sema": "2.2.0",
"autodll-webpack-plugin": "0.4.2",
"babel-core": "7.0.0-bridge.0",
Expand All @@ -73,7 +71,6 @@
"react-error-overlay": "5.1.4",
"react-is": "16.6.3",
"recursive-copy": "2.0.6",
"resolve": "1.5.0",
"serialize-javascript": "1.6.1",
"source-map": "0.6.1",
"strip-ansi": "3.0.1",
Expand All @@ -93,6 +90,7 @@
"react-dom": "^16.6.0"
},
"devDependencies": {
"resolve": "1.5.0",
"@babel/parser": "7.2.0",
"@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0",
Expand All @@ -115,6 +113,7 @@
"@types/text-table": "0.2.0",
"@types/webpack-sources": "0.1.5",
"@zeit/ncc": "0.15.2",
"arg": "4.1.0",
"nanoid": "1.2.1",
"taskr": "1.1.0",
"text-table": "0.2.0",
Expand Down
18 changes: 17 additions & 1 deletion packages/next/taskfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ const babelOpts = {
]
}

// eslint-disable-next-line camelcase
export async function ncc_arg (task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('arg')))
.ncc({ packageName: 'arg' })
.target('dist/compiled/arg')
}

// eslint-disable-next-line camelcase
export async function ncc_resolve (task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('resolve')))
.ncc({ packageName: 'resolve' })
.target('dist/compiled/resolve')
}

// eslint-disable-next-line camelcase
export async function ncc_nanoid (task, opts) {
await task
Expand All @@ -45,7 +61,7 @@ export async function ncc_text_table (task, opts) {
}

export async function precompile (task) {
await task.parallel(['ncc_unistore', 'ncc_nanoid', 'ncc_text_table'])
await task.parallel(['ncc_unistore', 'ncc_resolve', 'ncc_arg', 'ncc_nanoid', 'ncc_text_table'])
}

export async function compile (task) {
Expand Down
9 changes: 8 additions & 1 deletion packages/next/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ declare module 'next/dist/compiled/nanoid/index.js' {
export = nanoid;
}

declare module 'arg' {
declare module 'next/dist/compiled/resolve/index.js' {
import resolve from 'resolve'

export = resolve;
}

declare module 'next/dist/compiled/arg/index.js' {
function arg<T extends arg.Spec>(spec: T, options?: {argv?: string[], permissive?: boolean}): arg.Result<T>;

namespace arg {
Expand All @@ -33,6 +39,7 @@ declare module 'arg' {

export = arg;
}

declare module 'autodll-webpack-plugin' {
import webpack from 'webpack'
class AutoDllPlugin implements webpack.Plugin {
Expand Down
17 changes: 4 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -735,15 +735,6 @@
dependencies:
regenerator-runtime "^0.12.0"

"@babel/[email protected]":
version "7.1.2"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.1.2.tgz#090484a574fef5a2d2d7726a674eceda5c5b5644"
integrity sha512-SY1MmplssORfFiLDcOETrW7fCLl+PavlwMh92rrGcikQaRq4iWPVH0MpwPpY3etVMx6RnDjXtr6VZYr/IbP/Ag==
dependencies:
"@babel/code-frame" "^7.0.0"
"@babel/parser" "^7.1.2"
"@babel/types" "^7.1.2"

"@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2":
version "7.2.2"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907"
Expand Down Expand Up @@ -2204,10 +2195,10 @@ are-we-there-yet@~1.1.2:
delegates "^1.0.0"
readable-stream "^2.0.6"

arg@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/arg/-/arg-3.0.0.tgz#386c20035dfbeb13e280ca8a1e6868aa17942def"
integrity sha512-C5Scb477yHhNck9AFzW5RwAzS2Eqn0HR+Fv0pmcZBXBT8g/g7OOuZTr0upVSSUGWZQH+XWdAKIw2OfC86EuggQ==
arg@4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.0.tgz#583c518199419e0037abb74062c37f8519e575f0"
integrity sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==

argparse@^1.0.7:
version "1.0.10"
Expand Down