Unverified Commit 66ffc3cd authored by Sukka's avatar Sukka Committed by GitHub

refactor(cna): replace `chalk` with `picocolors`, `glob` with `fast-glob@2.2.7` (#53146)

Follows #53115

- Replace `chalk` with `picocolors`
  - Note that `chalk.hex('#007acc')` has been replaced with `picocolors.blue`
- Replace `glob` with `fast-glob@2.2.7`
  - Not only does `fast-glob` is a faster drop-in replacement of `glob` with first-party `Promise`-based API support, but also `fast-glob` is already a dependency of `cpy`:
 
  <img width="812" alt="image" src="https://github.com/vercel/next.js/assets/40715044/8efa24c4-5312-4b1c-bf8d-68255ca30b60">


Together the PR removes about `50 KiB` from the `create-next-app/dist/index.js`:

<img width="570" alt="image" src="https://github.com/vercel/next.js/assets/40715044/db2f3723-14cc-48ce-9cb2-8aa1fb1d5e95">
Co-authored-by: 's avatarSteven <229881+styfle@users.noreply.github.com>
parent 974accc2
/* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable import/no-extraneous-dependencies */
import retry from 'async-retry' import retry from 'async-retry'
import chalk from 'chalk' import { red, green, cyan } from 'picocolors'
import fs from 'fs' import fs from 'fs'
import path from 'path' import path from 'path'
import { import {
...@@ -76,7 +76,7 @@ export async function createApp({ ...@@ -76,7 +76,7 @@ export async function createApp({
if (repoUrl) { if (repoUrl) {
if (repoUrl.origin !== 'https://github.com') { if (repoUrl.origin !== 'https://github.com') {
console.error( console.error(
`Invalid URL: ${chalk.red( `Invalid URL: ${red(
`"${example}"` `"${example}"`
)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.` )}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`
) )
...@@ -87,7 +87,7 @@ export async function createApp({ ...@@ -87,7 +87,7 @@ export async function createApp({
if (!repoInfo) { if (!repoInfo) {
console.error( console.error(
`Found invalid GitHub URL: ${chalk.red( `Found invalid GitHub URL: ${red(
`"${example}"` `"${example}"`
)}. Please fix the URL and try again.` )}. Please fix the URL and try again.`
) )
...@@ -98,7 +98,7 @@ export async function createApp({ ...@@ -98,7 +98,7 @@ export async function createApp({
if (!found) { if (!found) {
console.error( console.error(
`Could not locate the repository for ${chalk.red( `Could not locate the repository for ${red(
`"${example}"` `"${example}"`
)}. Please check that the repository exists and try again.` )}. Please check that the repository exists and try again.`
) )
...@@ -109,10 +109,10 @@ export async function createApp({ ...@@ -109,10 +109,10 @@ export async function createApp({
if (!found) { if (!found) {
console.error( console.error(
`Could not locate an example named ${chalk.red( `Could not locate an example named ${red(
`"${example}"` `"${example}"`
)}. It could be due to the following:\n`, )}. It could be due to the following:\n`,
`1. Your spelling of example ${chalk.red( `1. Your spelling of example ${red(
`"${example}"` `"${example}"`
)} might be incorrect.\n`, )} might be incorrect.\n`,
`2. You might not be connected to the internet or you are behind a proxy.` `2. You might not be connected to the internet or you are behind a proxy.`
...@@ -145,7 +145,7 @@ export async function createApp({ ...@@ -145,7 +145,7 @@ export async function createApp({
const isOnline = !useYarn || (await getOnline()) const isOnline = !useYarn || (await getOnline())
const originalDirectory = process.cwd() const originalDirectory = process.cwd()
console.log(`Creating a new Next.js app in ${chalk.green(root)}.`) console.log(`Creating a new Next.js app in ${green(root)}.`)
console.log() console.log()
process.chdir(root) process.chdir(root)
...@@ -161,7 +161,7 @@ export async function createApp({ ...@@ -161,7 +161,7 @@ export async function createApp({
if (repoInfo) { if (repoInfo) {
const repoInfo2 = repoInfo const repoInfo2 = repoInfo
console.log( console.log(
`Downloading files from repo ${chalk.cyan( `Downloading files from repo ${cyan(
example example
)}. This might take a moment.` )}. This might take a moment.`
) )
...@@ -171,7 +171,7 @@ export async function createApp({ ...@@ -171,7 +171,7 @@ export async function createApp({
}) })
} else { } else {
console.log( console.log(
`Downloading files for example ${chalk.cyan( `Downloading files for example ${cyan(
example example
)}. This might take a moment.` )}. This might take a moment.`
) )
...@@ -249,26 +249,24 @@ export async function createApp({ ...@@ -249,26 +249,24 @@ export async function createApp({
cdpath = appPath cdpath = appPath
} }
console.log(`${chalk.green('Success!')} Created ${appName} at ${appPath}`) console.log(`${green('Success!')} Created ${appName} at ${appPath}`)
if (hasPackageJson) { if (hasPackageJson) {
console.log('Inside that directory, you can run several commands:') console.log('Inside that directory, you can run several commands:')
console.log() console.log()
console.log(chalk.cyan(` ${packageManager} ${useYarn ? '' : 'run '}dev`)) console.log(cyan(` ${packageManager} ${useYarn ? '' : 'run '}dev`))
console.log(' Starts the development server.') console.log(' Starts the development server.')
console.log() console.log()
console.log(chalk.cyan(` ${packageManager} ${useYarn ? '' : 'run '}build`)) console.log(cyan(` ${packageManager} ${useYarn ? '' : 'run '}build`))
console.log(' Builds the app for production.') console.log(' Builds the app for production.')
console.log() console.log()
console.log(chalk.cyan(` ${packageManager} start`)) console.log(cyan(` ${packageManager} start`))
console.log(' Runs the built app in production mode.') console.log(' Runs the built app in production mode.')
console.log() console.log()
console.log('We suggest that you begin by typing:') console.log('We suggest that you begin by typing:')
console.log() console.log()
console.log(chalk.cyan(' cd'), cdpath) console.log(cyan(' cd'), cdpath)
console.log( console.log(` ${cyan(`${packageManager} ${useYarn ? '' : 'run '}dev`)}`)
` ${chalk.cyan(`${packageManager} ${useYarn ? '' : 'run '}dev`)}`
)
} }
console.log() console.log()
} }
/* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable import/no-extraneous-dependencies */
import chalk from 'chalk' import { yellow } from 'picocolors'
import spawn from 'cross-spawn' import spawn from 'cross-spawn'
import type { PackageManager } from './get-pkg-manager' import type { PackageManager } from './get-pkg-manager'
...@@ -72,9 +72,9 @@ export function install( ...@@ -72,9 +72,9 @@ export function install(
*/ */
args = ['install'] args = ['install']
if (!isOnline) { if (!isOnline) {
console.log(chalk.yellow('You appear to be offline.')) console.log(yellow('You appear to be offline.'))
if (useYarn) { if (useYarn) {
console.log(chalk.yellow('Falling back to the local Yarn cache.')) console.log(yellow('Falling back to the local Yarn cache.'))
console.log() console.log()
args.push('--offline') args.push('--offline')
} else { } else {
......
/* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable import/no-extraneous-dependencies */
import chalk from 'chalk' import { green, blue } from 'picocolors'
import fs from 'fs' import fs from 'fs'
import path from 'path' import path from 'path'
...@@ -35,14 +35,14 @@ export function isFolderEmpty(root: string, name: string): boolean { ...@@ -35,14 +35,14 @@ export function isFolderEmpty(root: string, name: string): boolean {
if (conflicts.length > 0) { if (conflicts.length > 0) {
console.log( console.log(
`The directory ${chalk.green(name)} contains files that could conflict:` `The directory ${green(name)} contains files that could conflict:`
) )
console.log() console.log()
for (const file of conflicts) { for (const file of conflicts) {
try { try {
const stats = fs.lstatSync(path.join(root, file)) const stats = fs.lstatSync(path.join(root, file))
if (stats.isDirectory()) { if (stats.isDirectory()) {
console.log(` ${chalk.blue(file)}/`) console.log(` ${blue(file)}/`)
} else { } else {
console.log(` ${file}`) console.log(` ${file}`)
} }
......
#!/usr/bin/env node #!/usr/bin/env node
/* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable import/no-extraneous-dependencies */
import chalk from 'chalk' import { cyan, green, red, yellow, bold, blue } from 'picocolors'
import Commander from 'commander' import Commander from 'commander'
import Conf from 'conf' import Conf from 'conf'
import path from 'path' import path from 'path'
...@@ -34,7 +34,7 @@ const onPromptState = (state: any) => { ...@@ -34,7 +34,7 @@ const onPromptState = (state: any) => {
const program = new Commander.Command(packageJson.name) const program = new Commander.Command(packageJson.name)
.version(packageJson.version) .version(packageJson.version)
.arguments('<project-directory>') .arguments('<project-directory>')
.usage(`${chalk.green('<project-directory>')} [options]`) .usage(`${green('<project-directory>')} [options]`)
.action((name) => { .action((name) => {
projectPath = name projectPath = name
}) })
...@@ -182,12 +182,10 @@ async function run(): Promise<void> { ...@@ -182,12 +182,10 @@ async function run(): Promise<void> {
if (!projectPath) { if (!projectPath) {
console.log( console.log(
'\nPlease specify the project directory:\n' + '\nPlease specify the project directory:\n' +
` ${chalk.cyan(program.name())} ${chalk.green( ` ${cyan(program.name())} ${green('<project-directory>')}\n` +
'<project-directory>'
)}\n` +
'For example:\n' + 'For example:\n' +
` ${chalk.cyan(program.name())} ${chalk.green('my-next-app')}\n\n` + ` ${cyan(program.name())} ${green('my-next-app')}\n\n` +
`Run ${chalk.cyan(`${program.name()} --help`)} to see all options.` `Run ${cyan(`${program.name()} --help`)} to see all options.`
) )
process.exit(1) process.exit(1)
} }
...@@ -198,12 +196,12 @@ async function run(): Promise<void> { ...@@ -198,12 +196,12 @@ async function run(): Promise<void> {
const { valid, problems } = validateNpmName(projectName) const { valid, problems } = validateNpmName(projectName)
if (!valid) { if (!valid) {
console.error( console.error(
`Could not create a project called ${chalk.red( `Could not create a project called ${red(
`"${projectName}"` `"${projectName}"`
)} because of npm naming restrictions:` )} because of npm naming restrictions:`
) )
problems!.forEach((p) => console.error(` ${chalk.red.bold('*')} ${p}`)) problems!.forEach((p) => console.error(` ${red(bold('*'))} ${p}`))
process.exit(1) process.exit(1)
} }
...@@ -253,7 +251,7 @@ async function run(): Promise<void> { ...@@ -253,7 +251,7 @@ async function run(): Promise<void> {
program.typescript = false program.typescript = false
program.javascript = true program.javascript = true
} else { } else {
const styledTypeScript = chalk.hex('#007acc')('TypeScript') const styledTypeScript = blue('TypeScript')
const { typescript } = await prompts( const { typescript } = await prompts(
{ {
type: 'toggle', type: 'toggle',
...@@ -290,7 +288,7 @@ async function run(): Promise<void> { ...@@ -290,7 +288,7 @@ async function run(): Promise<void> {
if (ciInfo.isCI) { if (ciInfo.isCI) {
program.eslint = true program.eslint = true
} else { } else {
const styledEslint = chalk.hex('#007acc')('ESLint') const styledEslint = blue('ESLint')
const { eslint } = await prompts({ const { eslint } = await prompts({
onState: onPromptState, onState: onPromptState,
type: 'toggle', type: 'toggle',
...@@ -312,7 +310,7 @@ async function run(): Promise<void> { ...@@ -312,7 +310,7 @@ async function run(): Promise<void> {
if (ciInfo.isCI) { if (ciInfo.isCI) {
program.tailwind = false program.tailwind = false
} else { } else {
const tw = chalk.hex('#007acc')('Tailwind CSS') const tw = blue('Tailwind CSS')
const { tailwind } = await prompts({ const { tailwind } = await prompts({
onState: onPromptState, onState: onPromptState,
type: 'toggle', type: 'toggle',
...@@ -334,7 +332,7 @@ async function run(): Promise<void> { ...@@ -334,7 +332,7 @@ async function run(): Promise<void> {
if (ciInfo.isCI) { if (ciInfo.isCI) {
program.srcDir = false program.srcDir = false
} else { } else {
const styledSrcDir = chalk.hex('#007acc')('`src/` directory') const styledSrcDir = blue('`src/` directory')
const { srcDir } = await prompts({ const { srcDir } = await prompts({
onState: onPromptState, onState: onPromptState,
type: 'toggle', type: 'toggle',
...@@ -353,7 +351,7 @@ async function run(): Promise<void> { ...@@ -353,7 +351,7 @@ async function run(): Promise<void> {
if (ciInfo.isCI) { if (ciInfo.isCI) {
program.app = true program.app = true
} else { } else {
const styledAppDir = chalk.hex('#007acc')('App Router') const styledAppDir = blue('App Router')
const { appRouter } = await prompts({ const { appRouter } = await prompts({
onState: onPromptState, onState: onPromptState,
type: 'toggle', type: 'toggle',
...@@ -374,7 +372,7 @@ async function run(): Promise<void> { ...@@ -374,7 +372,7 @@ async function run(): Promise<void> {
if (ciInfo.isCI) { if (ciInfo.isCI) {
program.importAlias = '@/*' program.importAlias = '@/*'
} else { } else {
const styledImportAlias = chalk.hex('#007acc')('import alias') const styledImportAlias = blue('import alias')
const { customizeImportAlias } = await prompts({ const { customizeImportAlias } = await prompts({
onState: onPromptState, onState: onPromptState,
...@@ -466,10 +464,10 @@ async function notifyUpdate(): Promise<void> { ...@@ -466,10 +464,10 @@ async function notifyUpdate(): Promise<void> {
: 'npm i -g create-next-app' : 'npm i -g create-next-app'
console.log( console.log(
chalk.yellow.bold('A new version of `create-next-app` is available!') + yellow(bold('A new version of `create-next-app` is available!')) +
'\n' + '\n' +
'You can update by running: ' + 'You can update by running: ' +
chalk.cyan(updateMessage) + cyan(updateMessage) +
'\n' '\n'
) )
} }
...@@ -485,10 +483,10 @@ run() ...@@ -485,10 +483,10 @@ run()
console.log() console.log()
console.log('Aborting installation.') console.log('Aborting installation.')
if (reason.command) { if (reason.command) {
console.log(` ${chalk.cyan(reason.command)} has failed.`) console.log(` ${cyan(reason.command)} has failed.`)
} else { } else {
console.log( console.log(
chalk.red('Unexpected error. Please report it as a bug:') + '\n', red('Unexpected error. Please report it as a bug:') + '\n',
reason reason
) )
} }
......
...@@ -39,14 +39,14 @@ ...@@ -39,14 +39,14 @@
"@types/validate-npm-package-name": "3.0.0", "@types/validate-npm-package-name": "3.0.0",
"@vercel/ncc": "0.34.0", "@vercel/ncc": "0.34.0",
"async-retry": "1.3.1", "async-retry": "1.3.1",
"chalk": "2.4.2",
"ci-info": "watson/ci-info#f43f6a1cefff47fb361c88cf4b943fdbcaafe540", "ci-info": "watson/ci-info#f43f6a1cefff47fb361c88cf4b943fdbcaafe540",
"commander": "2.20.0", "commander": "2.20.0",
"conf": "10.2.0", "conf": "10.2.0",
"cpy": "7.3.0", "cpy": "7.3.0",
"cross-spawn": "6.0.5", "cross-spawn": "6.0.5",
"glob": "8.0.3", "fast-glob": "2.2.7",
"got": "10.7.0", "got": "10.7.0",
"picocolors": "1.0.0",
"prettier-plugin-tailwindcss": "0.3.0", "prettier-plugin-tailwindcss": "0.3.0",
"prompts": "2.1.0", "prompts": "2.1.0",
"tar": "6.1.15", "tar": "6.1.15",
......
...@@ -2,18 +2,15 @@ import { install } from '../helpers/install' ...@@ -2,18 +2,15 @@ import { install } from '../helpers/install'
import { makeDir } from '../helpers/make-dir' import { makeDir } from '../helpers/make-dir'
import cpy from 'cpy' import cpy from 'cpy'
import globOrig from 'glob' import { async as glob } from 'fast-glob'
import os from 'os' import os from 'os'
import fs from 'fs' import fs from 'fs'
import path from 'path' import path from 'path'
import chalk from 'chalk' import { cyan, bold } from 'picocolors'
import util from 'util'
import { Sema } from 'async-sema' import { Sema } from 'async-sema'
import { GetTemplateFileArgs, InstallTemplateArgs } from './types' import { GetTemplateFileArgs, InstallTemplateArgs } from './types'
const glob = util.promisify(globOrig)
/** /**
* Get the file path for a given file in a template, e.g. "next.config.js". * Get the file path for a given file in a template, e.g. "next.config.js".
*/ */
...@@ -42,7 +39,7 @@ export const installTemplate = async ({ ...@@ -42,7 +39,7 @@ export const installTemplate = async ({
srcDir, srcDir,
importAlias, importAlias,
}: InstallTemplateArgs) => { }: InstallTemplateArgs) => {
console.log(chalk.bold(`Using ${packageManager}.`)) console.log(bold(`Using ${packageManager}.`))
/** /**
* Copy the template files to the target directory. * Copy the template files to the target directory.
...@@ -90,7 +87,11 @@ export const installTemplate = async ({ ...@@ -90,7 +87,11 @@ export const installTemplate = async ({
// update import alias in any files if not using the default // update import alias in any files if not using the default
if (importAlias !== '@/*') { if (importAlias !== '@/*') {
const files = await glob('**/*', { cwd: root, dot: true }) const files = await glob<string>('**/*', {
cwd: root,
dot: true,
stats: false,
})
const writeSema = new Sema(8, { capacity: files.length }) const writeSema = new Sema(8, { capacity: files.length })
await Promise.all( await Promise.all(
files.map(async (file) => { files.map(async (file) => {
...@@ -232,7 +233,7 @@ export const installTemplate = async ({ ...@@ -232,7 +233,7 @@ export const installTemplate = async ({
console.log() console.log()
console.log('Installing dependencies:') console.log('Installing dependencies:')
for (const dependency of dependencies) { for (const dependency of dependencies) {
console.log(`- ${chalk.cyan(dependency)}`) console.log(`- ${cyan(dependency)}`)
} }
console.log() console.log()
......
...@@ -396,14 +396,14 @@ importers: ...@@ -396,14 +396,14 @@ importers:
'@types/validate-npm-package-name': 3.0.0 '@types/validate-npm-package-name': 3.0.0
'@vercel/ncc': 0.34.0 '@vercel/ncc': 0.34.0
async-retry: 1.3.1 async-retry: 1.3.1
chalk: 2.4.2
ci-info: watson/ci-info#f43f6a1cefff47fb361c88cf4b943fdbcaafe540 ci-info: watson/ci-info#f43f6a1cefff47fb361c88cf4b943fdbcaafe540
commander: 2.20.0 commander: 2.20.0
conf: 10.2.0 conf: 10.2.0
cpy: 7.3.0 cpy: 7.3.0
cross-spawn: 6.0.5 cross-spawn: 6.0.5
glob: 8.0.3 fast-glob: 2.2.7
got: 10.7.0 got: 10.7.0
picocolors: 1.0.0
prettier-plugin-tailwindcss: 0.3.0 prettier-plugin-tailwindcss: 0.3.0
prompts: 2.1.0 prompts: 2.1.0
tar: 6.1.15 tar: 6.1.15
...@@ -420,14 +420,14 @@ importers: ...@@ -420,14 +420,14 @@ importers:
'@types/validate-npm-package-name': 3.0.0 '@types/validate-npm-package-name': 3.0.0
'@vercel/ncc': 0.34.0 '@vercel/ncc': 0.34.0
async-retry: 1.3.1 async-retry: 1.3.1
chalk: 2.4.2
ci-info: github.com/watson/ci-info/f43f6a1cefff47fb361c88cf4b943fdbcaafe540 ci-info: github.com/watson/ci-info/f43f6a1cefff47fb361c88cf4b943fdbcaafe540
commander: 2.20.0 commander: 2.20.0
conf: 10.2.0 conf: 10.2.0
cpy: 7.3.0 cpy: 7.3.0
cross-spawn: 6.0.5 cross-spawn: 6.0.5
glob: 8.0.3 fast-glob: 2.2.7
got: 10.7.0 got: 10.7.0
picocolors: 1.0.0
prettier-plugin-tailwindcss: 0.3.0_prettier@2.8.8 prettier-plugin-tailwindcss: 0.3.0_prettier@2.8.8
prompts: 2.1.0 prompts: 2.1.0
tar: 6.1.15 tar: 6.1.15
...@@ -6153,7 +6153,7 @@ packages: ...@@ -6153,7 +6153,7 @@ packages:
dependencies: dependencies:
'@mdx-js/mdx': 2.2.1 '@mdx-js/mdx': 2.2.1
source-map: 0.7.3 source-map: 0.7.3
webpack: 5.86.0 webpack: 5.86.0_@swc+core@1.3.55
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
...@@ -6901,7 +6901,7 @@ packages: ...@@ -6901,7 +6901,7 @@ packages:
dependencies: dependencies:
'@swc/core': 1.3.55_@swc+helpers@0.5.1 '@swc/core': 1.3.55_@swc+helpers@0.5.1
commander: 7.2.0 commander: 7.2.0
fast-glob: 3.2.11 fast-glob: 3.2.12
slash: 3.0.0 slash: 3.0.0
source-map: 0.7.3 source-map: 0.7.3
dev: true dev: true
...@@ -6912,7 +6912,6 @@ packages: ...@@ -6912,7 +6912,6 @@ packages:
cpu: [arm64] cpu: [arm64]
os: [darwin] os: [darwin]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/@swc/core-darwin-x64/1.3.55: /@swc/core-darwin-x64/1.3.55:
...@@ -6921,7 +6920,6 @@ packages: ...@@ -6921,7 +6920,6 @@ packages:
cpu: [x64] cpu: [x64]
os: [darwin] os: [darwin]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/@swc/core-linux-arm-gnueabihf/1.3.55: /@swc/core-linux-arm-gnueabihf/1.3.55:
...@@ -6930,7 +6928,6 @@ packages: ...@@ -6930,7 +6928,6 @@ packages:
cpu: [arm] cpu: [arm]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/@swc/core-linux-arm64-gnu/1.3.55: /@swc/core-linux-arm64-gnu/1.3.55:
...@@ -6939,7 +6936,6 @@ packages: ...@@ -6939,7 +6936,6 @@ packages:
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/@swc/core-linux-arm64-musl/1.3.55: /@swc/core-linux-arm64-musl/1.3.55:
...@@ -6948,7 +6944,6 @@ packages: ...@@ -6948,7 +6944,6 @@ packages:
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/@swc/core-linux-x64-gnu/1.3.55: /@swc/core-linux-x64-gnu/1.3.55:
...@@ -6957,7 +6952,6 @@ packages: ...@@ -6957,7 +6952,6 @@ packages:
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/@swc/core-linux-x64-musl/1.3.55: /@swc/core-linux-x64-musl/1.3.55:
...@@ -6966,7 +6960,6 @@ packages: ...@@ -6966,7 +6960,6 @@ packages:
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/@swc/core-win32-arm64-msvc/1.3.55: /@swc/core-win32-arm64-msvc/1.3.55:
...@@ -6975,7 +6968,6 @@ packages: ...@@ -6975,7 +6968,6 @@ packages:
cpu: [arm64] cpu: [arm64]
os: [win32] os: [win32]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/@swc/core-win32-ia32-msvc/1.3.55: /@swc/core-win32-ia32-msvc/1.3.55:
...@@ -6984,7 +6976,6 @@ packages: ...@@ -6984,7 +6976,6 @@ packages:
cpu: [ia32] cpu: [ia32]
os: [win32] os: [win32]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/@swc/core-win32-x64-msvc/1.3.55: /@swc/core-win32-x64-msvc/1.3.55:
...@@ -6993,7 +6984,6 @@ packages: ...@@ -6993,7 +6984,6 @@ packages:
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
requiresBuild: true requiresBuild: true
dev: true
optional: true optional: true
/@swc/core/1.3.55_@swc+helpers@0.5.1: /@swc/core/1.3.55_@swc+helpers@0.5.1:
...@@ -7018,7 +7008,6 @@ packages: ...@@ -7018,7 +7008,6 @@ packages:
'@swc/core-win32-arm64-msvc': 1.3.55 '@swc/core-win32-arm64-msvc': 1.3.55
'@swc/core-win32-ia32-msvc': 1.3.55 '@swc/core-win32-ia32-msvc': 1.3.55
'@swc/core-win32-x64-msvc': 1.3.55 '@swc/core-win32-x64-msvc': 1.3.55
dev: true
/@swc/helpers/0.4.14: /@swc/helpers/0.4.14:
resolution: {integrity: sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==} resolution: {integrity: sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==}
...@@ -12822,6 +12811,7 @@ packages: ...@@ -12822,6 +12811,7 @@ packages:
glob-parent: 5.1.2 glob-parent: 5.1.2
merge2: 1.4.1 merge2: 1.4.1
micromatch: 4.0.5 micromatch: 4.0.5
dev: false
/fast-glob/3.2.12: /fast-glob/3.2.12:
resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==}
...@@ -13653,17 +13643,6 @@ packages: ...@@ -13653,17 +13643,6 @@ packages:
once: 1.4.0 once: 1.4.0
path-is-absolute: 1.0.1 path-is-absolute: 1.0.1
/glob/8.0.3:
resolution: {integrity: sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==}
engines: {node: '>=12'}
dependencies:
fs.realpath: 1.0.0
inflight: 1.0.6
inherits: 2.0.4
minimatch: 5.1.0
once: 1.4.0
dev: true
/global-dirs/2.1.0: /global-dirs/2.1.0:
resolution: {integrity: sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ==} resolution: {integrity: sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ==}
engines: {node: '>=8'} engines: {node: '>=8'}
...@@ -23925,7 +23904,6 @@ packages: ...@@ -23925,7 +23904,6 @@ packages:
serialize-javascript: 6.0.1 serialize-javascript: 6.0.1
terser: 5.17.7 terser: 5.17.7
webpack: 5.86.0_@swc+core@1.3.55 webpack: 5.86.0_@swc+core@1.3.55
dev: true
/terser/5.10.0: /terser/5.10.0:
resolution: {integrity: sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==} resolution: {integrity: sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==}
...@@ -25281,7 +25259,6 @@ packages: ...@@ -25281,7 +25259,6 @@ packages:
- '@swc/core' - '@swc/core'
- esbuild - esbuild
- uglify-js - uglify-js
dev: true
/websocket-driver/0.7.3: /websocket-driver/0.7.3:
resolution: {integrity: sha512-bpxWlvbbB459Mlipc5GBzzZwhoZgGEZLuqPaR0INBGnPAY1vdBX6hPnoFXiw+3yWxDuHyQjO2oXTMyS8A5haFg==} resolution: {integrity: sha512-bpxWlvbbB459Mlipc5GBzzZwhoZgGEZLuqPaR0INBGnPAY1vdBX6hPnoFXiw+3yWxDuHyQjO2oXTMyS8A5haFg==}
......
...@@ -31,23 +31,24 @@ export const createNextApp = ( ...@@ -31,23 +31,24 @@ export const createNextApp = (
conf.clear() conf.clear()
console.log(`[TEST] $ ${cli} ${args.join(' ')}`, { options }) console.log(`[TEST] $ ${cli} ${args.join(' ')}`, { options })
const cloneEnv = { ...process.env }
// unset CI env as this skips the auto-install behavior
// being tested
delete cloneEnv.CI
delete cloneEnv.CIRCLECI
delete cloneEnv.GITHUB_ACTIONS
delete cloneEnv.CONTINUOUS_INTEGRATION
delete cloneEnv.RUN_ID
delete cloneEnv.BUILD_NUMBER
if (testVersion) {
cloneEnv.NEXT_PRIVATE_TEST_VERSION = testVersion
}
return spawn('node', [cli].concat(args), { return spawn('node', [cli].concat(args), {
...options, ...options,
env: { env: {
...process.env, ...cloneEnv,
// unset CI env as this skips the auto-install behavior
// being tested
CI: '',
CIRCLECI: '',
GITHUB_ACTIONS: '',
CONTINUOUS_INTEGRATION: '',
RUN_ID: '',
BUILD_NUMBER: '',
...(testVersion
? {
NEXT_PRIVATE_TEST_VERSION: testVersion,
}
: {}),
...options.env, ...options.env,
}, },
}) })
......
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