Commit 9c2e43a3 authored by Guy Bedford's avatar Guy Bedford Committed by Joe Haddad

find-up

parent e68b5622
......@@ -3,7 +3,7 @@ import ciEnvironment from 'next/dist/compiled/ci-info'
import crypto from 'crypto'
import devalue from 'next/dist/compiled/devalue'
import escapeStringRegexp from 'next/dist/compiled/escape-string-regexp'
import findUp from 'find-up'
import findUp from 'next/dist/compiled/find-up'
import fs from 'fs'
import Worker from 'jest-worker'
import nanoid from 'next/dist/compiled/nanoid/index.js'
......
import findUp from 'find-up'
import findUp from 'next/dist/compiled/find-up'
import fs from 'fs'
import path from 'path'
import { promisify } from 'util'
......
......@@ -67,9 +67,12 @@ const nextDev: cliCommand = argv => {
.catch(err => {
if (err.code === 'EADDRINUSE') {
let errorMessage = `Port ${port} is already in use.`
const pkgAppPath = require('find-up').sync('package.json', {
cwd: dir,
})
const pkgAppPath = require('next/dist/compiled/find-up').sync(
'package.json',
{
cwd: dir,
}
)
const appPackage = require(pkgAppPath)
if (appPackage.scripts) {
const nextScript = Object.entries(appPackage.scripts).find(
......
import chalk from 'next/dist/compiled/chalk'
import findUp from 'find-up'
import findUp from 'next/dist/compiled/find-up'
import {
copyFile as copyFileOrig,
existsSync,
......
import findUp from 'find-up'
import findUp from 'next/dist/compiled/find-up'
import fs from 'fs'
import JSON5 from 'next/dist/compiled/json5'
......
......@@ -3,7 +3,7 @@ import path from 'path'
import chalk from 'next/dist/compiled/chalk'
import dotenvExpand from 'next/dist/compiled/dotenv-expand'
import dotenv, { DotenvConfigOutput } from 'next/dist/compiled/dotenv'
import findUp from 'find-up'
import findUp from 'next/dist/compiled/find-up'
export type Env = { [key: string]: string }
......
import chalk from 'next/dist/compiled/chalk'
import findUp from 'find-up'
import findUp from 'next/dist/compiled/find-up'
import os from 'os'
import { basename, extname } from 'path'
......
......@@ -66,7 +66,6 @@
"cssnano-simple": "1.0.0",
"file-loader": "4.2.0",
"finally-polyfill": "0.1.0",
"find-up": "4.0.0",
"fork-ts-checker-webpack-plugin": "3.1.1",
"ignore-loader": "0.1.2",
"jest-worker": "24.9.0",
......@@ -174,6 +173,7 @@
"dotenv-expand": "5.1.0",
"escape-string-regexp": "2.0.0",
"etag": "1.8.1",
"find-up": "4.0.0",
"fresh": "0.5.2",
"gzip-size": "5.1.1",
"http-proxy": "1.18.0",
......
import AmpHtmlValidator from 'next/dist/compiled/amphtml-validator'
import crypto from 'crypto'
import findUp from 'find-up'
import findUp from 'next/dist/compiled/find-up'
import fs from 'fs'
import { IncomingMessage, ServerResponse } from 'http'
import Worker from 'jest-worker'
......
......@@ -383,6 +383,13 @@ export async function ncc_etag(task, opts) {
.target('dist/compiled/etag')
}
// eslint-disable-next-line camelcase
export async function ncc_find_up(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('find-up')))
.ncc({ packageName: 'find-up', externals })
.target('dist/compiled/find-up')
}
// eslint-disable-next-line camelcase
export async function ncc_fresh(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('fresh')))
......@@ -583,6 +590,7 @@ export async function precompile(task) {
'ncc_dotenv_expand',
'ncc_escape_string_regexp',
'ncc_etag',
'ncc_find_up',
'ncc_fresh',
'ncc_gzip_size',
'ncc_http_proxy',
......
import findUp from 'find-up'
import findUp from 'next/dist/compiled/find-up'
const EVENT_PLUGIN_PRESENT = 'NEXT_PACKAGE_DETECTED'
type NextPluginsEvent = {
......
import findUp from 'find-up'
import findUp from 'next/dist/compiled/find-up'
import path from 'path'
import {
CONFIG_FILE,
......
......@@ -100,6 +100,10 @@ declare module 'next/dist/compiled/etag' {
import m from 'etag'
export = m
}
declare module 'next/dist/compiled/find-up' {
import m from 'find-up'
export = m
}
declare module 'next/dist/compiled/fresh' {
import m from 'fresh'
export = m
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment